Browse Source

add/update documentation for IAssemblyModel and INamespaceModel

addin-manager-package-subdirectories
Siegfried Pammer 12 years ago
parent
commit
151ac64524
  1. 41
      src/Main/Base/Project/Dom/IAssemblyModel.cs
  2. 23
      src/Main/Base/Project/Dom/INamespaceModel.cs
  3. 2
      src/Main/SharpDevelop/Dom/NamespaceModel.cs
  4. 2
      src/Main/SharpDevelop/Dom/ProjectAssemblyModel.cs

41
src/Main/Base/Project/Dom/IAssemblyModel.cs

@ -7,17 +7,54 @@ using ICSharpCode.NRefactory.TypeSystem; @@ -7,17 +7,54 @@ using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.SharpDevelop.Dom
{
/// <summary>
/// Represents an assembly.
/// </summary>
public interface IAssemblyModel
{
string Name { get; }
/// <summary>
/// Gets the assembly name (short name).
/// </summary>
string AssemblyName { get; }
/// <summary>
/// Gets a collection of all top-level type definitions.
/// Top-level means it does not contain nested classes (but classes from nested namespaces!).
/// </summary>
ITypeDefinitionModelCollection TopLevelTypeDefinitions { get; }
/// <summary>
/// Gets a flat list of all namespaces that contain types.
/// </summary>
/// <remarks>
/// If we have N1.T1 and N1.N2.T2, returns { N1, N1.N2 }.
/// If we only have N1.N2.T2 returns { N1.N2 }.
/// It may return the namespace without a name, thus it is only empty
/// if there are no type definitions in the assembly.
/// </remarks>
IModelCollection<INamespaceModel> Namespaces { get; }
/// <summary>
/// Gets the root namespace for this assembly.
/// </summary>
/// <remarks>
/// This always is the namespace without a name - it's unrelated to the 'root namespace' project setting.
/// </remarks>
INamespaceModel RootNamespace { get; }
}
/// <summary>
/// Represents an assembly that can be updated.
/// </summary>
public interface IUpdateableAssemblyModel : IAssemblyModel
{
/// <summary>
/// Updates the parse information with the given file.
/// </summary>
/// <remarks>
/// <paramref name="oldFile"/> is null if the file is newly added to the assemly.
/// <paramref name="newFile"/> is null if the file is removed from the assembly.
/// </remarks>
void Update(IUnresolvedFile oldFile, IUnresolvedFile newFile);
}
@ -29,7 +66,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -29,7 +66,7 @@ namespace ICSharpCode.SharpDevelop.Dom
{
}
public string Name {
public string AssemblyName {
get { return string.Empty; }
}

23
src/Main/Base/Project/Dom/INamespaceModel.cs

@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.ComponentModel;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.SharpDevelop.Dom
@ -11,11 +12,33 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -11,11 +12,33 @@ namespace ICSharpCode.SharpDevelop.Dom
/// </summary>
public interface INamespaceModel : ISymbolModel
{
/// <summary>
/// Gets the full name of the namespace.
/// </summary>
string FullName { get; }
/// <summary>
/// Gets the parent namespace. Returns null only if this is the namespace without a name.
/// </summary>
INamespaceModel ParentNamespace { get; }
/// <summary>
/// Gets a collection of all child namespaces.
/// </summary>
IModelCollection<INamespaceModel> ChildNamespaces { get; }
/// <summary>
/// Gets a collection of all top-level types in this namespace.
/// </summary>
IModelCollection<ITypeDefinitionModel> Types { get; }
/// <inheritdoc/>
/// <remarks>
/// Always returns <see cref="DomRegion.Empty"/> for namespaces,
/// because they are not defined in one single location.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
new DomRegion Region { get; }
}
public sealed class EmptyNamespaceModel : INamespaceModel

2
src/Main/SharpDevelop/Dom/NamespaceModel.cs

@ -28,7 +28,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -28,7 +28,7 @@ namespace ICSharpCode.SharpDevelop.Dom
this.childNamespaces = new NullSafeSimpleModelCollection<NamespaceModel>();
}
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler PropertyChanged { add {} remove {} }
public string FullName {
get {

2
src/Main/SharpDevelop/Dom/ProjectAssemblyModel.cs

@ -29,7 +29,7 @@ namespace ICSharpCode.SharpDevelop.Dom @@ -29,7 +29,7 @@ namespace ICSharpCode.SharpDevelop.Dom
this.namespaces = new KeyedModelCollection<string, NamespaceModel>(value => value.FullName);
}
public string Name {
public string AssemblyName {
get {
return context.Project.AssemblyName;
}

Loading…
Cancel
Save