Browse Source

The summary box provides now basic summary of node.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6081 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Tomáš Linhart 16 years ago
parent
commit
3c1c1211f8
  1. 1
      src/AddIns/Analysis/CodeQuality/Src/Event.cs
  2. 25
      src/AddIns/Analysis/CodeQuality/Src/Field.cs
  3. 2
      src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml.cs
  4. 32
      src/AddIns/Analysis/CodeQuality/Src/Method.cs
  5. 12
      src/AddIns/Analysis/CodeQuality/Src/Module.cs
  6. 11
      src/AddIns/Analysis/CodeQuality/Src/Namespace.cs
  7. 39
      src/AddIns/Analysis/CodeQuality/Src/Type.cs

1
src/AddIns/Analysis/CodeQuality/Src/Event.cs

@ -37,6 +37,7 @@ namespace ICSharpCode.CodeQualityAnalysis
public string GetInfo() public string GetInfo()
{ {
// Events aren't visible. They are showed like fields instead.
return this.ToString(); return this.ToString();
} }
} }

25
src/AddIns/Analysis/CodeQuality/Src/Field.cs

@ -86,7 +86,30 @@ namespace ICSharpCode.CodeQualityAnalysis
public string GetInfo() public string GetInfo()
{ {
return this.ToString(); var builder = new StringBuilder();
builder.AppendLine("Field Summary");
builder.Append(Environment.NewLine);
builder.AppendLine(String.Format("Name: {0}", Name));
// more to come
builder.Append(Environment.NewLine);
if (IsConstant)
builder.AppendLine("IsConstant");
if (IsEvent)
builder.AppendLine("IsEvent");
if (IsPrivate)
builder.AppendLine("IsPrivate");
if (IsProtected)
builder.AppendLine("IsProtected");
if (IsPublic)
builder.AppendLine("IsPublic");
if (IsReadOnly)
builder.AppendLine("IsReadOnly");
if (IsStatic)
builder.AppendLine("IsStatic");
return builder.ToString();
} }
} }
} }

2
src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml.cs

@ -148,7 +148,7 @@ namespace ICSharpCode.CodeQualityAnalysis
var vertex = vertexControl.Vertex as DependencyVertex; var vertex = vertexControl.Vertex as DependencyVertex;
if (vertex != null) if (vertex != null)
{ {
txbTypeInfo.Text = "Summary: \n" + vertex.Node.GetInfo(); txbTypeInfo.Text = vertex.Node.GetInfo();
} }
} }
} }

32
src/AddIns/Analysis/CodeQuality/Src/Method.cs

@ -129,7 +129,37 @@ namespace ICSharpCode.CodeQualityAnalysis
public string GetInfo() public string GetInfo()
{ {
return this.ToString(); var builder = new StringBuilder();
builder.AppendLine("Method Summary");
builder.Append(Environment.NewLine);
builder.AppendLine(String.Format("Name: {0}", Name));
builder.AppendLine(String.Format("Parameters: {0}", Parameters.Count));
// more to come
builder.Append(Environment.NewLine);
if (IsAbstract)
builder.AppendLine("IsAbstract");
if (IsConstructor)
builder.AppendLine("IsConstructor");
if (IsGetter)
builder.AppendLine("IsGetter");
if (IsSetter)
builder.AppendLine("IsSetter");
if (IsPrivate)
builder.AppendLine("IsPrivate");
if (IsProtected)
builder.AppendLine("IsProtected");
if (IsPublic)
builder.AppendLine("IsPublic");
if (IsSealed)
builder.AppendLine("IsSealed");
if (IsStatic)
builder.AppendLine("IsStatic");
if (IsVirtual)
builder.AppendLine("IsVirtual");
return builder.ToString();
} }
} }

12
src/AddIns/Analysis/CodeQuality/Src/Module.cs

@ -68,7 +68,17 @@ namespace ICSharpCode.CodeQualityAnalysis
public string GetInfo() public string GetInfo()
{ {
return this.ToString(); var builder = new StringBuilder();
builder.AppendLine("Module Summary");
builder.Append(Environment.NewLine);
builder.AppendLine(String.Format("Name: {0}", Name));
builder.AppendLine(String.Format("Methods: {0}", Namespaces.Sum(ns => ns.Types.Sum(type => type.Methods.Count))));
builder.AppendLine(String.Format("Fields: {0}", Namespaces.Sum(ns => ns.Types.Sum(type => type.Fields.Count))));
builder.AppendLine(String.Format("Types: {0}", Namespaces.Sum(ns => ns.Types.Count)));
builder.AppendLine(String.Format("Namespaces: {0}", Namespaces.Count));
// more to come
return builder.ToString();
} }
} }
} }

11
src/AddIns/Analysis/CodeQuality/Src/Namespace.cs

@ -69,7 +69,16 @@ namespace ICSharpCode.CodeQualityAnalysis
public string GetInfo() public string GetInfo()
{ {
return this.ToString(); var builder = new StringBuilder();
builder.AppendLine("Namespace Summary");
builder.Append(Environment.NewLine);
builder.AppendLine(String.Format("Name: {0}", Name));
builder.AppendLine(String.Format("Methods: {0}", Types.Sum(type => type.Methods.Count)));
builder.AppendLine(String.Format("Fields: {0}", Types.Sum(type => type.Fields.Count)));
builder.AppendLine(String.Format("Types: {0}", Types.Count));
// more to come
return builder.ToString();
} }
} }
} }

39
src/AddIns/Analysis/CodeQuality/Src/Type.cs

@ -252,7 +252,44 @@ namespace ICSharpCode.CodeQualityAnalysis
public string GetInfo() public string GetInfo()
{ {
return this.ToString(); var builder = new StringBuilder();
builder.AppendLine("Type Summary");
builder.Append(Environment.NewLine);
builder.AppendLine(String.Format("Name: {0}", Name));
builder.AppendLine(String.Format("Methods: {0}", Methods.Count));
builder.AppendLine(String.Format("Fields: {0}", Fields.Count));
builder.AppendLine(String.Format("Nested types: {0}", NestedTypes.Count));
builder.AppendLine(String.Format("Implemented interfaces: {0}", ImplementedInterfaces.Count));
// more to come
builder.Append(Environment.NewLine);
if (IsAbstract)
builder.AppendLine("IsAbstract");
if (IsClass)
builder.AppendLine("IsClass");
if (IsDelegate)
builder.AppendLine("IsDelegate");
if (IsEnum)
builder.AppendLine("IsEnum");
if (IsInterface)
builder.AppendLine("IsInterface");
if (IsInternal)
builder.AppendLine("IsInternal");
if (IsNestedPrivate)
builder.AppendLine("IsNestedPrivate");
if (IsNestedProtected)
builder.AppendLine("IsNestedProtected");
if (IsNestedPublic)
builder.AppendLine("IsNestedPublic");
if (IsPublic)
builder.AppendLine("IsPublic");
if (IsSealed)
builder.AppendLine("IsSealed");
if (IsStruct)
builder.AppendLine("IsStruct");
return builder.ToString();
} }
} }
} }

Loading…
Cancel
Save