Browse Source

Merge pull request #3 from icsharpcode/master

Trying to update my fork ...
pull/693/head
Oleg Bevz 11 years ago
parent
commit
0cd045d9e8
  1. 2
      src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverApplication.cs
  2. 4
      src/AddIns/Analysis/CodeCoverage/Test/Testing/OpenCoverApplicationTests.cs
  3. 2
      src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml
  4. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/Options/WpfEditorOptions.cs
  5. 6
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs
  6. 26
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineExtensionBase.cs
  7. 39
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineHandlerExtension.cs
  8. 141
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PanelInstanceFactory.cs
  9. 39
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PolyLineHandlerExtension.cs
  10. 11
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ResizeThumbExtension.cs
  11. 11
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs
  12. 142
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DummyValueInsteadOfNullTypeDescriptionProvider.cs
  13. 1
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj
  14. 12
      src/Libraries/AvalonDock/AvalonDock/Resources/NavigatorWindowStyle.xaml
  15. 2
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs
  16. 12
      src/Main/Base/Test/ProjectOptions/AssemblyInfoProviderTests.cs

2
src/AddIns/Analysis/CodeCoverage/Project/Src/OpenCoverApplication.cs

@ -104,7 +104,7 @@ namespace ICSharpCode.CodeCoverage
string GetArguments() string GetArguments()
{ {
// IMPORTANT: https://github.com/sawilde/opencover/wiki/Usage // IMPORTANT: https://github.com/sawilde/opencover/wiki/Usage
arguments = new StringBuilder("-register:user "); arguments = new StringBuilder("-register:user -mergebyhash ");
AppendTarget(); AppendTarget();
AppendTargetWorkingDirectory(); AppendTargetWorkingDirectory();

4
src/AddIns/Analysis/CodeCoverage/Test/Testing/OpenCoverApplicationTests.cs

@ -163,7 +163,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
ProcessStartInfo processStartInfo = openCoverApp.GetProcessStartInfo(); ProcessStartInfo processStartInfo = openCoverApp.GetProcessStartInfo();
string expectedCommandLine = string expectedCommandLine =
"-register:user -target:\"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " + "-register:user -mergebyhash -target:\"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"-targetdir:\"c:\\projects\\MyTests\\bin\\Debug\" " + "-targetdir:\"c:\\projects\\MyTests\\bin\\Debug\" " +
"-targetargs:\"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " + "-targetargs:\"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"-output:\"c:\\projects\\MyTests\\OpenCover\\coverage.xml\" " + "-output:\"c:\\projects\\MyTests\\OpenCover\\coverage.xml\" " +
@ -187,7 +187,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
ProcessStartInfo processStartInfo = openCoverApp.GetProcessStartInfo(); ProcessStartInfo processStartInfo = openCoverApp.GetProcessStartInfo();
string expectedCommandLine = string expectedCommandLine =
"-register:user -target:\"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " + "-register:user -mergebyhash -target:\"d:\\sharpdevelop\\bin\\Tools\\NUnit\\nunit-console-x86.exe\" " +
"-targetdir:\"c:\\projects\\MyTests\\bin\\Debug\" " + "-targetdir:\"c:\\projects\\MyTests\\bin\\Debug\" " +
"-targetargs:\"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " + "-targetargs:\"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"-output:\"c:\\projects\\MyTests\\OpenCover\\coverage.xml\" " + "-output:\"c:\\projects\\MyTests\\OpenCover\\coverage.xml\" " +

2
src/AddIns/DisplayBindings/AvalonEdit.AddIn/Src/QuickClassBrowser.xaml

@ -31,7 +31,7 @@
DropDownClosed="ComboBox_DropDownClosed"/> DropDownClosed="ComboBox_DropDownClosed"/>
<ComboBox Name="membersComboBox" <ComboBox Name="membersComboBox"
Grid.Column="1" Grid.Column="1"
Margin="0,0,4,1" Margin="0,0,0,1"
ItemTemplate="{StaticResource comboBoxItemTemplate}" ItemTemplate="{StaticResource comboBoxItemTemplate}"
SelectionChanged="membersComboBoxSelectionChanged" SelectionChanged="membersComboBoxSelectionChanged"
DropDownClosed="ComboBox_DropDownClosed"/> DropDownClosed="ComboBox_DropDownClosed"/>

2
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/Options/WpfEditorOptions.cs

@ -30,7 +30,7 @@ namespace ICSharpCode.WpfDesign.AddIn.Options
public static bool EnableAppXamlParsing { public static bool EnableAppXamlParsing {
get { get {
return SD.PropertyService.Get(EnableAppXamlParsingOptionName, false); return SD.PropertyService.Get(EnableAppXamlParsingOptionName, true);
} }
set { set {
SD.PropertyService.Set(EnableAppXamlParsingOptionName, value); SD.PropertyService.Set(EnableAppXamlParsingOptionName, value);

6
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.AddIn/Src/WpfViewContent.cs

@ -49,6 +49,7 @@ using ICSharpCode.WpfDesign.Designer.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;
using ICSharpCode.WpfDesign.Designer.Xaml; using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.XamlDom; using ICSharpCode.WpfDesign.XamlDom;
using ICSharpCode.WpfDesign.AddIn.Options;
namespace ICSharpCode.WpfDesign.AddIn namespace ICSharpCode.WpfDesign.AddIn
{ {
@ -155,6 +156,7 @@ namespace ICSharpCode.WpfDesign.AddIn
} }
try{ try{
if (WpfEditorOptions.EnableAppXamlParsing) {
var appXaml = SD.ProjectService.CurrentProject.Items.FirstOrDefault(x=>x.FileName.GetFileName().ToLower() == ("app.xaml")); var appXaml = SD.ProjectService.CurrentProject.Items.FirstOrDefault(x=>x.FileName.GetFileName().ToLower() == ("app.xaml"));
if (appXaml!=null){ if (appXaml!=null){
var f=appXaml as FileProjectItem; var f=appXaml as FileProjectItem;
@ -165,8 +167,7 @@ namespace ICSharpCode.WpfDesign.AddIn
doc.Load(xml); doc.Load(xml);
var node = doc.FirstChild.ChildNodes.Cast<XmlNode>().FirstOrDefault(x=>x.Name=="Application.Resources"); var node = doc.FirstChild.ChildNodes.Cast<XmlNode>().FirstOrDefault(x=>x.Name=="Application.Resources");
foreach (XmlAttribute att in doc.FirstChild.Attributes.Cast<XmlAttribute>().ToList()) foreach (XmlAttribute att in doc.FirstChild.Attributes.Cast<XmlAttribute>().ToList()) {
{
if (att.Name.StartsWith("xmlns")) if (att.Name.StartsWith("xmlns"))
node.Attributes.Append(att); node.Attributes.Append(att);
} }
@ -176,6 +177,7 @@ namespace ICSharpCode.WpfDesign.AddIn
var dict = (ResourceDictionary)parsed.RootInstance; var dict = (ResourceDictionary)parsed.RootInstance;
designer.DesignPanel.Resources.MergedDictionaries.Add(dict); designer.DesignPanel.Resources.MergedDictionaries.Add(dict);
} }
}
} catch (Exception ex) { } catch (Exception ex) {
LoggingService.Error("Error in loading app.xaml", ex); LoggingService.Error("Error in loading app.xaml", ex);
} }

26
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineExtensionBase.cs

@ -1,11 +1,21 @@
/* // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
* Created by SharpDevelop. //
* User: trubra // Permission is hereby granted, free of charge, to any person obtaining a copy of this
* Date: 2014-12-22 // software and associated documentation files (the "Software"), to deal in the Software
* Time: 11:00 // without restriction, including without limitation the rights to use, copy, modify, merge,
* // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
* To change this template use Tools | Options | Coding | Edit Standard Headers. // to whom the Software is furnished to do so, subject to the following conditions:
*/ //
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System; using System;
using ICSharpCode.WpfDesign.Designer.Controls; using ICSharpCode.WpfDesign.Designer.Controls;
using ICSharpCode.WpfDesign.Designer.Extensions; using ICSharpCode.WpfDesign.Designer.Extensions;

39
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/LineHandlerExtension.cs

@ -1,11 +1,21 @@
/* // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
* Created by SharpDevelop. //
* User: trubra // Permission is hereby granted, free of charge, to any person obtaining a copy of this
* Date: 2014-12-22 // software and associated documentation files (the "Software"), to deal in the Software
* Time: 10:34 // without restriction, including without limitation the rights to use, copy, modify, merge,
* // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
* To change this template use Tools | Options | Coding | Edit Standard Headers. // to whom the Software is furnished to do so, subject to the following conditions:
*/ //
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System; using System;
using ICSharpCode.WpfDesign.Extensions; using ICSharpCode.WpfDesign.Extensions;
using ICSharpCode.WpfDesign; using ICSharpCode.WpfDesign;
@ -21,12 +31,13 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions namespace ICSharpCode.WpfDesign.Designer.Extensions
{ {
/// <summary> /// <summary>
/// Description of LineHandlerExtension. /// Description of LineHandlerExtension.
/// </summary> /// </summary>
[ExtensionFor(typeof(Line), OverrideExtensions = new Type[] { typeof(ResizeThumbExtension), typeof(SelectedElementRectangleExtension), typeof(CanvasPositionExtension), typeof(QuickOperationMenuExtension), typeof(RotateThumbExtension), typeof(RenderTransformOriginExtension), typeof(InPlaceEditorExtension) })] [ExtensionFor(typeof(Line), OverrideExtensions = new Type[] { typeof(ResizeThumbExtension), typeof(SelectedElementRectangleExtension), typeof(CanvasPositionExtension), typeof(QuickOperationMenuExtension), typeof(RotateThumbExtension), typeof(RenderTransformOriginExtension), typeof(InPlaceEditorExtension), typeof(SkewThumbExtension) })]
internal class LineHandlerExtension : LineExtensionBase internal class LineHandlerExtension : LineExtensionBase
{ {
// //
@ -101,15 +112,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
CurrentTop = (double)al.GetValue(Canvas.TopProperty); CurrentTop = (double)al.GetValue(Canvas.TopProperty);
var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel; var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel;
if (designPanel != null) zoom = designPanel.TryFindParent<ZoomControl>();
{
var p = VisualTreeHelper.GetParent(designPanel);
while (p != null && !(p is ZoomControl))
{
p = VisualTreeHelper.GetParent(p);
}
zoom = p as ZoomControl;
}
if (resizeBehavior != null) if (resizeBehavior != null)
operation = PlacementOperation.Start(extendedItemArray, PlacementType.Resize); operation = PlacementOperation.Start(extendedItemArray, PlacementType.Resize);

141
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PanelInstanceFactory.cs

@ -79,8 +79,8 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
} }
} }
[ExtensionFor(typeof(Border))] [ExtensionFor(typeof(ItemsControl))]
public sealed class BorderInstanceFactory : CustomInstanceFactory public sealed class TransparentControlsInstanceFactory : CustomInstanceFactory
{ {
Brush _transparentBrush = new SolidColorBrush(Colors.Transparent); Brush _transparentBrush = new SolidColorBrush(Colors.Transparent);
@ -90,133 +90,44 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
public override object CreateInstance(Type type, params object[] arguments) public override object CreateInstance(Type type, params object[] arguments)
{ {
object instance = base.CreateInstance(type, arguments); object instance = base.CreateInstance(type, arguments);
Border panel = instance as Border; Control control = instance as Control;
if (panel != null) if (control != null && (
{ type == typeof(ItemsControl))) {
if (panel.Background == null) if (control.Background == null) {
{ control.Background = _transparentBrush;
panel.Background = _transparentBrush;
} }
TypeDescriptionProvider provider = new DummyValueInsteadOfNullTypeDescriptionProvider( TypeDescriptionProvider provider = new DummyValueInsteadOfNullTypeDescriptionProvider(
TypeDescriptor.GetProvider(panel), "Background", _transparentBrush); TypeDescriptor.GetProvider(control), "Background", _transparentBrush);
TypeDescriptor.AddProvider(provider, panel); TypeDescriptor.AddProvider(provider, control);
} }
return instance; return instance;
} }
} }
sealed class DummyValueInsteadOfNullTypeDescriptionProvider : TypeDescriptionProvider [ExtensionFor(typeof(Border))]
{ public sealed class BorderInstanceFactory : CustomInstanceFactory
// By using a TypeDescriptionProvider, we can intercept all access to the property that is
// using a PropertyDescriptor. WpfDesign.XamlDom uses a PropertyDescriptor for accessing
// properties (except for attached properties), so even DesignItemProperty/XamlProperty.ValueOnInstance
// will report null when the actual value is the dummy value.
readonly string _propertyName;
readonly object _dummyValue;
public DummyValueInsteadOfNullTypeDescriptionProvider(TypeDescriptionProvider existingProvider,
string propertyName, object dummyValue)
: base(existingProvider)
{
this._propertyName = propertyName;
this._dummyValue = dummyValue;
}
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
{
return new ShadowTypeDescriptor(this, base.GetTypeDescriptor(objectType, instance));
}
sealed class ShadowTypeDescriptor : CustomTypeDescriptor
{
readonly DummyValueInsteadOfNullTypeDescriptionProvider _parent;
public ShadowTypeDescriptor(DummyValueInsteadOfNullTypeDescriptionProvider parent,
ICustomTypeDescriptor existingDescriptor)
: base(existingDescriptor)
{
this._parent = parent;
}
public override PropertyDescriptorCollection GetProperties()
{
return Filter(base.GetProperties());
}
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
return Filter(base.GetProperties(attributes));
}
PropertyDescriptorCollection Filter(PropertyDescriptorCollection properties)
{
PropertyDescriptor property = properties[_parent._propertyName];
if (property != null) {
if ((properties as System.Collections.IDictionary).IsReadOnly) {
properties = new PropertyDescriptorCollection(properties.Cast<PropertyDescriptor>().ToArray());
}
properties.Remove(property);
properties.Add(new ShadowPropertyDescriptor(_parent, property));
}
return properties;
}
}
sealed class ShadowPropertyDescriptor : PropertyDescriptor
{
readonly DummyValueInsteadOfNullTypeDescriptionProvider _parent;
readonly PropertyDescriptor _baseDescriptor;
public ShadowPropertyDescriptor(DummyValueInsteadOfNullTypeDescriptionProvider parent,
PropertyDescriptor existingDescriptor)
: base(existingDescriptor)
{
this._parent = parent;
this._baseDescriptor = existingDescriptor;
}
public override Type ComponentType {
get { return _baseDescriptor.ComponentType; }
}
public override bool IsReadOnly {
get { return _baseDescriptor.IsReadOnly; }
}
public override Type PropertyType {
get { return _baseDescriptor.PropertyType; }
}
public override bool CanResetValue(object component)
{ {
return _baseDescriptor.CanResetValue(component); Brush _transparentBrush = new SolidColorBrush(Colors.Transparent);
}
public override object GetValue(object component) /// <summary>
/// Creates an instance of the specified type, passing the specified arguments to its constructor.
/// </summary>
public override object CreateInstance(Type type, params object[] arguments)
{ {
object value = _baseDescriptor.GetValue(component); object instance = base.CreateInstance(type, arguments);
if (value == _parent._dummyValue) Border panel = instance as Border;
return null; if (panel != null)
else
return value;
}
public override void ResetValue(object component)
{ {
_baseDescriptor.SetValue(component, _parent._dummyValue); if (panel.Background == null)
}
public override void SetValue(object component, object value)
{ {
_baseDescriptor.SetValue(component, value ?? _parent._dummyValue); panel.Background = _transparentBrush;
} }
TypeDescriptionProvider provider = new DummyValueInsteadOfNullTypeDescriptionProvider(
public override bool ShouldSerializeValue(object component) TypeDescriptor.GetProvider(panel), "Background", _transparentBrush);
{ TypeDescriptor.AddProvider(provider, panel);
return _baseDescriptor.ShouldSerializeValue(component)
&& _baseDescriptor.GetValue(component) != _parent._dummyValue;
} }
return instance;
} }
} }
} }

39
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/PolyLineHandlerExtension.cs

@ -1,11 +1,21 @@
/* // Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
* Created by SharpDevelop. //
* User: trubra // Permission is hereby granted, free of charge, to any person obtaining a copy of this
* Date: 2014-12-22 // software and associated documentation files (the "Software"), to deal in the Software
* Time: 10:34 // without restriction, including without limitation the rights to use, copy, modify, merge,
* // publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
* To change this template use Tools | Options | Coding | Edit Standard Headers. // to whom the Software is furnished to do so, subject to the following conditions:
*/ //
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System; using System;
using ICSharpCode.WpfDesign.Extensions; using ICSharpCode.WpfDesign.Extensions;
using ICSharpCode.WpfDesign; using ICSharpCode.WpfDesign;
@ -21,13 +31,14 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions namespace ICSharpCode.WpfDesign.Designer.Extensions
{ {
/// <summary> /// <summary>
/// Description of PolyLineHandlerExtension. /// Description of PolyLineHandlerExtension.
/// </summary> /// </summary>
[ExtensionFor(typeof(Polyline), OverrideExtensions = new Type[] { typeof(ResizeThumbExtension), typeof(SelectedElementRectangleExtension), typeof(CanvasPositionExtension), typeof(QuickOperationMenuExtension), typeof(RotateThumbExtension), typeof(RenderTransformOriginExtension), typeof(InPlaceEditorExtension), typeof(SizeDisplayExtension) })] [ExtensionFor(typeof(Polyline), OverrideExtensions = new Type[] { typeof(ResizeThumbExtension), typeof(SelectedElementRectangleExtension), typeof(CanvasPositionExtension), typeof(QuickOperationMenuExtension), typeof(RotateThumbExtension), typeof(RenderTransformOriginExtension), typeof(InPlaceEditorExtension), typeof(SizeDisplayExtension), typeof(SkewThumbExtension) })]
internal class PolyLineHandlerExtension : LineExtensionBase, IKeyDown, IKeyUp internal class PolyLineHandlerExtension : LineExtensionBase, IKeyDown, IKeyUp
{ {
private readonly Dictionary<int, Bounds> _selectedThumbs = new Dictionary<int, Bounds>(); private readonly Dictionary<int, Bounds> _selectedThumbs = new Dictionary<int, Bounds>();
@ -134,15 +145,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
void SetOperation() void SetOperation()
{ {
var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel; var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel;
if (designPanel != null) _zoom = designPanel.TryFindParent<ZoomControl>();
{
var p = VisualTreeHelper.GetParent(designPanel);
while (p != null && !(p is ZoomControl))
{
p = VisualTreeHelper.GetParent(p);
}
_zoom = p as ZoomControl;
}
if (resizeBehavior != null) if (resizeBehavior != null)
operation = PlacementOperation.Start(extendedItemArray, PlacementType.Resize); operation = PlacementOperation.Start(extendedItemArray, PlacementType.Resize);

11
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/ResizeThumbExtension.cs

@ -26,6 +26,7 @@ using ICSharpCode.WpfDesign.Adorners;
using ICSharpCode.WpfDesign.Designer.Controls; using ICSharpCode.WpfDesign.Designer.Controls;
using ICSharpCode.WpfDesign.Extensions; using ICSharpCode.WpfDesign.Extensions;
using System.Collections.Generic; using System.Collections.Generic;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions namespace ICSharpCode.WpfDesign.Designer.Extensions
{ {
@ -124,15 +125,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
void drag_Started(DragListener drag) void drag_Started(DragListener drag)
{ {
var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel; var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel;
if (designPanel != null) zoom = designPanel.TryFindParent<ZoomControl>();
{
var p = VisualTreeHelper.GetParent(designPanel);
while (p != null && !(p is ZoomControl))
{
p = VisualTreeHelper.GetParent(p);
}
zoom = p as ZoomControl;
}
/* Abort editing Text if it was editing, because it interferes with the undo stack. */ /* Abort editing Text if it was editing, because it interferes with the undo stack. */
foreach(var extension in this.ExtendedItem.Extensions){ foreach(var extension in this.ExtendedItem.Extensions){

11
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs

@ -140,7 +140,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
} }
foreach (var d in drawLines) { foreach (var d in drawLines) {
DrawLine(d.Start, d.Offset, d.End, d.Offset); DrawLine(d.Start, d.Offset + d.DrawOffset, d.End, d.Offset + d.DrawOffset);
} }
} }
@ -163,7 +163,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
} }
foreach (var d in drawLines) { foreach (var d in drawLines) {
DrawLine(d.Offset, d.Start, d.Offset, d.End); DrawLine(d.Offset + d.DrawOffset, d.Start, d.Offset + d.DrawOffset, d.End);
} }
} }
} }
@ -264,8 +264,8 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
if (filter == null) if (filter == null)
{ {
h.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Top + Math.Abs((r2.Top - r2.Bottom) / 2), Start = r.Left, End = r.Right }); h.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Top + Math.Abs((r2.Top - r2.Bottom) / 2) - 1, DrawOffset = 1, Start = r.Left, End = r.Right });
v.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Left + Math.Abs((r2.Left - r2.Right) / 2), Start = r.Top, End = r.Bottom }); v.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Left + Math.Abs((r2.Left - r2.Right) / 2) - 1, DrawOffset = 1, Start = r.Top, End = r.Bottom });
} }
} }
} }
@ -365,6 +365,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
drawLine = new Snapline(); drawLine = new Snapline();
drawLine.Start = double.MaxValue; drawLine.Start = double.MaxValue;
drawLine.End = double.MinValue; drawLine.End = double.MinValue;
drawLine.DrawOffset = mapLine.DrawOffset;
offsetDict[offset] = drawLine; offsetDict[offset] = drawLine;
} }
drawLine.Offset = offset; drawLine.Offset = offset;
@ -386,6 +387,8 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
public double End; public double End;
public bool RequireOverlap; public bool RequireOverlap;
public int Group; public int Group;
public double DrawOffset = 0;
} }
} }
} }

