Browse Source
- Collection's properties got private setter. - First draft of Dependency Matrix which uses a tree. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6251 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
13 changed files with 463 additions and 353 deletions
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
<UserControl x:Class="ICSharpCode.CodeQualityAnalysis.Controls.TreeMatrixControl" |
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
xmlns:Controls="clr-namespace:ICSharpCode.CodeQualityAnalysis.Controls"> |
||||
<UserControl.Resources> |
||||
<Style TargetType="{x:Type TreeViewItem}"> |
||||
<Setter Property="BorderBrush" Value="Red" /> |
||||
<Setter Property="Header" Value="test" /> |
||||
</Style> |
||||
</UserControl.Resources> |
||||
<Grid> |
||||
<Grid.RowDefinitions> |
||||
<RowDefinition Height="Auto" /> |
||||
<RowDefinition Height="Auto" /> |
||||
</Grid.RowDefinitions> |
||||
|
||||
<Grid.ColumnDefinitions> |
||||
<ColumnDefinition Width="Auto" /> |
||||
<ColumnDefinition Width="Auto" /> |
||||
</Grid.ColumnDefinitions> |
||||
|
||||
<TreeView Name="leftTree" Grid.Row="1" Grid.Column="0"> |
||||
<TreeView.Resources> |
||||
|
||||
</TreeView.Resources> |
||||
</TreeView> |
||||
|
||||
<TreeView Name="topTree" Grid.Row="0" Grid.Column="1"> |
||||
<TreeView.LayoutTransform> |
||||
<RotateTransform Angle="-90" /> |
||||
</TreeView.LayoutTransform> |
||||
</TreeView> |
||||
|
||||
<WindowsFormsHost Grid.Column="1" Grid.Row="1"> |
||||
<Controls:DependencyMatrixControl x:Name="matrixControl"></Controls:DependencyMatrixControl> |
||||
</WindowsFormsHost> |
||||
</Grid> |
||||
</UserControl> |
||||
@ -0,0 +1,101 @@
@@ -0,0 +1,101 @@
|
||||
/* |
||||
* Created by SharpDevelop. |
||||
* User: Tomas |
||||
* Date: 26.7.2010 |
||||
* Time: 10:08 |
||||
* |
||||
* To change this template use Tools | Options | Coding | Edit Standard Headers. |
||||
*/ |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows; |
||||
using System.Windows.Controls; |
||||
using System.Windows.Controls.Primitives; |
||||
using System.Windows.Data; |
||||
using System.Windows.Documents; |
||||
using System.Windows.Input; |
||||
using System.Windows.Media; |
||||
using System.Windows.Forms; |
||||
|
||||
namespace ICSharpCode.CodeQualityAnalysis.Controls |
||||
{ |
||||
/// <summary>
|
||||
/// Interaction logic for TreeMatrixControl.xaml
|
||||
/// </summary>
|
||||
public partial class TreeMatrixControl : System.Windows.Controls.UserControl |
||||
{ |
||||
public Matrix<INode> Matrix |
||||
{ |
||||
get |
||||
{ |
||||
return matrixControl.Matrix; |
||||
} |
||||
|
||||
set |
||||
{ |
||||
matrixControl.Matrix = value; |
||||
} |
||||
} |
||||
|
||||
public TreeMatrixControl() |
||||
{ |
||||
InitializeComponent(); |
||||
|
||||
matrixControl.RowHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; |
||||
matrixControl.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single; |
||||
matrixControl.BorderStyle = BorderStyle.FixedSingle; |
||||
|
||||
matrixControl.RowHeadersVisible = false; |
||||
matrixControl.ColumnHeadersVisible = false; |
||||
} |
||||
|
||||
public void DrawMatrix() |
||||
{ |
||||
matrixControl.DrawMatrix(); |
||||
} |
||||
|
||||
public void DrawTree(Module module) |
||||
{ |
||||
foreach (var ns in module.Namespaces) |
||||
{ |
||||
var nsType = new TreeViewItem |
||||
{ |
||||
Header = ns.Name |
||||
}; |
||||
|
||||
leftTree.Items.Add(nsType); |
||||
|
||||
foreach (var type in ns.Types) |
||||
{ |
||||
var itemType = new TreeViewItem |
||||
{ |
||||
Header = type.Name |
||||
}; |
||||
|
||||
nsType.Items.Add(itemType); |
||||
|
||||
foreach (var method in type.Methods) |
||||
{ |
||||
var itemMethod = new TreeViewItem |
||||
{ |
||||
Header = method.Name |
||||
}; |
||||
|
||||
itemType.Items.Add(itemMethod); |
||||
} |
||||
|
||||
foreach (var field in type.Fields) |
||||
{ |
||||
var itemField = new TreeViewItem |
||||
{ |
||||
Header = field.Name |
||||
}; |
||||
|
||||
itemType.Items.Add(itemField); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
Loading…
Reference in new issue