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

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

@ -163,7 +163,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing @@ -163,7 +163,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
ProcessStartInfo processStartInfo = openCoverApp.GetProcessStartInfo();
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\" " +
"-targetargs:\"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"-output:\"c:\\projects\\MyTests\\OpenCover\\coverage.xml\" " +
@ -187,7 +187,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing @@ -187,7 +187,7 @@ namespace ICSharpCode.CodeCoverage.Tests.Testing
ProcessStartInfo processStartInfo = openCoverApp.GetProcessStartInfo();
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\" " +
"-targetargs:\"\\\"c:\\projects\\MyTests\\bin\\Debug\\MyTests.dll\\\" /noxml\" " +
"-output:\"c:\\projects\\MyTests\\OpenCover\\coverage.xml\" " +

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

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

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

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

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

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

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

@ -1,11 +1,21 @@ @@ -1,11 +1,21 @@
/*
* Created by SharpDevelop.
* User: trubra
* Date: 2014-12-22
* Time: 11:00
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
// 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 ICSharpCode.WpfDesign.Designer.Controls;
using ICSharpCode.WpfDesign.Designer.Extensions;

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

@ -1,11 +1,21 @@ @@ -1,11 +1,21 @@
/*
* Created by SharpDevelop.
* User: trubra
* Date: 2014-12-22
* Time: 10:34
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
// 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 ICSharpCode.WpfDesign.Extensions;
using ICSharpCode.WpfDesign;
@ -21,12 +31,13 @@ using System; @@ -21,12 +31,13 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
/// <summary>
/// Description of LineHandlerExtension.
/// </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
{
//
@ -101,15 +112,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -101,15 +112,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
CurrentTop = (double)al.GetValue(Canvas.TopProperty);
var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel;
if (designPanel != null)
{
var p = VisualTreeHelper.GetParent(designPanel);
while (p != null && !(p is ZoomControl))
{
p = VisualTreeHelper.GetParent(p);
}
zoom = p as ZoomControl;
}
zoom = designPanel.TryFindParent<ZoomControl>();
if (resizeBehavior != null)
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 @@ -79,8 +79,8 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
}
[ExtensionFor(typeof(Border))]
public sealed class BorderInstanceFactory : CustomInstanceFactory
[ExtensionFor(typeof(ItemsControl))]
public sealed class TransparentControlsInstanceFactory : CustomInstanceFactory
{
Brush _transparentBrush = new SolidColorBrush(Colors.Transparent);
@ -90,133 +90,44 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -90,133 +90,44 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
public override object CreateInstance(Type type, params object[] arguments)
{
object instance = base.CreateInstance(type, arguments);
Border panel = instance as Border;
if (panel != null)
{
if (panel.Background == null)
{
panel.Background = _transparentBrush;
Control control = instance as Control;
if (control != null && (
type == typeof(ItemsControl))) {
if (control.Background == null) {
control.Background = _transparentBrush;
}
TypeDescriptionProvider provider = new DummyValueInsteadOfNullTypeDescriptionProvider(
TypeDescriptor.GetProvider(panel), "Background", _transparentBrush);
TypeDescriptor.AddProvider(provider, panel);
TypeDescriptor.GetProvider(control), "Background", _transparentBrush);
TypeDescriptor.AddProvider(provider, control);
}
return instance;
}
}
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)
[ExtensionFor(typeof(Border))]
public sealed class BorderInstanceFactory : CustomInstanceFactory
{
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);
if (value == _parent._dummyValue)
return null;
else
return value;
}
public override void ResetValue(object component)
object instance = base.CreateInstance(type, arguments);
Border panel = instance as Border;
if (panel != null)
{
_baseDescriptor.SetValue(component, _parent._dummyValue);
}
public override void SetValue(object component, object value)
if (panel.Background == null)
{
_baseDescriptor.SetValue(component, value ?? _parent._dummyValue);
panel.Background = _transparentBrush;
}
public override bool ShouldSerializeValue(object component)
{
return _baseDescriptor.ShouldSerializeValue(component)
&& _baseDescriptor.GetValue(component) != _parent._dummyValue;
TypeDescriptionProvider provider = new DummyValueInsteadOfNullTypeDescriptionProvider(
TypeDescriptor.GetProvider(panel), "Background", _transparentBrush);
TypeDescriptor.AddProvider(provider, panel);
}
return instance;
}
}
}

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

@ -1,11 +1,21 @@ @@ -1,11 +1,21 @@
/*
* Created by SharpDevelop.
* User: trubra
* Date: 2014-12-22
* Time: 10:34
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
// 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 ICSharpCode.WpfDesign.Extensions;
using ICSharpCode.WpfDesign;
@ -21,13 +31,14 @@ using System; @@ -21,13 +31,14 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
/// <summary>
/// Description of PolyLineHandlerExtension.
/// </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
{
private readonly Dictionary<int, Bounds> _selectedThumbs = new Dictionary<int, Bounds>();
@ -134,15 +145,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -134,15 +145,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
void SetOperation()
{
var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel;
if (designPanel != null)
{
var p = VisualTreeHelper.GetParent(designPanel);
while (p != null && !(p is ZoomControl))
{
p = VisualTreeHelper.GetParent(p);
}
_zoom = p as ZoomControl;
}
_zoom = designPanel.TryFindParent<ZoomControl>();
if (resizeBehavior != null)
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; @@ -26,6 +26,7 @@ using ICSharpCode.WpfDesign.Adorners;
using ICSharpCode.WpfDesign.Designer.Controls;
using ICSharpCode.WpfDesign.Extensions;
using System.Collections.Generic;
using ICSharpCode.WpfDesign.Designer.UIExtensions;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
@ -124,15 +125,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -124,15 +125,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
void drag_Started(DragListener drag)
{
var designPanel = ExtendedItem.Services.DesignPanel as DesignPanel;
if (designPanel != null)
{
var p = VisualTreeHelper.GetParent(designPanel);
while (p != null && !(p is ZoomControl))
{
p = VisualTreeHelper.GetParent(p);
}
zoom = p as ZoomControl;
}
zoom = designPanel.TryFindParent<ZoomControl>();
/* Abort editing Text if it was editing, because it interferes with the undo stack. */
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 @@ -140,7 +140,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
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 @@ -163,7 +163,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
}
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 @@ -264,8 +264,8 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
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 });
v.Add(new Snapline() { RequireOverlap = requireOverlap, Offset = r2.Left + Math.Abs((r2.Left - r2.Right) / 2), Start = r.Top, End = r.Bottom });
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) - 1, DrawOffset = 1, Start = r.Top, End = r.Bottom });
}
}
}
@ -365,6 +365,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -365,6 +365,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
drawLine = new Snapline();
drawLine.Start = double.MaxValue;
drawLine.End = double.MinValue;
drawLine.DrawOffset = mapLine.DrawOffset;
offsetDict[offset] = drawLine;
}
drawLine.Offset = offset;
@ -386,6 +387,8 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -386,6 +387,8 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
public double End;
public bool RequireOverlap;
public int Group;
public double DrawOffset = 0;
}
}
}

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