142
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/DummyValueInsteadOfNullTypeDescriptionProvider.cs

@ -0,0 +1,142 @@
// Copyright (c) 2014 AlphaSierraPapa for the SharpDevelop Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel;
using System.Linq;
namespace ICSharpCode.WpfDesign
{
/// <summary>
/// Description of DummyValueInsteadOfNullTypeDescriptionProvider.
/// </summary>
public sealed class DummyValueInsteadOfNullTypeDescriptionProvider : TypeDescriptionProvider
{
// By using a TypeDescriptionProvider, we can intercept all access to the property that is
// using a PropertyDescriptor. WpfDesign.XamlDom uses a PropertyDescriptor for accessing
// properties (except for attached properties), so even DesignItemProperty/XamlProperty.ValueOnInstance
// will report null when the actual value is the dummy value.
readonly string _propertyName;
readonly object _dummyValue;
public DummyValueInsteadOfNullTypeDescriptionProvider(TypeDescriptionProvider existingProvider,
string propertyName, object dummyValue)
: base(existingProvider)
{
this._propertyName = propertyName;
this._dummyValue = dummyValue;
}
public override ICustomTypeDescriptor GetTypeDescriptor(Type objectType, object instance)
{
return new ShadowTypeDescriptor(this, base.GetTypeDescriptor(objectType, instance));
}
sealed class ShadowTypeDescriptor : CustomTypeDescriptor
{
readonly DummyValueInsteadOfNullTypeDescriptionProvider _parent;
public ShadowTypeDescriptor(DummyValueInsteadOfNullTypeDescriptionProvider parent,
ICustomTypeDescriptor existingDescriptor)
: base(existingDescriptor)
{
this._parent = parent;
}
public override PropertyDescriptorCollection GetProperties()
{
return Filter(base.GetProperties());
}
public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
return Filter(base.GetProperties(attributes));
}
PropertyDescriptorCollection Filter(PropertyDescriptorCollection properties)
{
PropertyDescriptor property = properties[_parent._propertyName];
if (property != null) {
if ((properties as System.Collections.IDictionary).IsReadOnly) {
properties = new PropertyDescriptorCollection(properties.Cast<PropertyDescriptor>().ToArray());
}
properties.Remove(property);
properties.Add(new ShadowPropertyDescriptor(_parent, property));
}
return properties;
}
}
sealed class ShadowPropertyDescriptor : PropertyDescriptor
{
readonly DummyValueInsteadOfNullTypeDescriptionProvider _parent;
readonly PropertyDescriptor _baseDescriptor;
public ShadowPropertyDescriptor(DummyValueInsteadOfNullTypeDescriptionProvider parent,
PropertyDescriptor existingDescriptor)
: base(existingDescriptor)
{
this._parent = parent;
this._baseDescriptor = existingDescriptor;
}
public override Type ComponentType {
get { return _baseDescriptor.ComponentType; }
}
public override bool IsReadOnly {
get { return _baseDescriptor.IsReadOnly; }
}
public override Type PropertyType {
get { return _baseDescriptor.PropertyType; }
}
public override bool CanResetValue(object component)
{
return _baseDescriptor.CanResetValue(component);
}
public override object GetValue(object component)
{
object value = _baseDescriptor.GetValue(component);
if (value == _parent._dummyValue)
return null;
else
return value;
}
public override void ResetValue(object component)
{
_baseDescriptor.SetValue(component, _parent._dummyValue);
}
public override void SetValue(object component, object value)
{
_baseDescriptor.SetValue(component, value ?? _parent._dummyValue);
}
public override bool ShouldSerializeValue(object component)
{
return _baseDescriptor.ShouldSerializeValue(component)
&& _baseDescriptor.GetValue(component) != _parent._dummyValue;
}
}
}
}

