Browse Source

A few FxCop fixes and missing documentation.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4779 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 16 years ago
parent
commit
46caf75b22
  1. 3
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs
  2. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/PropertyGridView.xaml
  3. 13
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Adorners/AdornerPanel.cs
  4. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementBehavior.cs
  5. 3
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs
  6. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementOperation.cs
  7. 28
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/PropertyNode.cs
  8. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceRequiredException.cs

3
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/DesignPanel.cs

@ -141,7 +141,8 @@ namespace ICSharpCode.WpfDesign.Designer @@ -141,7 +141,8 @@ namespace ICSharpCode.WpfDesign.Designer
public DesignPanel()
{
this.Focusable = true;
this.AllowDrop = true;
this.AllowDrop = false;
this.ClipToBounds = true;
DesignerProperties.SetIsInDesignMode(this, true);
_eatAllHitTestRequests = new EatAllHitTestRequests();

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/PropertyGrid/PropertyGridView.xaml

@ -204,7 +204,7 @@ @@ -204,7 +204,7 @@
VerticalAlignment="Center"
Margin="7 0 0 0"
ToolTip="{Binding Description}"
FontWeight="{Binding FontWeight}"
FontWeight="{Binding IsSet, Converter={x:Static Converters:BoldWhenTrue.Instance}}"
Foreground="{Binding NameForeground}" />
</DockPanel>
<Border BorderThickness="1 0 0 0"

13
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Adorners/AdornerPanel.cs

@ -104,7 +104,7 @@ namespace ICSharpCode.WpfDesign.Adorners @@ -104,7 +104,7 @@ namespace ICSharpCode.WpfDesign.Adorners
protected override Size MeasureOverride(Size availableSize)
{
if (this.AdornedElement != null) {
foreach (DependencyObject v in this.VisualChildren) {
foreach (DependencyObject v in base.InternalChildren) {
UIElement e = v as UIElement;
if (e != null) {
e.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
@ -124,17 +124,6 @@ namespace ICSharpCode.WpfDesign.Adorners @@ -124,17 +124,6 @@ namespace ICSharpCode.WpfDesign.Adorners
}
return finalSize;
}
private DependencyObject[] VisualChildren {
get {
int count = VisualTreeHelper.GetChildrenCount(this);
DependencyObject[] children = new DependencyObject[count];
for (int i = 0; i < children.Length; i++) {
children[i] = VisualTreeHelper.GetChild(this, i);
}
return children;
}
}
}
/// <summary>

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementBehavior.cs

@ -73,6 +73,8 @@ namespace ICSharpCode.WpfDesign @@ -73,6 +73,8 @@ namespace ICSharpCode.WpfDesign
/// Behavior interface for root elements (elements where item.Parent is null).
/// Is used instead of <see cref="IPlacementBehavior"/> to support resizing the root element.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces",
Justification = "The root component might have both a PlacementBehavior and a RootPlacementBehavior, which must be distinguished by DesignItem.GetBehavior")]
public interface IRootPlacementBehavior : IPlacementBehavior
{
}

3
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs

@ -55,6 +55,9 @@ namespace ICSharpCode.WpfDesign @@ -55,6 +55,9 @@ namespace ICSharpCode.WpfDesign
set { bounds = value; }
}
/// <summary>
/// Gets/sets the alignment of the resize thumb used to start the operation.
/// </summary>
public PlacementAlignment ResizeThumbAlignment { get; set; }
/// <inheritdoc/>

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementOperation.cs

@ -114,7 +114,7 @@ namespace ICSharpCode.WpfDesign @@ -114,7 +114,7 @@ namespace ICSharpCode.WpfDesign
}
}
Rect TransformRectByMiddlePoint(GeneralTransform transform, Rect r)
static Rect TransformRectByMiddlePoint(GeneralTransform transform, Rect r)
{
// we don't want to adjust the size of the control when moving it out of a scaled
// container, we just want to move it correcly

28
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PropertyGrid/PropertyNode.cs

@ -158,6 +158,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid @@ -158,6 +158,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
}
}
/// <summary>
/// Gets whether the property node is enabled for editing.
/// </summary>
public bool IsEnabled {
get {
return ValueItem == null && hasStringConverter;
@ -176,19 +179,17 @@ namespace ICSharpCode.WpfDesign.PropertyGrid @@ -176,19 +179,17 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
}
}
public FontWeight FontWeight {
get {
return IsSet ? FontWeights.Bold : FontWeights.Normal;
}
}
/// <summary>
/// Gets the color of the name.
/// Depends on the type of the value (binding/resource/etc.)
/// </summary>
public Brush NameForeground {
get {
if (ValueItem != null) {
if (ValueItem.Component is BindingBase)
object component = ValueItem.Component;
if (component is BindingBase)
return Brushes.DarkGoldenrod;
if (ValueItem.Component is StaticResourceExtension ||
ValueItem.Component is DynamicResourceExtension)
if (component is StaticResourceExtension || component is DynamicResourceExtension)
return Brushes.DarkGreen;
}
return SystemColors.WindowTextBrush;
@ -252,6 +253,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid @@ -252,6 +253,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
SetValueCore(Unset);
}
/// <summary>
/// Replaces the value of this node with a new binding.
/// </summary>
public void CreateBinding()
{
Value = new Binding();
@ -309,6 +313,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid @@ -309,6 +313,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
Load(properties);
}
/// <summary>
/// Initializes this property node with the specified properties.
/// </summary>
public void Load(DesignItemProperty[] properties)
{
if (this.Properties != null) {
@ -375,6 +382,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid @@ -375,6 +382,9 @@ namespace ICSharpCode.WpfDesign.PropertyGrid
#region INotifyPropertyChanged Members
/// <summary>
/// Occurs when a property has changed. Used to support WPF data binding.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
void RaisePropertyChanged(string name)

16
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/ServiceRequiredException.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace ICSharpCode.WpfDesign
{
@ -25,7 +26,7 @@ namespace ICSharpCode.WpfDesign @@ -25,7 +26,7 @@ namespace ICSharpCode.WpfDesign
/// Create a new ServiceRequiredException instance.
/// </summary>
public ServiceRequiredException(Type serviceType)
: this("Service " + serviceType.FullName + " is required.")
: base("Service " + serviceType.FullName + " is required.")
{
this.ServiceType = serviceType;
}
@ -57,6 +58,19 @@ namespace ICSharpCode.WpfDesign @@ -57,6 +58,19 @@ namespace ICSharpCode.WpfDesign
protected ServiceRequiredException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
if (info == null)
throw new ArgumentNullException("info");
this.ServiceType = (Type)info.GetValue("ServiceType", typeof(Type));
}
/// <inheritdoc/>
[SecurityPermission(SecurityAction.Demand, SerializationFormatter=true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException("info");
base.GetObjectData(info, context);
info.AddValue("ServiceType", this.ServiceType);
}
}
}

Loading…
Cancel
Save