Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit a8b03d9

Browse files
author
gumme
committed
Merge remote-tracking branch 'upstream/master'
Conflicts: src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/SizeDisplay.cs src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
2 parents 40b5d51 + 70fd933 commit a8b03d9

54 files changed

Lines changed: 1312 additions & 230 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void SaveInitializeComponents(CodeMemberMethod codeMethod)
182182

183183
string newline = DocumentUtilities.GetLineTerminator(script.OriginalDocument, bodyRegion.BeginLine);
184184
string indentation = DocumentUtilities.GetIndentation(script.OriginalDocument, bodyRegion.BeginLine);
185-
string code = "{" + newline + GenerateInitializeComponents(codeMethod, indentation, newline) + indentation + "}";
185+
string code = "{" + newline + GenerateInitializeComponents(codeMethod, indentation, newline) + newline + indentation + "}";
186186

187187
int startOffset = script.GetCurrentOffset(bodyRegion.Begin);
188188
int endOffset = script.GetCurrentOffset(bodyRegion.End);

src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ public override void Complete(CompletionContext context, ICompletionItem item)
8383
XamlCompletionItem cItem = item as XamlCompletionItem;
8484

8585
if (xamlContext.Description == XamlContextDescription.InTag) {
86-
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
87-
context.CompletionCharHandled = context.CompletionChar == '=';
88-
context.Editor.Caret.Offset--;
89-
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
86+
if (cItem.Entity.SymbolKind == SymbolKind.Property || cItem.Entity.SymbolKind == SymbolKind.Event) {
87+
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
88+
context.CompletionCharHandled = context.CompletionChar == '=';
89+
context.Editor.Caret.Offset--;
90+
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
91+
}
9092
} else if (xamlContext.Description == XamlContextDescription.InMarkupExtension && !string.IsNullOrEmpty(xamlContext.RawAttributeValue)) {
9193
string valuePart = xamlContext.RawAttributeValue.Substring(0, xamlContext.ValueStartOffset);
9294
AttributeValue value = MarkupExtensionParser.ParseValue(valuePart);

src/AddIns/Debugger/Debugger.Core/Eval.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public Value Result {
7878
case EvalState.Evaluating: throw new GetValueException("Evaluating...");
7979
case EvalState.EvaluatedSuccessfully: return result;
8080
case EvalState.EvaluatedException: return result;
81-
case EvalState.EvaluatedNoResult: throw new DebuggerException("Evaluation did not return any value.");
81+
case EvalState.EvaluatedNoResult: throw new GetValueException("no result");
8282
case EvalState.EvaluatedTimeOut: throw new GetValueException("Timeout");
8383
default: throw new DebuggerException("Unknown state");
8484
}

src/AddIns/Debugger/Debugger.Core/Process.cs

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
using System.Collections.Generic;
2121
using System.Linq;
2222

23+
using System.Runtime.InteropServices;
2324
using ICSharpCode.NRefactory.TypeSystem;
2425
using Debugger.Interop.CorDebug;
2526
using Debugger.Interop.CorSym;
@@ -480,17 +481,26 @@ internal void AsyncContinue(DebuggeeStateAction action, Thread threadToRun = nul
480481
{
481482
AssertPaused();
482483

483-
if (threadToRun != null) {
484-
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_SUSPEND, null);
485-
threadToRun.CorThread.SetDebugState(CorDebugThreadState.THREAD_RUN);
486-
} else {
487-
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_RUN, null);
488-
}
489-
490-
NotifyResumed(action);
491-
corProcess.Continue(0);
492-
// this.TraceMessage("Continue");
484+
try {
485+
if (threadToRun != null) {
486+
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_SUSPEND, null);
487+
threadToRun.CorThread.SetDebugState(CorDebugThreadState.THREAD_RUN);
488+
} else {
489+
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_RUN, null);
490+
}
493491

