diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
index 907287e1be..d038b14dfb 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
@@ -35,7 +35,6 @@ using ICSharpCode.WpfDesign.Designer.Controls;
using ICSharpCode.WpfDesign.UIExtensions;
using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.Extensions;
-using System.Linq;
namespace ICSharpCode.WpfDesign.Designer
{
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPolyLineExtension.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPolyLineExtension.cs
index 7569ece5a4..d43e250c62 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPolyLineExtension.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/DrawPolyLineExtension.cs
@@ -82,7 +82,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
{
private ChangeGroup changeGroup;
private DesignItem newLine;
- private Point startPoint;
+ private new Point startPoint;
public DrawPolylineMouseGesture(DesignItem newLine, IInputElement relativeTo, ChangeGroup changeGroup)
{
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs
index 5c03df06a3..c108e6f760 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PartialPanelSelectionHandler.cs
@@ -32,87 +32,91 @@ using ICSharpCode.WpfDesign.Extensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
public class PartialPanelSelectionHandler : BehaviorExtension, IHandlePointerToolMouseDown
- {
- protected override void OnInitialized()
- {
- base.OnInitialized();
- this.ExtendedItem.AddBehavior(typeof(IHandlePointerToolMouseDown), this);
- }
+ {
+ protected override void OnInitialized()
+ {
+ base.OnInitialized();
+ this.ExtendedItem.AddBehavior(typeof(IHandlePointerToolMouseDown), this);
+ }
+
+ #region IHandlePointerToolMouseDown
- public new void HandleSelectionMouseDown(IDesignPanel designPanel, MouseButtonEventArgs e, DesignPanelHitTestResult result)
- {
- if (e.ChangedButton == MouseButton.Left && MouseGestureBase.IsOnlyButtonPressed(e, MouseButton.Left))
- {
- e.Handled = true;
- new PartialRangeSelectionGesture(result.ModelHit).Start(designPanel, e);
- }
- }
- }
+ public void HandleSelectionMouseDown(IDesignPanel designPanel, MouseButtonEventArgs e, DesignPanelHitTestResult result)
+ {
+ if (e.ChangedButton == MouseButton.Left && MouseGestureBase.IsOnlyButtonPressed(e, MouseButton.Left))
+ {
+ e.Handled = true;
+ new PartialRangeSelectionGesture(result.ModelHit).Start(designPanel, e);
+ }
+ }
+
+ #endregion
+ }
- ///
- ///
- ///
- internal class PartialRangeSelectionGesture : RangeSelectionGesture
- {
- public PartialRangeSelectionGesture(DesignItem container)
- : base(container)
- {
- }
+ ///
+ ///
+ ///
+ internal class PartialRangeSelectionGesture : RangeSelectionGesture
+ {
+ public PartialRangeSelectionGesture(DesignItem container)
+ : base(container)
+ {
+ }
- protected override ICollection GetChildDesignItemsInContainer(Geometry geometry)
- {
- HashSet resultItems = new HashSet();
- ViewService viewService = container.Services.View;
+ protected override ICollection GetChildDesignItemsInContainer(Geometry geometry)
+ {
+ HashSet resultItems = new HashSet();
+ ViewService viewService = container.Services.View;
- HitTestFilterCallback filterCallback = delegate(DependencyObject potentialHitTestTarget)
- {
- FrameworkElement element = potentialHitTestTarget as FrameworkElement;
- if (element != null)
- {
- // ensure we are able to select elements with width/height=0
- if (element.ActualWidth == 0 || element.ActualHeight == 0)
- {
- DependencyObject tmp = element;
- DesignItem model = null;
- while (tmp != null)
- {
- model = viewService.GetModel(tmp);
- if (model != null) break;
- tmp = VisualTreeHelper.GetParent(tmp);
- }
- if (model != container)
- {
- resultItems.Add(model);
- return HitTestFilterBehavior.ContinueSkipChildren;
- }
- }
- }
- return HitTestFilterBehavior.Continue;
- };
+ HitTestFilterCallback filterCallback = delegate(DependencyObject potentialHitTestTarget)
+ {
+ FrameworkElement element = potentialHitTestTarget as FrameworkElement;
+ if (element != null)
+ {
+ // ensure we are able to select elements with width/height=0
+ if (element.ActualWidth == 0 || element.ActualHeight == 0)
+ {
+ DependencyObject tmp = element;
+ DesignItem model = null;
+ while (tmp != null)
+ {
+ model = viewService.GetModel(tmp);
+ if (model != null) break;
+ tmp = VisualTreeHelper.GetParent(tmp);
+ }
+ if (model != container)
+ {
+ resultItems.Add(model);
+ return HitTestFilterBehavior.ContinueSkipChildren;
+ }
+ }
+ }
+ return HitTestFilterBehavior.Continue;
+ };
- HitTestResultCallback resultCallback = delegate(HitTestResult result)
- {
- if (((GeometryHitTestResult)result).IntersectionDetail == IntersectionDetail.FullyInside || (Mouse.RightButton== MouseButtonState.Pressed && ((GeometryHitTestResult)result).IntersectionDetail == IntersectionDetail.Intersects))
- {
- // find the model for the visual contained in the selection area
- DependencyObject tmp = result.VisualHit;
- DesignItem model = null;
- while (tmp != null)
- {
- model = viewService.GetModel(tmp);
- if (model != null) break;
- tmp = VisualTreeHelper.GetParent(tmp);
- }
- if (model != container)
- {
- resultItems.Add(model);
- }
- }
- return HitTestResultBehavior.Continue;
- };
+ HitTestResultCallback resultCallback = delegate(HitTestResult result)
+ {
+ if (((GeometryHitTestResult)result).IntersectionDetail == IntersectionDetail.FullyInside || (Mouse.RightButton== MouseButtonState.Pressed && ((GeometryHitTestResult)result).IntersectionDetail == IntersectionDetail.Intersects))
+ {
+ // find the model for the visual contained in the selection area
+ DependencyObject tmp = result.VisualHit;
+ DesignItem model = null;
+ while (tmp != null)
+ {
+ model = viewService.GetModel(tmp);
+ if (model != null) break;
+ tmp = VisualTreeHelper.GetParent(tmp);
+ }
+ if (model != container)
+ {
+ resultItems.Add(model);
+ }
+ }
+ return HitTestResultBehavior.Continue;
+ };
- VisualTreeHelper.HitTest(container.View, filterCallback, resultCallback, new GeometryHitTestParameters(geometry));
- return resultItems;
- }
- }
+ VisualTreeHelper.HitTest(container.View, filterCallback, resultCallback, new GeometryHitTestParameters(geometry));
+ return resultItems;
+ }
+ }
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PathHandlerExtension.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PathHandlerExtension.cs
index 7cdabd4f73..5a24f6fb0f 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PathHandlerExtension.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PathHandlerExtension.cs
@@ -160,7 +160,9 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
private readonly Dictionary _selectedThumbs = new Dictionary();
+#pragma warning disable 0414 // For future use, disable Warning CS0414: The field is assigned but its value is never used
private bool _isDragging;
+#pragma warning restore 0414
ZoomControl _zoom;
private List pathPoints = null;
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PointTrackerPlacementSupport.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PointTrackerPlacementSupport.cs
index 6065dc2479..7df22d791d 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PointTrackerPlacementSupport.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PointTrackerPlacementSupport.cs
@@ -47,7 +47,6 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
public override void Arrange(AdornerPanel panel, UIElement adorner, Size adornedElementSize)
{
Point p = new Point(0, 0);
- double distance = 0;
if (shape is Line)
{
var s = shape as Line;
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNodeBase.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNodeBase.cs
index bd0df157fa..a2eaf764ed 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNodeBase.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNodeBase.cs
@@ -38,7 +38,7 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView
}
catch (Exception)
{ }
- if (hidden != null && (bool)hidden) {
+ if (hidden) {
_isDesignTimeVisible = false;
((FrameworkElement)DesignItem.Component).Visibility = Visibility.Hidden;
}
@@ -50,7 +50,7 @@ namespace ICSharpCode.WpfDesign.Designer.OutlineView
}
catch (Exception)
{ }
- if (locked != null && (bool)locked) {
+ if (locked) {
_isDesignTimeLocked = true;
}
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/CollectionSupport.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/CollectionSupport.cs
index 391004d333..2d98e2e6e0 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/CollectionSupport.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/CollectionSupport.cs
@@ -86,7 +86,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
} else if (collectionInstance is IDictionary) {
object val = newElement.GetValueFor(null);
object key = newElement is XamlObject ? ((XamlObject)newElement).GetXamlAttribute("Key") : null;
- if (key == null || key == "")
+ if (key == null || (key as string) == "")
{
if (val is Style)
key = ((Style)val).TargetType;
@@ -150,8 +150,6 @@ namespace ICSharpCode.WpfDesign.XamlDom
} catch (MissingMethodException) {
return false;
}
-
- return true;
}
static readonly Type[] RemoveAtParameters = { typeof(int) };
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/TemplateHelper.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/TemplateHelper.cs
index 6624bb4ec1..6c6f2a6537 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/TemplateHelper.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/TemplateHelper.cs
@@ -31,8 +31,17 @@ using System.Xml.XPath;
namespace ICSharpCode.WpfDesign.XamlDom
{
+ ///
+ /// Contains template related helper methods.
+ ///
public static class TemplateHelper
{
+ ///
+ /// Gets a based on the specified parameters.
+ ///
+ /// The xml element to get template xaml from.
+ /// The to use as source for resources and contextual information.
+ /// A based on the specified parameters.
public static FrameworkTemplate GetFrameworkTemplate(XmlElement xmlElement, XamlObject parentObject)
{
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs
index 79fe967879..72e8f8b7be 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObject.cs
@@ -206,6 +206,10 @@ namespace ICSharpCode.WpfDesign.XamlDom
}
private XamlType _systemXamlTypeForProperty = null;
+
+ ///
+ /// Gets a representing the .
+ ///
public XamlType SystemXamlTypeForProperty
{
get
diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObjectServiceProvider.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObjectServiceProvider.cs
index e262624152..c66bdc25fa 100644
--- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObjectServiceProvider.cs
+++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlObjectServiceProvider.cs
@@ -124,9 +124,10 @@ namespace ICSharpCode.WpfDesign.XamlDom
}
#endregion
-
- #region IUriContext implementation
+ #region IUriContext implementation
+
+ ///
public virtual Uri BaseUri {
get {
return new Uri("pack://application:,,,/");
@@ -151,6 +152,7 @@ namespace ICSharpCode.WpfDesign.XamlDom
// }
//}
+ ///
public XamlSchemaContext SchemaContext
{
get
@@ -163,16 +165,19 @@ namespace ICSharpCode.WpfDesign.XamlDom
#region IAmbientProvider Members
+ ///
public AmbientPropertyValue GetFirstAmbientValue(IEnumerable ceilingTypes, params XamlMember[] properties)
{
return GetAllAmbientValues(ceilingTypes, properties).FirstOrDefault();
}
+ ///
public object GetFirstAmbientValue(params XamlType[] types)
{
return null;
}
+ ///
public IEnumerable GetAllAmbientValues(IEnumerable ceilingTypes, params XamlMember[] properties)
{
var obj = this.XamlObject.ParentObject;
@@ -194,11 +199,13 @@ namespace ICSharpCode.WpfDesign.XamlDom
}
}
+ ///
public IEnumerable