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 GetAllAmbientValues(params XamlType[] types) { return new List(); } + /// public IEnumerable GetAllAmbientValues(IEnumerable ceilingTypes, bool searchLiveStackOnly, IEnumerable types, params XamlMember[] properties) { return new List(); @@ -208,6 +215,7 @@ namespace ICSharpCode.WpfDesign.XamlDom #region IXamlNameResolver + /// public object Resolve(string name) { INameScope ns = null; @@ -228,6 +236,7 @@ namespace ICSharpCode.WpfDesign.XamlDom return null; } + /// public object Resolve(string name, out bool isFullyInitialized) { var ret = Resolve(name); @@ -235,27 +244,34 @@ namespace ICSharpCode.WpfDesign.XamlDom return ret; } + /// public object GetFixupToken(IEnumerable names) { return null; } + /// public object GetFixupToken(IEnumerable names, bool canAssignDirectly) { return null; } + /// public IEnumerable> GetAllNamesAndValuesInScope() { return null; } + /// public bool IsFixupTokenAvailable { get { return false; } } +#pragma warning disable 0067 // Required by interface implementation, disable Warning CS0067: The event is never used + /// public event EventHandler OnNameScopeInitializationComplete; +#pragma warning restore 0067 #endregion } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs index ab190e58ba..26af1771dc 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlParser.cs @@ -607,7 +607,7 @@ namespace ICSharpCode.WpfDesign.XamlDom { propertyInfo = FindProperty(elementInstance, propertyType, propertyName); } - catch (Exception ex) + catch (Exception) { } if (propertyInfo != null) return propertyInfo; diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs index c89d8065e6..093c418abb 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlProperty.cs @@ -270,6 +270,10 @@ namespace ICSharpCode.WpfDesign.XamlDom } private XamlMember _systemXamlMemberForProperty = null; + + /// + /// Gets a representing the property. + /// public XamlMember SystemXamlMemberForProperty { get @@ -281,6 +285,10 @@ namespace ICSharpCode.WpfDesign.XamlDom } private XamlType _systemXamlTypeForProperty = null; + + /// + /// Gets a representing the type the property is declared on. + /// public XamlType SystemXamlTypeForProperty { get diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs index 3373b4772d..bb28216335 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/XamlTypeFinder.cs @@ -304,6 +304,9 @@ namespace ICSharpCode.WpfDesign.XamlDom return WpfTypeFinder.Instance.Clone(); } + /// + /// Converts the specified to local. + /// public virtual Uri ConvertUriToLocalUri(Uri uri) { return uri; diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs index b47a73daf6..19b0426528 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DesignItem.cs @@ -199,6 +199,9 @@ namespace ICSharpCode.WpfDesign } } + /// + /// Reapplies all extensions. + /// public void ReapplyAllExtensions() { var manager = this.Services.GetService(); @@ -293,6 +296,9 @@ namespace ICSharpCode.WpfDesign /// public abstract DesignItem Clone(); + /// + /// Gets a that represents all transforms applied to the item's view. + /// public Transform GetCompleteAppliedTransformationToView() { var retVal = new TransformGroup(); diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DrawItemExtension.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DrawItemExtension.cs index a97dffafaa..5663904e1c 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DrawItemExtension.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DrawItemExtension.cs @@ -29,7 +29,20 @@ namespace ICSharpCode.WpfDesign /// public interface IDrawItemExtension { + /// + /// Returns if the specified type can be drawn. + /// + /// The type to check. + /// True if the specified type can be drawn, otherwise false. bool CanItemBeDrawn(Type createItemType); + + /// + /// Starts to draw. + /// + /// The item. + /// The item type. + /// The design panel to draw on. + /// The argument that initiated the draw operation. void StartDrawItem(DesignItem clickedOn, Type createItemType, IDesignPanel panel, MouseEventArgs e); } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DummyValueInsteadOfNullTypeDescriptionProvider.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DummyValueInsteadOfNullTypeDescriptionProvider.cs index 2834cabe6b..f921053b22 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DummyValueInsteadOfNullTypeDescriptionProvider.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DummyValueInsteadOfNullTypeDescriptionProvider.cs @@ -35,6 +35,9 @@ namespace ICSharpCode.WpfDesign readonly string _propertyName; readonly object _dummyValue; + /// + /// Initializes a new instance of . + /// public DummyValueInsteadOfNullTypeDescriptionProvider(TypeDescriptionProvider existingProvider, string propertyName, object dummyValue) : base(existingProvider) @@ -43,6 +46,7 @@ namespace ICSharpCode.WpfDesign this._dummyValue = dummyValue; } + /// public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance) { return new ShadowTypeDescriptor(this, base.GetTypeDescriptor(objectType, instance)); diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/Extension.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/Extension.cs index 6c0dafc0d5..caf4670a82 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/Extension.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/Extension.cs @@ -33,16 +33,29 @@ namespace ICSharpCode.WpfDesign.Extensions /// public abstract class Extension { + /// + /// Gets the value of the attached property for an object. + /// + /// The object from which the property value is read. + /// The object's property value. public static string GetDisabledExtensions(DependencyObject obj) { return (string)obj.GetValue(DisabledExtensionsProperty); } + /// + /// Sets the value of the attached property for an object. + /// + /// The object to which the attached property is written. + /// The value to set. public static void SetDisabledExtensions(DependencyObject obj, string value) { obj.SetValue(DisabledExtensionsProperty, value); } + /// + /// Gets or sets a semicolon-separated list with extension names that is disabled for a component's view. + /// public static readonly DependencyProperty DisabledExtensionsProperty = DependencyProperty.RegisterAttached("DisabledExtensions", typeof(string), typeof(Extension), new PropertyMetadata(null)); diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs index 2f321ae680..72768e7385 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionAttribute.cs @@ -26,7 +26,9 @@ namespace ICSharpCode.WpfDesign.Extensions [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=false)] public sealed class ExtensionAttribute : Attribute { - //The Order in wich the Extensions are used - public int Order { get; set; } + /// + /// Gets or sets the Order in wich the extensions are used. + /// + public int Order { get; set; } } } diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs index 6628bb1607..8169ea3247 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/ExtensionServer.cs @@ -74,8 +74,8 @@ namespace ICSharpCode.WpfDesign.Extensions /// public abstract bool ShouldApplyExtensions(DesignItem extendedItem); - // - /// Set if the Extension Server should be reaplied (For multiple Selection extension Server for Example!) + /// + /// Returns if the Extension Server should be reapplied (for multiple selection extension server for example). /// public virtual bool ShouldBeReApplied() { diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs index 3a9011716d..602a107c82 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs @@ -121,6 +121,7 @@ namespace ICSharpCode.WpfDesign.Extensions ReapplyExtensions(this.Services.Selection.SelectedItems); } + /// public override bool ShouldBeReApplied() { return true; diff --git a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/UIExtensions/UIHelpers.cs b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/UIExtensions/UIHelpers.cs index eaffed93ae..fe11952222 100644 --- a/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/UIExtensions/UIHelpers.cs +++ b/src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/UIExtensions/UIHelpers.cs @@ -25,8 +25,17 @@ using System.Windows.Media; namespace ICSharpCode.WpfDesign.UIExtensions { + /// + /// Contains helper methods for UI. + /// public static class UIHelpers { + /// + /// Gets the parent. Which tree the parent is retrieved from depends on the parameters. + /// + /// The child to get parent for. + /// If true the parent in the visual tree is returned, if false the parent may be retrieved from another tree depending on the child type. + /// The parent element, and depending on the parameters its retrieved from either visual tree, logical tree or a tree not strictly speaking either the logical tree or the visual tree. public static DependencyObject GetParentObject(this DependencyObject child, bool searchCompleteVisualTree) { if (child == null) return null; @@ -53,6 +62,15 @@ namespace ICSharpCode.WpfDesign.UIExtensions return VisualTreeHelper.GetParent(child); } + /// + /// Gets first parent element of the specified type. Which tree the parent is retrieved from depends on the parameters. + /// + /// The child to get parent for. + /// If true the parent in the visual tree is returned, if false the parent may be retrieved from another tree depending on the child type. + /// + /// The first parent element of the specified type, and depending on the parameters its retrieved from either visual tree, logical tree or a tree not strictly speaking either the logical tree or the visual tree. + /// null is returned if no parent of the specified type is found. + /// public static T TryFindParent(this DependencyObject child, bool searchCompleteVisualTree = false) where T : DependencyObject { DependencyObject parentObject = GetParentObject(child, searchCompleteVisualTree); @@ -68,6 +86,11 @@ namespace ICSharpCode.WpfDesign.UIExtensions return TryFindParent(parentObject); } + /// + /// Returns the first child of the specified type found in the visual tree. + /// + /// The parent element where the search is started. + /// The first child of the specified type found in the visual tree, or null if no parent of the specified type is found. public static T TryFindChild(this DependencyObject parent) where T : DependencyObject { for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++) @@ -87,6 +110,12 @@ namespace ICSharpCode.WpfDesign.UIExtensions return null; } + /// + /// Returns the first child of the specified type and with the specified name found in the visual tree. + /// + /// The parent element where the search is started. + /// The name of the child element to find, or an empty string or null to only look at the type. + /// The first child that matches the specified type and child name, or null if no match is found. public static T TryFindChild(this DependencyObject parent, string childName) where T : DependencyObject { if (parent == null) return null;