@ -0,0 +1,142 @@ @@ -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 @@ @@ -73,6 +73,7 @@
<Compile Include="Adorners\AdornerProvider.cs" />
<Compile Include="Adorners\AdornerProviderClasses.cs" />
<Compile Include="Adorners\RelativePlacement.cs" />
<Compile Include="DummyValueInsteadOfNullTypeDescriptionProvider.cs" />
<Compile Include="ExtensionMethods.cs" />
<Compile Include="Extensions\ExtensionAttribute.cs" />
<Compile Include="Extensions\ExtensionInterfaces.cs" />

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

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

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

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

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

@ -103,7 +103,7 @@ using System.Runtime.InteropServices; @@ -103,7 +103,7 @@ using System.Runtime.InteropServices;
Assert.AreEqual("Alias", assemblyInfo.DefaultAlias);
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, 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("ru-RU", assemblyInfo.NeutralLanguage);
Assert.IsTrue(assemblyInfo.ComVisible);
@ -136,7 +136,7 @@ using System.Runtime.InteropServices; @@ -136,7 +136,7 @@ using System.Runtime.InteropServices;
var assemblyInfo = ReadAssemblyInfo(assemblyInfoFile);
Assert.IsNull(assemblyInfo.AssemblyVersion);
Assert.IsNull(assemblyInfo.AssemblyFileVersion);
Assert.IsNull(assemblyInfo.InformationalVersion);
Assert.AreEqual("Incorrect version", assemblyInfo.InformationalVersion);
}
[TestCase]
@ -202,7 +202,7 @@ using System.Runtime.InteropServices; @@ -202,7 +202,7 @@ using System.Runtime.InteropServices;
Assert.AreEqual("", assemblyInfo.DefaultAlias);
Assert.IsNull(assemblyInfo.AssemblyVersion);
Assert.IsNull(assemblyInfo.AssemblyFileVersion);
Assert.IsNull(assemblyInfo.InformationalVersion);
Assert.AreEqual("", assemblyInfo.InformationalVersion);
Assert.IsNull(assemblyInfo.Guid);
Assert.AreEqual("", assemblyInfo.NeutralLanguage);
}
@ -291,7 +291,7 @@ using System.Runtime.InteropServices; @@ -291,7 +291,7 @@ using System.Runtime.InteropServices;
Assert.AreEqual("Alias", assemblyInfo.DefaultAlias);
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, 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("ru-RU", assemblyInfo.NeutralLanguage);
Assert.IsTrue(assemblyInfo.ComVisible);
@ -400,7 +400,7 @@ using System.Reflection; @@ -400,7 +400,7 @@ using System.Reflection;
DefaultAlias = "Alias",
AssemblyVersion = 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"),
NeutralLanguage = "ru-RU",
ComVisible = true,
@ -451,7 +451,7 @@ using System.Runtime.InteropServices; @@ -451,7 +451,7 @@ using System.Runtime.InteropServices;
DefaultAlias = "Alias-changed",
AssemblyVersion = 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"),
NeutralLanguage = "en-US",
ComVisible = false,

Loading…
Cancel
Save