492+
NotifyResumed(action);
493+
corProcess.Continue(0);
494+
// this.TraceMessage("Continue");
495+
} catch (COMException ex) {
496+
if (ex.HResult == unchecked((int)0x80131301)) {
497+
// Process was terminated. (Exception from HRESULT: 0x80131301)
498+
// This occurs if a process is killed (e.g. console window of console application closed)
499+
// while the application is doing something involving debugger callbacks (Debug.WriteLine calls, or throwing+handling exceptions).
500+
501+
// I think we can safely ignore this error.
502+
}
503+
}
494504
if (action == DebuggeeStateAction.Clear) {
495505
OnResumed();
496506
}

src/AddIns/Debugger/Debugger.Tests/Tests/ControlFlow_Stepping.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ namespace Debugger.Tests {
129129

130130
public partial class DebuggerTests
131131
{
132-
[NUnit.Framework.Test]
132+
[NUnit.Framework.Test, NUnit.Framework.Ignore("Broken on .NET 4.5.2 due to #472")]
133133
public void ControlFlow_Stepping()
134134
{
135135
StartTest();

src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public IEnumerable<ILLocalVariable> GetLocalVariables(IMethod method)
9696
var file = GetSymbols(method);
9797

9898
if (file == null || !file.DebugSymbols.ContainsKey(id))
99-
return null;
99+
return Enumerable.Empty<ILLocalVariable>();
100100

101101
var symbols = file.DebugSymbols[id];
102102

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/RotateThumb.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,6 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
3232
{
3333
public class RotateThumb : ResizeThumb
3434
{
35-
// private double initialAngle;
36-
// private RotateTransform rotateTransform;
37-
// private Vector startVector;
38-
// private Point centerPoint;
39-
// private Control designerItem;
40-
// private Panel canvas;
41-
// private AdornerPanel parent;
42-
4335
static RotateThumb()
4436
{
4537
DefaultStyleKeyProperty.OverrideMetadata(typeof(RotateThumb), new FrameworkPropertyMetadata(typeof(RotateThumb)));

src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/Initializers.cs

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -30,55 +30,55 @@ public class ContentControlInitializer : DefaultInitializer
3030
{
3131
public override void InitializeDefaults(DesignItem item)
3232
{
33-
//Not every Content Control can have a text as Content (e.g. ZoomBox of WPF Toolkit)
34-
if (item.Component is Button)
35-
{
33+
//Not every Content Control can have a text as Content (e.g. ZoomBox of WPF Toolkit)
34+
if (item.Component is Button)
35+
{
3636
DesignItemProperty contentProperty = item.Properties["Content"];
37-
if (contentProperty.ValueOnInstance == null)
38-
{
37+
if (contentProperty.ValueOnInstance == null)
38+
{
3939
contentProperty.SetValue(item.ComponentType.Name);
4040
}
4141
}
4242

43-
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
44-
if (verticalAlignmentProperty.ValueOnInstance == null)
45-
{
46-
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
47-
}
43+
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
44+
if (verticalAlignmentProperty.ValueOnInstance == null)
45+
{
46+
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
47+
}
4848

49-
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
50-
if (horizontalAlignmentProperty.ValueOnInstance == null)
51-
{
52-
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
53-
}
49+
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
50+
if (horizontalAlignmentProperty.ValueOnInstance == null)
51+
{
52+
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
53+
}
5454
}
5555
}
5656

5757
[ExtensionFor(typeof(TextBlock))]
58-
public class TextBlockInitializer : DefaultInitializer
59-
{
60-
public override void InitializeDefaults(DesignItem item)
61-
{
62-
DesignItemProperty textProperty = item.Properties["Text"];
63-
if (textProperty.ValueOnInstance == null || textProperty.ValueOnInstance.ToString() == "")
64-
{
65-
textProperty.SetValue(item.ComponentType.Name);
66-
}
58+
public class TextBlockInitializer : DefaultInitializer
59+
{
60+
public override void InitializeDefaults(DesignItem item)
61+
{
62+
DesignItemProperty textProperty = item.Properties["Text"];
63+
if (textProperty.ValueOnInstance == null || textProperty.ValueOnInstance.ToString() == "")
64+
{
65+
textProperty.SetValue(item.ComponentType.Name);
66+
}
6767

68-
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
69-
if (verticalAlignmentProperty.ValueOnInstance == null)
70-
{
71-
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
72-
}
68+
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
69+
if (verticalAlignmentProperty.ValueOnInstance == null)
70+
{
71+
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
72+
}
7373

74-
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
75-
if (horizontalAlignmentProperty.ValueOnInstance == null)
76-
{
77-
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
78-
}
79-
}
74+
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
75+
if (horizontalAlignmentProperty.ValueOnInstance == null)
76+
{
77+
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
78+
}
79+
}
8080
}
81-
81+
8282
[ExtensionFor(typeof(HeaderedContentControl), OverrideExtension = typeof(ContentControlInitializer))]
8383
public class HeaderedContentControlInitializer : DefaultInitializer
8484
{
@@ -96,7 +96,7 @@ public override void InitializeDefaults(DesignItem item)
9696
}
9797
}
9898

99-
[ExtensionFor(typeof(Shape))]
99+
[ExtensionFor(typeof(Shape))]
100100
public class ShapeInitializer : DefaultInitializer
101101
{
102102
public override void InitializeDefaults(DesignItem item)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ContextMenu x:Class="ICSharpCode.WpfDesign.Designer.Extensions.RightClickMultipleItemsContextMenu"
2+
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:Translation="clr-namespace:ICSharpCode.WpfDesign.Designer"
5+
>
6+
<MenuItem Header="{Binding WrapInCanvas, Source={x:Static Translation:Translations.Instance}}" Click="Click_WrapInCanvas" />
7+
<MenuItem Header="{Binding WrapInGrid, Source={x:Static Translation:Translations.Instance}}" Click="Click_WrapInGrid" />
8+
</ContextMenu>

src/AddIns/Misc/PackageManagement/Project/Src/SettingsFactory.cs renamed to src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenu.xaml.cs

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,42 @@
1717
// DEALINGS IN THE SOFTWARE.
1818

1919
using System;
20-
using NuGet;
20+
using System.Collections.Generic;
21+
using System.Linq;
22+
using System.Text;
23+
using System.Windows;
24+
using System.Windows.Controls;
25+
using System.Windows.Data;
26+
using System.Windows.Documents;
27+
using System.Windows.Input;
28+
using System.Windows.Media;
29+
using System.Windows.Media.Imaging;
30+
using System.Windows.Navigation;
31+
using System.Windows.Shapes;
32+
using ICSharpCode.WpfDesign.PropertyGrid;
33+
using ICSharpCode.WpfDesign.Designer.Xaml;
2134

22-
namespace ICSharpCode.PackageManagement
35+
namespace ICSharpCode.WpfDesign.Designer.Extensions
2336
{
24-
public class SettingsFactory : ISettingsFactory
37+
public partial class RightClickMultipleItemsContextMenu
2538
{
26-
public ISettings CreateSettings(string directory)
39+
private DesignItem designItem;
40+
41+
public RightClickMultipleItemsContextMenu(DesignItem designItem)
2742
{
28-
var fileSystem = new PhysicalFileSystem(directory);
29-
return new Settings(fileSystem);
43+
this.designItem = designItem;
44+
45+
InitializeComponent();
46+
}
47+
48+
void Click_WrapInCanvas(object sender, System.Windows.RoutedEventArgs e)
49+
{
50+
ModelTools.WrapItemsNewContainer(this.designItem.Services.Selection.SelectedItems, typeof(Canvas));
51+
}
52+
53+
void Click_WrapInGrid(object sender, System.Windows.RoutedEventArgs e)
54+
{
55+
ModelTools.WrapItemsNewContainer(this.designItem.Services.Selection.SelectedItems, typeof(Grid));
3056
}
3157
}
3258
}

0 commit comments

Comments
 (0)