1
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/WpfDesign.csproj

@ -73,6 +73,7 @@
<Compile Include="Adorners\AdornerProvider.cs" /> <Compile Include="Adorners\AdornerProvider.cs" />
<Compile Include="Adorners\AdornerProviderClasses.cs" /> <Compile Include="Adorners\AdornerProviderClasses.cs" />
<Compile Include="Adorners\RelativePlacement.cs" /> <Compile Include="Adorners\RelativePlacement.cs" />
<Compile Include="DummyValueInsteadOfNullTypeDescriptionProvider.cs" />
<Compile Include="ExtensionMethods.cs" /> <Compile Include="ExtensionMethods.cs" />
<Compile Include="Extensions\ExtensionAttribute.cs" /> <Compile Include="Extensions\ExtensionAttribute.cs" />
<Compile Include="Extensions\ExtensionInterfaces.cs" /> <Compile Include="Extensions\ExtensionInterfaces.cs" />

12
src/Libraries/AvalonDock/AvalonDock/Resources/NavigatorWindowStyle.xaml

@ -155,10 +155,17 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type ad:NavigatorWindow}"> <ControlTemplate TargetType="{x:Type ad:NavigatorWindow}">
<Border Width="574" Height="437" Background="{StaticResource NavigatorWindowBackground}" BorderBrush="{StaticResource NavigatorWindowBorderBrush}" BorderThickness="1" CornerRadius="3"> <Border Background="Transparent">
<Border.Effect> <Border.Effect>
<DropShadowEffect BlurRadius="15"/> <DropShadowEffect BlurRadius="5" ShadowDepth="0"/>
</Border.Effect> </Border.Effect>
<Border Width="574"
Height="437"
Background="{StaticResource NavigatorWindowBackground}"
BorderBrush="{StaticResource NavigatorWindowBorderBrush}"
BorderThickness="1"
SnapsToDevicePixels="True"
CornerRadius="2">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="54"/> <RowDefinition Height="54"/>
@ -224,6 +231,7 @@
</Border> </Border>
</Grid> </Grid>
</Border> </Border>
</Border>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>

