Browse Source

Merge branch 'master' of github.com:icsharpcode/SharpDevelop

pull/19/head
PeterForstmeier 14 years ago
parent
commit
9533eaecca
  1. 4
      src/AddIns/Analysis/CodeQuality/Src/Controls/DependencyColorizer.cs
  2. 3
      src/AddIns/Analysis/CodeQuality/Src/Controls/DependencyMatrix.cs
  3. 23
      src/AddIns/Analysis/CodeQuality/Src/Controls/MatrixControl.cs
  4. 8
      src/AddIns/Analysis/CodeQuality/Src/Controls/TreeMatrixControl.xaml.cs
  5. 6
      src/AddIns/Analysis/CodeQuality/Src/Field.cs
  6. 6
      src/AddIns/Analysis/CodeQuality/Src/Method.cs
  7. 3
      src/AddIns/Analysis/CodeQuality/Src/Relationship.cs

4
src/AddIns/Analysis/CodeQuality/Src/Controls/DependencyColorizer.cs

@ -42,9 +42,9 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls @@ -42,9 +42,9 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls
return Colors.Transparent;
if (relationship.Relationships.Any(r => r == RelationshipType.UseThis))
return Colors.Azure;
return Colors.LightBlue;
if (relationship.Relationships.Any(r => r == RelationshipType.UsedBy))
return Colors.Beige;
return Colors.Violet;
if (relationship.Relationships.Any(r => r == RelationshipType.Same))
return Colors.Gray;

3
src/AddIns/Analysis/CodeQuality/Src/Controls/DependencyMatrix.cs

@ -16,6 +16,9 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls @@ -16,6 +16,9 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls
var toRelationship = HeaderRows[rowIndex].Value.GetRelationship(HeaderColumns[columnIndex].Value);
var fromRelationship = HeaderColumns[columnIndex].Value.GetRelationship(HeaderRows[rowIndex].Value);
toRelationship.From = HeaderRows[rowIndex].Value;
toRelationship.To = HeaderColumns[columnIndex].Value;
// add other way
foreach (var relationship in fromRelationship.Relationships) {
if (relationship == RelationshipType.UseThis)

23
src/AddIns/Analysis/CodeQuality/Src/Controls/MatrixControl.cs

@ -105,17 +105,24 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls @@ -105,17 +105,24 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls
{
var items = type == HeaderType.Columns ? matrix.HeaderColumns : matrix.HeaderRows;
for (int i = 0; i < items.Count; i++) {
if (node.Equals(items[i])) {
if (items[i].Value.Equals(node)) {
if (currentCell.X == i && type == HeaderType.Rows)
return;
if (currentCell.Y == i && type == HeaderType.Columns)
return;
currentCell = type == HeaderType.Columns ?
new Coords(i, currentCell.Y) :
new Coords(currentCell.X, i);
SetHoveredCell();
InvalidateVisual();
return;
}
}
}
protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e)
{
base.OnMouseMove(e);
@ -137,6 +144,14 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls @@ -137,6 +144,14 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls
}
}
protected override void OnMouseDown(System.Windows.Input.MouseButtonEventArgs e)
{
base.OnMouseDown(e);
Relationship relationship = HoveredCell.Value as Relationship;
Console.WriteLine("To: " + relationship.To.Name);
Console.WriteLine("From:" + relationship.From.Name);
}
protected void SetHoveredCell()
{
HoveredCell.RowIndex = currentCell.Y;
@ -157,8 +172,8 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls @@ -157,8 +172,8 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls
// how many cells we will draw
// sometimes happens when half of cell is hidden in scroll so text isnt drawn
// so lets drawn one more cell
var cellsHorizontally = maxWidth > matrixWidth ? matrixWidth : maxWidth + 1;
var cellsVertically = maxHeight > matrixHeight ? matrixHeight : maxHeight + 1;
var cellsHorizontally = maxWidth >= matrixWidth ? matrixWidth : maxWidth + 1;
var cellsVertically = maxHeight >= matrixHeight ? matrixHeight : maxHeight + 1;
// number of cell which will be drawn
var scaledOffsetX = (int)offset.X / CellWidth;

8
src/AddIns/Analysis/CodeQuality/Src/Controls/TreeMatrixControl.xaml.cs

@ -125,9 +125,7 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls @@ -125,9 +125,7 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls
if (rebuildLeftNodeListRequested)
return;
rebuildLeftNodeListRequested = true;
Dispatcher.BeginInvoke(
DispatcherPriority.DataBind,
new Action(SetVisibleItemsForRows));
Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(SetVisibleItemsForRows));
}
void SetVisibleItemsForRows()
@ -149,9 +147,7 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls @@ -149,9 +147,7 @@ namespace ICSharpCode.CodeQualityAnalysis.Controls
if (rebuildTopNodeListRequested)
return;
rebuildTopNodeListRequested = true;
Dispatcher.BeginInvoke(
DispatcherPriority.DataBind,
new Action(SetVisibleItemsForColumns));
Dispatcher.BeginInvoke(DispatcherPriority.DataBind, new Action(SetVisibleItemsForColumns));
}
void SetVisibleItemsForColumns()

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

@ -86,6 +86,12 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -86,6 +86,12 @@ namespace ICSharpCode.CodeQualityAnalysis
public Relationship GetRelationship(INode node)
{
Relationship relationship = new Relationship();
if (node == this) {
relationship.Relationships.Add(RelationshipType.Same);
return relationship;
}
return relationship;
}

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

@ -148,6 +148,12 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -148,6 +148,12 @@ namespace ICSharpCode.CodeQualityAnalysis
public Relationship GetRelationship(INode node)
{
Relationship relationship = new Relationship();
if (node == this) {
relationship.Relationships.Add(RelationshipType.Same);
return relationship;
}
return relationship;
}

3
src/AddIns/Analysis/CodeQuality/Src/Relationship.cs

@ -18,6 +18,9 @@ namespace ICSharpCode.CodeQualityAnalysis @@ -18,6 +18,9 @@ namespace ICSharpCode.CodeQualityAnalysis
public string Text { get { return OccurrenceCount.ToString(); } }
public INode To { get; set; }
public INode From { get; set; }
public Relationship()
{
Relationships = new HashSet<RelationshipType>();

Loading…
Cancel
Save