Browse Source

CodeQualityAnalysis - Rework StatusBar to show actual values of selected Item

pull/22/head
PeterForstmeier 14 years ago
parent
commit
8497323e67
  1. 15
      src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml
  2. 4
      src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml.cs
  3. 50
      src/AddIns/Analysis/CodeQuality/Src/MainWindowModel.cs

15
src/AddIns/Analysis/CodeQuality/Src/MainWindow.xaml

@ -361,6 +361,7 @@ @@ -361,6 +361,7 @@
Height="15" />
</StackPanel>
</StatusBarItem>
<!--
<StatusBarItem
HorizontalAlignment="Right"
Visibility="{Binding AssemblyStatsVisible}">
@ -413,6 +414,20 @@ @@ -413,6 +414,20 @@
</StatusBarItem>
</StackPanel>
</StatusBarItem>
-->
<StatusBarItem
HorizontalAlignment="Right"
Visibility="{Binding AssemblyStatsVisible}">
<StatusBarItem>
<StackPanel
Orientation="Horizontal">
<TextBlock
Text="Summary: " />
<TextBlock
Text="{Binding Summary}" />
</StackPanel>
</StatusBarItem>
</StatusBarItem>
</StatusBar>
</Grid>

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

@ -84,7 +84,7 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -84,7 +84,7 @@ namespace ICSharpCode.CodeQualityAnalysis
}
Helper.FillTree(definitionTree, metricsReader.MainModule);
dataContext.MainModule = metricsReader.MainModule;
dataContext.MainModule = metricsReader.MainModule;
FillMatrix();
};
@ -141,8 +141,6 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -141,8 +141,6 @@ namespace ICSharpCode.CodeQualityAnalysis
var viewModel = this.DataContext as MainWindowViewModel;
//testhalber
viewModel.SelectedNode = item.INode;
// viewModel.MetrixTabEnable = true;
}
}

50
src/AddIns/Analysis/CodeQuality/Src/MainWindowModel.cs

@ -58,8 +58,6 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -58,8 +58,6 @@ namespace ICSharpCode.CodeQualityAnalysis
this.TabMetrics = "Metrics";
#endregion
// MetrixTabEnable = false;
ActivateMetrics = new RelayCommand(ActivateMetricsExecute);
ShowTreeMap = new RelayCommand(ShowTreemapExecute,CanActivateTreemap);
}
@ -77,7 +75,6 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -77,7 +75,6 @@ namespace ICSharpCode.CodeQualityAnalysis
#endregion
private string fileName;
public string FileName {
@ -135,6 +132,12 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -135,6 +132,12 @@ namespace ICSharpCode.CodeQualityAnalysis
get { return mainModule; }
set { mainModule = value;
base.RaisePropertyChanged(() =>this.MainModule);
Summary = String.Format("Module Name: {0} Namespaces: {1} Types {2} Methods: {3} Fields: {4}",
mainModule.Name,
mainModule.Namespaces.Count,
mainModule.TypesCount,
mainModule.MethodsCount,
mainModule.FieldsCount);
}
}
@ -145,9 +148,34 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -145,9 +148,34 @@ namespace ICSharpCode.CodeQualityAnalysis
get { return selectedNode; }
set { selectedNode = value;
base.RaisePropertyChanged(() =>this.SelectedNode);
base.RaisePropertyChanged(() =>this.MetrixTabEnable);}
base.RaisePropertyChanged(() =>this.MetrixTabEnable);
Summary = UpdateToolStrip();
}
}
string UpdateToolStrip()
{
var t = SelectedNode as Type;
if (t != null)
{
return string.Format("Type Namer {0} Methods {1} Fields {2}",
t.Name,
t.GetAllMethods().Count(),
t.GetAllFields().Count());
}
var ns = SelectedNode as Namespace;
if ( ns != null) {
return string.Format("Namespace Name {0} Types : {1} Methods: {2} Fields : {3}",
ns.Name,
ns.Types.Count,
ns.GetAllMethods().Count(),
ns.GetAllFields().Count());
}
return String.Empty;
}
private ObservableCollection<INode> nodes;
public ObservableCollection<INode> Nodes {
@ -231,7 +259,6 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -231,7 +259,6 @@ namespace ICSharpCode.CodeQualityAnalysis
}
}
#endregion
#region ShowTreeMap Treemap
@ -306,5 +333,18 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -306,5 +333,18 @@ namespace ICSharpCode.CodeQualityAnalysis
}
#endregion
#region ToolStrip and ToolTip
string summary;
public string Summary {
get { return summary; }
set { summary = value;
base.RaisePropertyChanged(() => Summary);
}
}
#endregion
}
}

Loading…
Cancel
Save