2
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs

@ -3629,7 +3629,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion
yield return factory.CreateXmlDocCompletionData( yield return factory.CreateXmlDocCompletionData(
"exception", "exception",
"Identifies the exceptions a method can throw", "Identifies the exceptions a method can throw",
"exception cref=\"|\"></exception" "exception cref=\"|\"></exception>"
); );
yield return factory.CreateXmlDocCompletionData( yield return factory.CreateXmlDocCompletionData(
"include", "include",

12
src/Main/Base/Test/ProjectOptions/AssemblyInfoProviderTests.cs

@ -103,7 +103,7 @@ using System.Runtime.InteropServices;
Assert.AreEqual("Alias", assemblyInfo.DefaultAlias); Assert.AreEqual("Alias", assemblyInfo.DefaultAlias);
Assert.AreEqual(new Version(1, 2, 3, 1), assemblyInfo.AssemblyVersion); Assert.AreEqual(new Version(1, 2, 3, 1), assemblyInfo.AssemblyVersion);
Assert.AreEqual(new Version(1, 2, 3, 2), assemblyInfo.AssemblyFileVersion); Assert.AreEqual(new Version(1, 2, 3, 2), assemblyInfo.AssemblyFileVersion);
Assert.AreEqual(new Version(1, 2, 3, 3), assemblyInfo.InformationalVersion); Assert.AreEqual(new Version(1, 2, 3, 3).ToString(), assemblyInfo.InformationalVersion);
Assert.AreEqual(new Guid("0c8c889f-ced2-4167-b155-2d48a99d8c72"), assemblyInfo.Guid); Assert.AreEqual(new Guid("0c8c889f-ced2-4167-b155-2d48a99d8c72"), assemblyInfo.Guid);
Assert.AreEqual("ru-RU", assemblyInfo.NeutralLanguage); Assert.AreEqual("ru-RU", assemblyInfo.NeutralLanguage);
Assert.IsTrue(assemblyInfo.ComVisible); Assert.IsTrue(assemblyInfo.ComVisible);
@ -136,7 +136,7 @@ using System.Runtime.InteropServices;
var assemblyInfo = ReadAssemblyInfo(assemblyInfoFile); var assemblyInfo = ReadAssemblyInfo(assemblyInfoFile);
Assert.IsNull(assemblyInfo.AssemblyVersion); Assert.IsNull(assemblyInfo.AssemblyVersion);
Assert.IsNull(assemblyInfo.AssemblyFileVersion); Assert.IsNull(assemblyInfo.AssemblyFileVersion);
Assert.IsNull(assemblyInfo.InformationalVersion); Assert.AreEqual("Incorrect version", assemblyInfo.InformationalVersion);
} }
[TestCase] [TestCase]
@ -202,7 +202,7 @@ using System.Runtime.InteropServices;
Assert.AreEqual("", assemblyInfo.DefaultAlias); Assert.AreEqual("", assemblyInfo.DefaultAlias);
Assert.IsNull(assemblyInfo.AssemblyVersion); Assert.IsNull(assemblyInfo.AssemblyVersion);
Assert.IsNull(assemblyInfo.AssemblyFileVersion); Assert.IsNull(assemblyInfo.AssemblyFileVersion);
Assert.IsNull(assemblyInfo.InformationalVersion); Assert.AreEqual("", assemblyInfo.InformationalVersion);
Assert.IsNull(assemblyInfo.Guid); Assert.IsNull(assemblyInfo.Guid);
Assert.AreEqual("", assemblyInfo.NeutralLanguage); Assert.AreEqual("", assemblyInfo.NeutralLanguage);
} }
@ -291,7 +291,7 @@ using System.Runtime.InteropServices;
Assert.AreEqual("Alias", assemblyInfo.DefaultAlias); Assert.AreEqual("Alias", assemblyInfo.DefaultAlias);
Assert.AreEqual(new Version(1, 2, 3, 1), assemblyInfo.AssemblyVersion); Assert.AreEqual(new Version(1, 2, 3, 1), assemblyInfo.AssemblyVersion);
Assert.AreEqual(new Version(1, 2, 3, 2), assemblyInfo.AssemblyFileVersion); Assert.AreEqual(new Version(1, 2, 3, 2), assemblyInfo.AssemblyFileVersion);
Assert.AreEqual(new Version(1, 2, 3, 3), assemblyInfo.InformationalVersion); Assert.AreEqual(new Version(1, 2, 3, 3).ToString(), assemblyInfo.InformationalVersion);
Assert.AreEqual(new Guid("0c8c889f-ced2-4167-b155-2d48a99d8c72"), assemblyInfo.Guid); Assert.AreEqual(new Guid("0c8c889f-ced2-4167-b155-2d48a99d8c72"), assemblyInfo.Guid);
Assert.AreEqual("ru-RU", assemblyInfo.NeutralLanguage); Assert.AreEqual("ru-RU", assemblyInfo.NeutralLanguage);
Assert.IsTrue(assemblyInfo.ComVisible); Assert.IsTrue(assemblyInfo.ComVisible);
@ -400,7 +400,7 @@ using System.Reflection;
DefaultAlias = "Alias", DefaultAlias = "Alias",
AssemblyVersion = new Version(1, 2, 3, 4), AssemblyVersion = new Version(1, 2, 3, 4),
AssemblyFileVersion = new Version(1, 2, 3, 4), AssemblyFileVersion = new Version(1, 2, 3, 4),
InformationalVersion = new Version(1, 2, 3, 4), InformationalVersion = new Version(1, 2, 3, 4).ToString(),
Guid = new Guid("0c8c889f-ced2-4167-b155-2d48a99d8c72"), Guid = new Guid("0c8c889f-ced2-4167-b155-2d48a99d8c72"),
NeutralLanguage = "ru-RU", NeutralLanguage = "ru-RU",
ComVisible = true, ComVisible = true,
@ -451,7 +451,7 @@ using System.Runtime.InteropServices;
DefaultAlias = "Alias-changed", DefaultAlias = "Alias-changed",
AssemblyVersion = new Version(4, 3, 2, 1), AssemblyVersion = new Version(4, 3, 2, 1),
AssemblyFileVersion = new Version(4, 3, 2, 1), AssemblyFileVersion = new Version(4, 3, 2, 1),
InformationalVersion = new Version(4, 3, 2, 1), InformationalVersion = new Version(4, 3, 2, 1).ToString(),
Guid = new Guid("dc8c889f-ced2-4167-b155-2d48a99d8c72"), Guid = new Guid("dc8c889f-ced2-4167-b155-2d48a99d8c72"),
NeutralLanguage = "en-US", NeutralLanguage = "en-US",
ComVisible = false, ComVisible = false,

Loading…
Cancel
Save