Browse Source

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
pull/521/head
gumme 11 years ago
parent
commit
a8b03d9ee5
  1. 2
      src/AddIns/BackendBindings/CSharpBinding/Project/Src/FormsDesigner/CSharpDesignerGenerator.cs
  2. 10
      src/AddIns/BackendBindings/XamlBinding/XamlBinding/XamlCompletionItemList.cs
  3. 2
      src/AddIns/Debugger/Debugger.Core/Eval.cs
  4. 30
      src/AddIns/Debugger/Debugger.Core/Process.cs
  5. 2
      src/AddIns/Debugger/Debugger.Tests/Tests/ControlFlow_Stepping.cs
  6. 2
      src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs
  7. 8
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/RotateThumb.cs
  8. 74
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/Initializers.cs
  9. 8
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenu.xaml
  10. 38
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenu.xaml.cs
  11. 37
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenuExtension.cs
  12. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/SnaplinePlacementBehavior.cs
  13. 172
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ModelTools.cs
  14. 18
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Translations.cs
  15. 5
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
  16. 51
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/MarkupExtensionTests.cs
  17. 9
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/MarkupExtensionParser.cs
  18. 30
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs
  19. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/PlacementInformation.cs
  20. 50
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Services.cs
  21. 4
      src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
  22. 1
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakePackageManagementProjectService.cs
  23. 28
      src/AddIns/Misc/PackageManagement/Project/Src/ISettingsFactory.cs
  24. 14
      src/AddIns/Misc/PackageManagement/Project/Src/ISettingsProvider.cs
  25. 10
      src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs
  26. 36
      src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs
  27. 62
      src/AddIns/Misc/PackageManagement/Project/Src/SettingsProvider.cs
  28. 2
      src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj
  29. 22
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestablePackageManagementOptions.cs
  30. 115
      src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsTests.cs
  31. 4
      src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsViewModelTests.cs
  32. 80
      src/AddIns/Misc/PackageManagement/Test/Src/SettingsProviderTests.cs
  33. 15
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj
  34. 65
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs
  35. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/TextItemDesigner.cs
  36. 12
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/DataTypeStringConverter.cs
  37. 43
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/DefaultTextEditor.cs
  38. 94
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/EditorDialog.Designer.cs
  39. 49
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/EditorDialog.cs
  40. 120
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/EditorDialog.resx
  41. 40
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/ExpressionEditor.cs
  42. 40
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/FormatStringConverter.cs
  43. 22
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/IStringBasedEditorDialog.cs
  44. 32
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Globals/GlobalLists.cs
  45. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/TypeProviderHelper.cs
  46. 2
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Views/DesignerView.cs
  47. 17
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs
  48. 2
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertForeachToForAction.cs
  49. 7
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateOverloadWithoutParameterAction.cs
  50. 18
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/UnreachableCodeIssue.cs
  51. 7
      src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCatchClauseIssue.cs
  52. 2
      src/Libraries/NRefactory/ICSharpCode.NRefactory.Xml/DocumentationElement.cs
  53. 2
      src/Main/GlobalAssemblyInfo.cs.template
  54. 1
      src/Main/SharpDevelop/Project/Solution.cs

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

@ -182,7 +182,7 @@ namespace CSharpBinding.FormsDesigner @@ -182,7 +182,7 @@ namespace CSharpBinding.FormsDesigner
string newline = DocumentUtilities.GetLineTerminator(script.OriginalDocument, bodyRegion.BeginLine);
string indentation = DocumentUtilities.GetIndentation(script.OriginalDocument, bodyRegion.BeginLine);
string code = "{" + newline + GenerateInitializeComponents(codeMethod, indentation, newline) + indentation + "}";
string code = "{" + newline + GenerateInitializeComponents(codeMethod, indentation, newline) + newline + indentation + "}";
int startOffset = script.GetCurrentOffset(bodyRegion.Begin);
int endOffset = script.GetCurrentOffset(bodyRegion.End);

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

@ -83,10 +83,12 @@ namespace ICSharpCode.XamlBinding @@ -83,10 +83,12 @@ namespace ICSharpCode.XamlBinding
XamlCompletionItem cItem = item as XamlCompletionItem;
if (xamlContext.Description == XamlContextDescription.InTag) {
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
context.CompletionCharHandled = context.CompletionChar == '=';
context.Editor.Caret.Offset--;
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
if (cItem.Entity.SymbolKind == SymbolKind.Property || cItem.Entity.SymbolKind == SymbolKind.Event) {
context.Editor.Document.Insert(context.EndOffset, "=\"\"");
context.CompletionCharHandled = context.CompletionChar == '=';
context.Editor.Caret.Offset--;
new XamlCodeCompletionBinding().CtrlSpace(context.Editor);
}
} else if (xamlContext.Description == XamlContextDescription.InMarkupExtension && !string.IsNullOrEmpty(xamlContext.RawAttributeValue)) {
string valuePart = xamlContext.RawAttributeValue.Substring(0, xamlContext.ValueStartOffset);
AttributeValue value = MarkupExtensionParser.ParseValue(valuePart);

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

@ -78,7 +78,7 @@ namespace Debugger @@ -78,7 +78,7 @@ namespace Debugger
case EvalState.Evaluating: throw new GetValueException("Evaluating...");
case EvalState.EvaluatedSuccessfully: return result;
case EvalState.EvaluatedException: return result;
case EvalState.EvaluatedNoResult: throw new DebuggerException("Evaluation did not return any value.");
case EvalState.EvaluatedNoResult: throw new GetValueException("no result");
case EvalState.EvaluatedTimeOut: throw new GetValueException("Timeout");
default: throw new DebuggerException("Unknown state");
}

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

@ -20,6 +20,7 @@ using System; @@ -20,6 +20,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using ICSharpCode.NRefactory.TypeSystem;
using Debugger.Interop.CorDebug;
using Debugger.Interop.CorSym;
@ -480,17 +481,26 @@ namespace Debugger @@ -480,17 +481,26 @@ namespace Debugger
{
AssertPaused();
if (threadToRun != null) {
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_SUSPEND, null);
threadToRun.CorThread.SetDebugState(CorDebugThreadState.THREAD_RUN);
} else {
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_RUN, null);
}
NotifyResumed(action);
corProcess.Continue(0);
// this.TraceMessage("Continue");
try {
if (threadToRun != null) {
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_SUSPEND, null);
threadToRun.CorThread.SetDebugState(CorDebugThreadState.THREAD_RUN);
} else {
corProcess.SetAllThreadsDebugState(CorDebugThreadState.THREAD_RUN, null);
}
NotifyResumed(action);
corProcess.Continue(0);
// this.TraceMessage("Continue");
} catch (COMException ex) {
if (ex.HResult == unchecked((int)0x80131301)) {
// Process was terminated. (Exception from HRESULT: 0x80131301)
// This occurs if a process is killed (e.g. console window of console application closed)
// while the application is doing something involving debugger callbacks (Debug.WriteLine calls, or throwing+handling exceptions).
// I think we can safely ignore this error.
}
}
if (action == DebuggeeStateAction.Clear) {
OnResumed();
}

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

@ -129,7 +129,7 @@ namespace Debugger.Tests { @@ -129,7 +129,7 @@ namespace Debugger.Tests {
public partial class DebuggerTests
{
[NUnit.Framework.Test]
[NUnit.Framework.Test, NUnit.Framework.Ignore("Broken on .NET 4.5.2 due to #472")]
public void ControlFlow_Stepping()
{
StartTest();

2
src/AddIns/DisplayBindings/ILSpyAddIn/ILSpySymbolSource.cs

@ -96,7 +96,7 @@ namespace ICSharpCode.ILSpyAddIn @@ -96,7 +96,7 @@ namespace ICSharpCode.ILSpyAddIn
var file = GetSymbols(method);
if (file == null || !file.DebugSymbols.ContainsKey(id))
return null;
return Enumerable.Empty<ILLocalVariable>();
var symbols = file.DebugSymbols[id];

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

@ -32,14 +32,6 @@ namespace ICSharpCode.WpfDesign.Designer.Controls @@ -32,14 +32,6 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
{
public class RotateThumb : ResizeThumb
{
// private double initialAngle;
// private RotateTransform rotateTransform;
// private Vector startVector;
// private Point centerPoint;
// private Control designerItem;
// private Panel canvas;
// private AdornerPanel parent;
static RotateThumb()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(RotateThumb), new FrameworkPropertyMetadata(typeof(RotateThumb)));

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

@ -30,55 +30,55 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers @@ -30,55 +30,55 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers
{
public override void InitializeDefaults(DesignItem item)
{
//Not every Content Control can have a text as Content (e.g. ZoomBox of WPF Toolkit)
if (item.Component is Button)
{
//Not every Content Control can have a text as Content (e.g. ZoomBox of WPF Toolkit)
if (item.Component is Button)
{
DesignItemProperty contentProperty = item.Properties["Content"];
if (contentProperty.ValueOnInstance == null)
{
if (contentProperty.ValueOnInstance == null)
{
contentProperty.SetValue(item.ComponentType.Name);
}
}
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
if (verticalAlignmentProperty.ValueOnInstance == null)
{
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
}
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
if (verticalAlignmentProperty.ValueOnInstance == null)
{
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
}
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
if (horizontalAlignmentProperty.ValueOnInstance == null)
{
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
}
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
if (horizontalAlignmentProperty.ValueOnInstance == null)
{
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
}
}
}
[ExtensionFor(typeof(TextBlock))]
public class TextBlockInitializer : DefaultInitializer
{
public override void InitializeDefaults(DesignItem item)
{
DesignItemProperty textProperty = item.Properties["Text"];
if (textProperty.ValueOnInstance == null || textProperty.ValueOnInstance.ToString() == "")
{
textProperty.SetValue(item.ComponentType.Name);
}
public class TextBlockInitializer : DefaultInitializer
{
public override void InitializeDefaults(DesignItem item)
{
DesignItemProperty textProperty = item.Properties["Text"];
if (textProperty.ValueOnInstance == null || textProperty.ValueOnInstance.ToString() == "")
{
textProperty.SetValue(item.ComponentType.Name);
}
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
if (verticalAlignmentProperty.ValueOnInstance == null)
{
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
}
DesignItemProperty verticalAlignmentProperty = item.Properties["VerticalAlignment"];
if (verticalAlignmentProperty.ValueOnInstance == null)
{
verticalAlignmentProperty.SetValue(VerticalAlignment.Center);
}
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
if (horizontalAlignmentProperty.ValueOnInstance == null)
{
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
}
}
DesignItemProperty horizontalAlignmentProperty = item.Properties["HorizontalAlignment"];
if (horizontalAlignmentProperty.ValueOnInstance == null)
{
horizontalAlignmentProperty.SetValue(HorizontalAlignment.Center);
}
}
}
[ExtensionFor(typeof(HeaderedContentControl), OverrideExtension = typeof(ContentControlInitializer))]
public class HeaderedContentControlInitializer : DefaultInitializer
{
@ -96,7 +96,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers @@ -96,7 +96,7 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions.Initializers
}
}
[ExtensionFor(typeof(Shape))]
[ExtensionFor(typeof(Shape))]
public class ShapeInitializer : DefaultInitializer
{
public override void InitializeDefaults(DesignItem item)

8
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenu.xaml

@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
<ContextMenu x:Class="ICSharpCode.WpfDesign.Designer.Extensions.RightClickMultipleItemsContextMenu"
xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Translation="clr-namespace:ICSharpCode.WpfDesign.Designer"
>
<MenuItem Header="{Binding WrapInCanvas, Source={x:Static Translation:Translations.Instance}}" Click="Click_WrapInCanvas" />
<MenuItem Header="{Binding WrapInGrid, Source={x:Static Translation:Translations.Instance}}" Click="Click_WrapInGrid" />
</ContextMenu>

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

@ -17,16 +17,42 @@ @@ -17,16 +17,42 @@
// DEALINGS IN THE SOFTWARE.
using System;
using NuGet;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ICSharpCode.WpfDesign.PropertyGrid;
using ICSharpCode.WpfDesign.Designer.Xaml;
namespace ICSharpCode.PackageManagement
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
public class SettingsFactory : ISettingsFactory
public partial class RightClickMultipleItemsContextMenu
{
public ISettings CreateSettings(string directory)
private DesignItem designItem;
public RightClickMultipleItemsContextMenu(DesignItem designItem)
{
var fileSystem = new PhysicalFileSystem(directory);
return new Settings(fileSystem);
this.designItem = designItem;
InitializeComponent();
}
void Click_WrapInCanvas(object sender, System.Windows.RoutedEventArgs e)
{
ModelTools.WrapItemsNewContainer(this.designItem.Services.Selection.SelectedItems, typeof(Canvas));
}
void Click_WrapInGrid(object sender, System.Windows.RoutedEventArgs e)
{
ModelTools.WrapItemsNewContainer(this.designItem.Services.Selection.SelectedItems, typeof(Grid));
}
}
}

37
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeSettingsFactory.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Extensions/RightClickMultipleItemsContextMenuExtension.cs

@ -17,21 +17,38 @@ @@ -17,21 +17,38 @@
// DEALINGS IN THE SOFTWARE.
using System;
using ICSharpCode.PackageManagement;
using ICSharpCode.PackageManagement.Design;
using NuGet;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
namespace PackageManagement.Tests.Helpers
using ICSharpCode.WpfDesign.Adorners;
using ICSharpCode.WpfDesign.Extensions;
using ICSharpCode.WpfDesign.Designer;
namespace ICSharpCode.WpfDesign.Designer.Extensions
{
public class FakeSettingsFactory : ISettingsFactory
/// <summary>
///
/// </summary>
[ExtensionServer(typeof(MultipleSelectedExtensionServer))]
[ExtensionFor(typeof(UIElement))]
public class RightClickMultipleItemsContextMenuExtension : SelectionAdornerProvider
{
public FakeSettings FakeSettings = new FakeSettings();
public string DirectoryPassedToCreateSettings;
DesignPanel panel;
protected override void OnInitialized()
{
base.OnInitialized();
panel = ExtendedItem.Context.Services.DesignPanel as DesignPanel;
panel.ContextMenu = new RightClickMultipleItemsContextMenu(ExtendedItem);
}
public ISettings CreateSettings(string directory)
protected override void OnRemove()
{
DirectoryPassedToCreateSettings = directory;
return FakeSettings;
panel.ContextMenu = null;
base.OnRemove();
}
}
}

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

@ -115,12 +115,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -115,12 +115,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
if (Snap(horizontalInput, horizontalMap, Accuracy, out drawLines, out delta)) {
if (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment.Vertical == VerticalAlignment.Top) {
bounds.Y += delta;
bounds.Height = Math.Max(0, bounds.Height - delta);
} else {
bounds.Height = Math.Max(0, bounds.Height + delta);
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Vertical == VerticalAlignment.Top) {
bounds.Y += delta;
}
bounds.Height = Math.Max(0, bounds.Height - delta);
info.Bounds = bounds;
} else {
foreach (var item in operation.PlacedItems) {
@ -138,12 +136,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions @@ -138,12 +136,10 @@ namespace ICSharpCode.WpfDesign.Designer.Extensions
if (Snap(verticalInput, verticalMap, Accuracy, out drawLines, out delta)) {
if (operation.Type == PlacementType.Resize) {
if (info.ResizeThumbAlignment.Horizontal == HorizontalAlignment.Left) {
bounds.X += delta;
bounds.Width = Math.Max(0, bounds.Width - delta);
} else {
bounds.Width = Math.Max(0, bounds.Width + delta);
if (info.ResizeThumbAlignment != null && info.ResizeThumbAlignment.Value.Horizontal == HorizontalAlignment.Left) {
bounds.X += delta;
}
bounds.Width = Math.Max(0, bounds.Width - delta);
info.Bounds = bounds;
} else {
foreach (var item in operation.PlacedItems) {

172
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ModelTools.cs

@ -27,6 +27,7 @@ using System.Windows.Markup; @@ -27,6 +27,7 @@ using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Xps.Serialization;
using ICSharpCode.WpfDesign.Designer.Xaml;
namespace ICSharpCode.WpfDesign.Designer
{
@ -137,7 +138,7 @@ namespace ICSharpCode.WpfDesign.Designer @@ -137,7 +138,7 @@ namespace ICSharpCode.WpfDesign.Designer
catch (Exception)
{ }
}
internal static Size GetDefaultSize(DesignItem createdItem)
{
CreateVisualTree(createdItem.View);
@ -198,5 +199,174 @@ namespace ICSharpCode.WpfDesign.Designer @@ -198,5 +199,174 @@ namespace ICSharpCode.WpfDesign.Designer
item.Properties.GetProperty(FrameworkElement.HeightProperty).SetValue(newHeight);
}
}
private class ItemPos
{
public HorizontalAlignment HorizontalAlignment{ get; set; }
public VerticalAlignment VerticalAlignment{ get; set; }
public double Xmin { get; set; }
public double Xmax { get; set; }
public double Ymin { get; set; }
public double Ymax { get; set; }
public DesignItem DesignItem { get; set; }
}
public static void WrapItemsNewContainer(IEnumerable<DesignItem> items, Type containerType)
{
var collection = items;
var _context = collection.First().Context as XamlDesignContext;
var oldContainer = collection.First().Parent;
if (collection.Any(x => x.Parent != oldContainer))
return;
var newInstance = Activator.CreateInstance(containerType);
DesignItem newPanel = _context.Services.Component.RegisterComponentForDesigner(newInstance);
var changeGroup = newPanel.OpenGroup("Wrap in Container");
List<ItemPos> itemList = new List<ItemPos>();
foreach (var item in collection) {
var itemPos = new ItemPos(){ DesignItem = item };
itemList.Add(itemPos);
if (oldContainer.Component is Canvas) {
var canvas = oldContainer.View as Canvas;
if (item.Properties.GetAttachedProperty(Canvas.RightProperty) != null && item.Properties.GetAttachedProperty(Canvas.RightProperty).IsSet) {
itemPos.HorizontalAlignment = HorizontalAlignment.Right;
itemPos.Xmax = canvas.ActualWidth - (double)item.Properties.GetAttachedProperty(Canvas.RightProperty).ValueOnInstance;
itemPos.Xmin = itemPos.Xmax - ((FrameworkElement)item.View).ActualWidth;
}
else if (item.Properties.GetAttachedProperty(Canvas.LeftProperty) != null && item.Properties.GetAttachedProperty(Canvas.LeftProperty).IsSet) {
itemPos.HorizontalAlignment = HorizontalAlignment.Left;
itemPos.Xmin = (double)item.Properties.GetAttachedProperty(Canvas.LeftProperty).ValueOnInstance;
itemPos.Xmax = itemPos.Xmin + ((FrameworkElement)item.View).ActualWidth;
} else {
itemPos.HorizontalAlignment = HorizontalAlignment.Left;
itemPos.Xmax = itemPos.Xmin + ((FrameworkElement)item.View).ActualWidth;
}
if (item.Properties.GetAttachedProperty(Canvas.BottomProperty) != null && item.Properties.GetAttachedProperty(Canvas.BottomProperty).IsSet) {
itemPos.VerticalAlignment = VerticalAlignment.Bottom;
itemPos.Ymax = canvas.ActualHeight - (double)item.Properties.GetAttachedProperty(Canvas.BottomProperty).ValueOnInstance;
itemPos.Ymin = itemPos.Ymax - ((FrameworkElement)item.View).ActualHeight;
}
else if (item.Properties.GetAttachedProperty(Canvas.TopProperty) != null && item.Properties.GetAttachedProperty(Canvas.TopProperty).IsSet) {
itemPos.VerticalAlignment = VerticalAlignment.Top;
itemPos.Ymin = (double)item.Properties.GetAttachedProperty(Canvas.TopProperty).ValueOnInstance;
itemPos.Ymax = itemPos.Ymin + ((FrameworkElement)item.View).ActualHeight;
} else {
itemPos.VerticalAlignment = VerticalAlignment.Top;
itemPos.Ymax = itemPos.Ymin + ((FrameworkElement)item.View).ActualHeight;
}
item.Properties.GetAttachedProperty(Canvas.RightProperty).Reset();
item.Properties.GetAttachedProperty(Canvas.LeftProperty).Reset();
item.Properties.GetAttachedProperty(Canvas.TopProperty).Reset();
item.Properties.GetAttachedProperty(Canvas.BottomProperty).Reset();
} else if (oldContainer.Component is Grid) {
var grid = oldContainer.View as Grid;
if ((HorizontalAlignment)item.Properties.GetProperty(FrameworkElement.HorizontalAlignmentProperty).ValueOnInstance == HorizontalAlignment.Right) {
itemPos.HorizontalAlignment = HorizontalAlignment.Right;
itemPos.Xmax = grid.ActualWidth - ((Thickness)item.Properties.GetProperty(FrameworkElement.MarginProperty).ValueOnInstance).Right;
itemPos.Xmin = itemPos.Xmax - ((FrameworkElement)item.View).ActualWidth;
} else {
itemPos.HorizontalAlignment = HorizontalAlignment.Left;
itemPos.Xmin = ((Thickness)item.Properties.GetProperty(FrameworkElement.MarginProperty).ValueOnInstance).Left;
itemPos.Xmax = itemPos.Xmin + ((FrameworkElement)item.View).ActualWidth;
}
if ((VerticalAlignment)item.Properties.GetProperty(FrameworkElement.VerticalAlignmentProperty).ValueOnInstance == VerticalAlignment.Bottom) {
itemPos.VerticalAlignment = VerticalAlignment.Bottom;
itemPos.Ymax = grid.ActualHeight - ((Thickness)item.Properties.GetProperty(FrameworkElement.MarginProperty).ValueOnInstance).Bottom;
itemPos.Ymin = itemPos.Ymax - ((FrameworkElement)item.View).ActualHeight;
} else {
itemPos.VerticalAlignment = VerticalAlignment.Top;
itemPos.Ymin = ((Thickness)item.Properties.GetProperty(FrameworkElement.MarginProperty).ValueOnInstance).Top;
itemPos.Ymax = itemPos.Ymin + ((FrameworkElement)item.View).ActualHeight;
}
item.Properties.GetProperty(FrameworkElement.HorizontalAlignmentProperty).Reset();
item.Properties.GetProperty(FrameworkElement.VerticalAlignmentProperty).Reset();
item.Properties.GetProperty(FrameworkElement.MarginProperty).Reset();
}
var parCol = item.ParentProperty.CollectionElements;
parCol.Remove(item);
}
var xmin = itemList.Min(x => x.Xmin);
var xmax = itemList.Max(x => x.Xmax);
var ymin = itemList.Min(x => x.Ymin);
var ymax = itemList.Max(x => x.Ymax);
if (oldContainer.Component is Canvas) {
newPanel.Properties.GetProperty(FrameworkElement.WidthProperty).SetValue(xmax - xmin);
newPanel.Properties.GetProperty(FrameworkElement.HeightProperty).SetValue(ymax - ymin);
newPanel.Properties.GetAttachedProperty(Canvas.LeftProperty).SetValue(xmin);
newPanel.Properties.GetAttachedProperty(Canvas.TopProperty).SetValue(ymin);
} else if (oldContainer.Component is Grid) {
newPanel.Properties.GetProperty(FrameworkElement.HorizontalAlignmentProperty).SetValue(HorizontalAlignment.Left);
newPanel.Properties.GetProperty(FrameworkElement.VerticalAlignmentProperty).SetValue(VerticalAlignment.Top);
newPanel.Properties.GetProperty(FrameworkElement.MarginProperty).SetValue(new Thickness(xmin, ymin, 0, 0));
newPanel.Properties.GetProperty(FrameworkElement.WidthProperty).SetValue(xmax - xmin);
newPanel.Properties.GetProperty(FrameworkElement.HeightProperty).SetValue(ymax - ymin);
}
foreach (var item in itemList) {
newPanel.ContentProperty.CollectionElements.Add(item.DesignItem);
if (newPanel.Component is Canvas) {
if (item.HorizontalAlignment == HorizontalAlignment.Right) {
item.DesignItem.Properties.GetAttachedProperty(Canvas.RightProperty).SetValue(xmax - item.Xmax);
} else {
item.DesignItem.Properties.GetAttachedProperty(Canvas.LeftProperty).SetValue(item.Xmin - xmin);
}
if (item.VerticalAlignment == VerticalAlignment.Bottom) {
item.DesignItem.Properties.GetAttachedProperty(Canvas.BottomProperty).SetValue(ymax - item.Ymax);
} else {
item.DesignItem.Properties.GetAttachedProperty(Canvas.TopProperty).SetValue(item.Ymin - ymin);
}
} else if (newPanel.Component is Grid) {
Thickness thickness = new Thickness(0);
if (item.HorizontalAlignment == HorizontalAlignment.Right) {
item.DesignItem.Properties.GetProperty(FrameworkElement.HorizontalAlignmentProperty).SetValue(HorizontalAlignment.Right);
thickness.Right = xmax - item.Xmax;
} else {
item.DesignItem.Properties.GetProperty(FrameworkElement.HorizontalAlignmentProperty).SetValue(HorizontalAlignment.Left);
thickness.Left = item.Xmin - xmin;
}
if (item.VerticalAlignment == VerticalAlignment.Bottom) {
item.DesignItem.Properties.GetProperty(FrameworkElement.VerticalAlignmentProperty).SetValue(VerticalAlignment.Bottom);
thickness.Bottom = ymax - item.Ymax;
} else {
item.DesignItem.Properties.GetProperty(FrameworkElement.VerticalAlignmentProperty).SetValue(VerticalAlignment.Top);
thickness.Top = item.Ymin - ymin;
}
item.DesignItem.Properties.GetProperty(FrameworkElement.MarginProperty).SetValue(thickness);
}
}
oldContainer.ContentProperty.CollectionElements.Add(newPanel);
changeGroup.Commit();
_context.Services.Selection.SetSelectedComponents(new []{ newPanel });
}
}
}

18
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Translations.cs

@ -65,5 +65,23 @@ namespace ICSharpCode.WpfDesign.Designer @@ -65,5 +65,23 @@ namespace ICSharpCode.WpfDesign.Designer
return "Press \"Alt\" to Enter Container";
}
}
public virtual string WrapInCanvas {
get {
return "Wrap in Canvas";
}
}
public virtual string WrapInGrid {
get {
return "Wrap in Grid";
}
}
public virtual string WrapInBorder {
get {
return "Wrap in Border";
}
}
}
}

5
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj

@ -91,6 +91,10 @@ @@ -91,6 +91,10 @@
<Compile Include="Extensions\RenderTransformOriginExtension.cs" />
<Compile Include="Extensions\RightClickContextMenuExtension.cs" />
<Compile Include="OutlineView\OutlineNodeBase.cs" />
<Compile Include="Extensions\RightClickMultipleItemsContextMenuExtension.cs" />
<Compile Include="Extensions\RightClickMultipleItemsContextMenu.xaml.cs">
<DependentUpon>RightClickMultipleItemsContextMenu.xaml</DependentUpon>
</Compile>
<Compile Include="Extensions\SkewThumbExtension.cs" />
<Compile Include="Extensions\TopLeftContainerDragHandleMultipleItems.cs" />
<Compile Include="PropertyGrid\Editors\ColorEditor.xaml.cs">
@ -264,6 +268,7 @@ @@ -264,6 +268,7 @@
</ItemGroup>
<ItemGroup>
<Page Include="Extensions\RightClickContextMenu.xaml" />
<Page Include="Extensions\RightClickMultipleItemsContextMenu.xaml" />
<Page Include="PropertyGrid\Editors\ColorEditor.xaml" />
<Page Include="PropertyGrid\Editors\FlatCollectionEditor.xaml" />
<Page Include="PropertyGrid\Editors\OpenCollectionEditor.xaml" />

51
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Tests/XamlDom/MarkupExtensionTests.cs

@ -27,6 +27,10 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom @@ -27,6 +27,10 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom
[TestFixture]
public class MarkupExtensionTests : TestHelper
{
private const string PathWithSpaces = @"C:\\Folder A\\SubFolder A\\SubFolder B\\file with spaces.txt";
private const string PathWithoutSpaces = @"C:\\FolderA\\SubFolderA\\SubFolderB\\file.txt";
private const string PathWithCommasAndSpaces = @"C:\\Folder A\\Sub,Folder,A\\SubFolderB\\file,with,commas and spaces.txt";
[Test]
public void Test1()
{
@ -84,6 +88,36 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom @@ -84,6 +88,36 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
TestMarkupExtension("Content=\"{x:Static t:MyStaticClass.StaticString}\"");
}
[Test]
public void TestPathWithSpaces()
{
TestMarkupExtension("Content=\"{t:String " + PathWithSpaces + "}\"");
}
[Test]
public void TestQuotedPathWithSpaces()
{
TestMarkupExtension("Content=\"{t:String '" + PathWithSpaces + "'}\"");
}
[Test]
public void TestPathWithoutSpaces()
{
TestMarkupExtension("Content=\"{t:String " + PathWithoutSpaces + "}\"");
}
[Test]
public void TestQuotedPathWithoutSpaces()
{
TestMarkupExtension("Content=\"{t:String '" + PathWithoutSpaces + "'}\"");
}
[Test]
public void TestQuotedPathWithCommasAndSpaces()
{
TestMarkupExtension("Content=\"{t:String '" + PathWithCommasAndSpaces + "'}\"");
}
// [Test]
// public void Test10()
@ -114,6 +148,23 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom @@ -114,6 +148,23 @@ namespace ICSharpCode.WpfDesign.Tests.XamlDom
{
public static string StaticString = "a";
}
public class StringExtension : MarkupExtension
{
readonly string s;
public StringExtension(string s)
{
TestHelperLog.Log(this.GetType().Name + " " + s);
this.s = s;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return s;
}
}
public class MyExtension : MarkupExtension
{

9
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.XamlDom/Project/MarkupExtensionParser.cs

@ -96,10 +96,17 @@ namespace ICSharpCode.WpfDesign.XamlDom @@ -96,10 +96,17 @@ namespace ICSharpCode.WpfDesign.XamlDom
if (text[pos] == '"' || text[pos] == '\'') {
char quote = text[pos++];
CheckNotEOF();
int lastBackslashPos = -1;
while (!(text[pos] == quote && text[pos-1] != '\\')) {
int current = pos;
char c = text[pos++];
if (c != '\\')
//check if string is \\ and that the last backslash is not the previously saved char, ie that \\\\ does not become \\\ but just \\
bool isEscapedBackslash = string.Concat(text[current-1],c)=="\\\\" && current-1 != lastBackslashPos;
if (c != '\\' || isEscapedBackslash){
b.Append(c);
if(isEscapedBackslash)
lastBackslashPos = current;
}
CheckNotEOF();
}
pos++; // consume closing quote

30
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Extensions/SelectionExtensionServer.cs

@ -118,7 +118,7 @@ namespace ICSharpCode.WpfDesign.Extensions @@ -118,7 +118,7 @@ namespace ICSharpCode.WpfDesign.Extensions
void OnSelectionChanged(object sender, EventArgs e)
{
ReapplyExtensions(this.Services.Selection.SelectedItems);
ReapplyExtensions(this.Services.Selection.SelectedItems);
}
/// <summary>
@ -130,6 +130,34 @@ namespace ICSharpCode.WpfDesign.Extensions @@ -130,6 +130,34 @@ namespace ICSharpCode.WpfDesign.Extensions
}
}
/// <summary>
/// Applies an extension only when multiple Items are selected!
/// </summary>
public class MultipleSelectedExtensionServer : DefaultExtensionServer
{
/// <summary>
/// Is called after the extension server is initialized and the Context property has been set.
/// </summary>
protected override void OnInitialized()
{
base.OnInitialized();
this.Services.Selection.SelectionChanged += OnSelectionChanged;
}
void OnSelectionChanged(object sender, EventArgs e)
{
ReapplyExtensions(this.Services.Selection.SelectedItems);
}
/// <summary>
/// Gets if the item is in the secondary selection.
/// </summary>
public override bool ShouldApplyExtensions(DesignItem extendedItem)
{
return Services.Selection.SelectionCount > 1;
}
}
/// <summary>
/// Applies an extension to the primary selection if Only One Item is Selected.
/// </summary>

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

@ -75,7 +75,7 @@ namespace ICSharpCode.WpfDesign @@ -75,7 +75,7 @@ namespace ICSharpCode.WpfDesign
/// <summary>
/// Gets/sets the alignment of the resize thumb used to start the operation.
/// </summary>
public PlacementAlignment ResizeThumbAlignment { get; set; }
public PlacementAlignment? ResizeThumbAlignment { get; set; }
/// <inheritdoc/>
public override string ToString()

50
src/AddIns/DisplayBindings/WpfDesign/WpfDesign/Project/Services.cs

@ -233,33 +233,33 @@ namespace ICSharpCode.WpfDesign @@ -233,33 +233,33 @@ namespace ICSharpCode.WpfDesign
#region IKeyBindingService
/// <summary>
/// Service that handles all the key bindings in the designer.
/// </summary>
public interface IKeyBindingService
{
/// <summary>
/// Gets the object to which the bindings are being applied
/// </summary>
object Owner { get; }
/// Service that handles all the key bindings in the designer.
/// </summary>
public interface IKeyBindingService
{
/// <summary>
/// Gets the object to which the bindings are being applied
/// </summary>
object Owner { get; }
/// <summary>
/// Register <paramref name="binding"/> with <see cref="Owner"/>.
/// </summary>
/// <param name="binding">The binding to be applied.</param>
void RegisterBinding(KeyBinding binding);
/// <summary>
/// Register <paramref name="binding"/> with <see cref="Owner"/>.
/// </summary>
/// <param name="binding">The binding to be applied.</param>
void RegisterBinding(KeyBinding binding);
/// <summary>
/// De-register <paramref name="binding"/> with <see cref="Owner"/>.
/// </summary>
/// <param name="binding">The binding to be applied.</param>
void DeregisterBinding(KeyBinding binding);
/// <summary>
/// De-register <paramref name="binding"/> with <see cref="Owner"/>.
/// </summary>
/// <param name="binding">The binding to be applied.</param>
void DeregisterBinding(KeyBinding binding);
/// <summary>
/// Gets binding for the corresponding gesture otherwise returns null.
/// </summary>
/// <param name="gesture">The keyboard gesture requested.</param>
KeyBinding GetBinding(KeyGesture gesture);
}
/// <summary>
/// Gets binding for the corresponding gesture otherwise returns null.
/// </summary>
/// <param name="gesture">The keyboard gesture requested.</param>
KeyBinding GetBinding(KeyGesture gesture);
}
#endregion
}

4
src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj

@ -154,6 +154,7 @@ @@ -154,6 +154,7 @@
<Compile Include="Src\InstalledPackagesViewModel.cs" />
<Compile Include="Src\IPackageRepositoryFactoryEvents.cs" />
<Compile Include="Src\IPackageViewModelParent.cs" />
<Compile Include="Src\ISettingsProvider.cs" />
<Compile Include="Src\IUpdatePackagesAction.cs" />
<Compile Include="Src\IPackageExtensions.cs" />
<Compile Include="Src\IPackageAction.cs" />
@ -219,7 +220,6 @@ @@ -219,7 +220,6 @@
<Compile Include="Src\IPackageReferenceInstaller.cs" />
<Compile Include="Src\IPackageReferencesForProject.cs" />
<Compile Include="Src\IPropertyService.cs" />
<Compile Include="Src\ISettingsFactory.cs" />
<Compile Include="Src\IThreadSafePackageManagementEvents.cs" />
<Compile Include="Src\ManagePackagesUserPrompts.cs" />
<Compile Include="Src\ManagePackagesViewTitle.cs" />
@ -252,6 +252,7 @@ @@ -252,6 +252,7 @@
<Compile Include="Src\Scripting\NullGlobalMSBuildProjectCollection.cs" />
<Compile Include="Src\Scripting\RunAllProjectPackageScriptsAction.cs" />
<Compile Include="Src\ServiceWithWorkbenchOwner.cs" />
<Compile Include="Src\SettingsProvider.cs" />
<Compile Include="Src\SharpDevelopCredentialProvider.cs" />
<Compile Include="Src\SharpDevelopHttpUserAgent.cs" />
<Compile Include="Src\ThreadSafeCodeGenerator.cs" />
@ -400,7 +401,6 @@ @@ -400,7 +401,6 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\SelectProjectsViewModel.cs" />
<Compile Include="Src\SettingsFactory.cs" />
<Compile Include="Src\SolutionPackageRepositoryFactory.cs" />
<Compile Include="Src\SolutionPackageRepositoryPath.cs" />
<Compile Include="Src\PackageSourceConverter.cs" />

1
src/AddIns/Misc/PackageManagement/Project/Src/Design/FakePackageManagementProjectService.cs

@ -43,6 +43,7 @@ namespace ICSharpCode.PackageManagement.Design @@ -43,6 +43,7 @@ namespace ICSharpCode.PackageManagement.Design
public void FireSolutionClosedEvent(ISolution solution)
{
OpenSolution = null;
if (SolutionClosed != null) {
SolutionClosed(this, new SolutionEventArgs(solution));
}

28
src/AddIns/Misc/PackageManagement/Project/Src/ISettingsFactory.cs

@ -1,28 +0,0 @@ @@ -1,28 +0,0 @@
// 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 NuGet;
namespace ICSharpCode.PackageManagement
{
public interface ISettingsFactory
{
ISettings CreateSettings(string directory);
}
}

14
src/AddIns/Misc/PackageManagement/Project/Src/ISettingsProvider.cs

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using NuGet;
namespace ICSharpCode.PackageManagement
{
public interface ISettingsProvider
{
event EventHandler SettingsChanged;
ISettings LoadSettings();
}
}

10
src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementOptions.cs

@ -35,15 +35,17 @@ namespace ICSharpCode.PackageManagement @@ -35,15 +35,17 @@ namespace ICSharpCode.PackageManagement
ObservableCollection<RecentPackageInfo> recentPackages;
PackageRestoreConsent packageRestoreConsent;
public PackageManagementOptions(Properties properties, ISettings settings)
public PackageManagementOptions(
Properties properties,
ISettingsProvider settingsProvider)
{
this.properties = properties;
registeredPackageSourceSettings = new RegisteredPackageSourceSettings(settings);
packageRestoreConsent = new PackageRestoreConsent(settings);
registeredPackageSourceSettings = new RegisteredPackageSourceSettings(settingsProvider);
packageRestoreConsent = new PackageRestoreConsent(settingsProvider.LoadSettings());
}
public PackageManagementOptions(Properties properties)
: this(properties, Settings.LoadDefaultSettings(null, null, null))
: this(properties, new SettingsProvider())
{
}

36
src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs

@ -21,6 +21,7 @@ using System.Collections.Generic; @@ -21,6 +21,7 @@ using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using ICSharpCode.SharpDevelop.Project;
using NuGet;
namespace ICSharpCode.PackageManagement
@ -35,20 +36,32 @@ namespace ICSharpCode.PackageManagement @@ -35,20 +36,32 @@ namespace ICSharpCode.PackageManagement
new PackageSource("(Aggregate source)", "All");
ISettings settings;
ISettingsProvider settingsProvider;
PackageSource defaultPackageSource;
RegisteredPackageSources packageSources;
PackageSource activePackageSource;
public RegisteredPackageSourceSettings(ISettings settings)
: this(settings, RegisteredPackageSources.DefaultPackageSource)
public RegisteredPackageSourceSettings(ISettingsProvider settingsProvider)
: this(settingsProvider, RegisteredPackageSources.DefaultPackageSource)
{
}
public RegisteredPackageSourceSettings(ISettings settings, PackageSource defaultPackageSource)
public RegisteredPackageSourceSettings(
ISettingsProvider settingsProvider,
PackageSource defaultPackageSource)
{
this.settings = settings;
this.settingsProvider = settingsProvider;
this.defaultPackageSource = defaultPackageSource;
settings = settingsProvider.LoadSettings();
ReadActivePackageSource();
RegisterSolutionEvents();
}
void RegisterSolutionEvents()
{
settingsProvider.SettingsChanged += SettingsChanged;
}
void ReadActivePackageSource()
@ -176,5 +189,20 @@ namespace ICSharpCode.PackageManagement @@ -176,5 +189,20 @@ namespace ICSharpCode.PackageManagement
{
settings.SetValue(ActivePackageSourceSectionName, activePackageSource.Key, activePackageSource.Value);
}
void SettingsChanged(object sender, EventArgs e)
{
settings = settingsProvider.LoadSettings();
ReadActivePackageSource();
ResetPackageSources();
}
void ResetPackageSources()
{
if (packageSources != null) {
packageSources.CollectionChanged -= PackageSourcesChanged;
packageSources = null;
}
}
}
}

62
src/AddIns/Misc/PackageManagement/Project/Src/SettingsProvider.cs

@ -0,0 +1,62 @@ @@ -0,0 +1,62 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.IO;
using ICSharpCode.SharpDevelop.Project;
using NuGet;
namespace ICSharpCode.PackageManagement
{
public class SettingsProvider : ISettingsProvider
{
public static Func<IFileSystem, string, IMachineWideSettings, ISettings> LoadDefaultSettings
= Settings.LoadDefaultSettings;
IPackageManagementProjectService projectService;
public SettingsProvider()
: this(PackageManagementServices.ProjectService)
{
}
public SettingsProvider(IPackageManagementProjectService projectService)
{
this.projectService = projectService;
projectService.SolutionOpened += OnSettingsChanged;
projectService.SolutionClosed += OnSettingsChanged;
}
public event EventHandler SettingsChanged;
void OnSettingsChanged(object sender, SolutionEventArgs e)
{
if (SettingsChanged != null) {
SettingsChanged(this, new EventArgs());
}
}
public ISettings LoadSettings()
{
return LoadSettings(GetSolutionDirectory());
}
string GetSolutionDirectory()
{
ISolution solution = projectService.OpenSolution;
if (solution != null) {
return solution.Directory;
}
return null;
}
ISettings LoadSettings(string directory)
{
if (directory == null) {
return LoadDefaultSettings(null, null, null);
}
return LoadDefaultSettings(new PhysicalFileSystem(directory), null, null);
}
}
}

2
src/AddIns/Misc/PackageManagement/Test/PackageManagement.Tests.csproj

@ -176,7 +176,6 @@ @@ -176,7 +176,6 @@
<Compile Include="Src\Helpers\FakePowerShellDetection.cs" />
<Compile Include="Src\Helpers\FakePowerShellSession.cs" />
<Compile Include="Src\Helpers\FakePropertyService.cs" />
<Compile Include="Src\Helpers\FakeSettingsFactory.cs" />
<Compile Include="Src\Helpers\FakeSolutionPackageRepository.cs" />
<Compile Include="Src\Helpers\FakeTextEditorOptions.cs" />
<Compile Include="Src\Helpers\ProjectItemCollectionAssert.cs" />
@ -195,6 +194,7 @@ @@ -195,6 +194,7 @@
<Compile Include="Src\Scripting\ConsoleHostFileConflictResolverTests.cs" />
<Compile Include="Src\Scripting\MSBuildProjectImportsMergerTests.cs" />
<Compile Include="Src\Scripting\MSBuildProjectPropertiesMergerTests.cs" />
<Compile Include="Src\SettingsProviderTests.cs" />
<Compile Include="Src\UpdatedPackagesTests.cs" />
<Compile Include="Src\UpdatePackagesActionTests.cs" />
<Compile Include="Src\UpdateSolutionPackagesActionTests.cs" />

22
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/TestablePackageManagementOptions.cs

@ -29,15 +29,31 @@ namespace PackageManagement.Tests.Helpers @@ -29,15 +29,31 @@ namespace PackageManagement.Tests.Helpers
public FakeSettings FakeSettings;
public TestablePackageManagementOptions()
: this(new Properties(), new FakeSettings())
: this(new Properties(), new FakeSettings(), new FakePackageManagementProjectService())
{
}
public TestablePackageManagementOptions(Properties properties, FakeSettings fakeSettings)
: base(properties, fakeSettings)
public TestablePackageManagementOptions(
Properties properties,
FakeSettings fakeSettings,
FakePackageManagementProjectService projectService)
: base(properties, CreateSettingsProvider(fakeSettings, projectService))
{
this.Properties = properties;
this.FakeSettings = fakeSettings;
}
public static void ChangeSettingsReturnedBySettingsProvider(FakeSettings settings)
{
SettingsProvider.LoadDefaultSettings = (fileSystem, configFile, machineSettings) => {
return settings;
};
}
public static SettingsProvider CreateSettingsProvider(FakeSettings fakeSettings, FakePackageManagementProjectService projectService)
{
ChangeSettingsReturnedBySettingsProvider(fakeSettings);
return new SettingsProvider(projectService);
}
}
}

115
src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsTests.cs

@ -36,6 +36,8 @@ namespace PackageManagement.Tests @@ -36,6 +36,8 @@ namespace PackageManagement.Tests
Properties properties;
PackageManagementOptions options;
FakeSettings fakeSettings;
SettingsProvider settingsProvider;
FakePackageManagementProjectService projectService;
void CreateOptions()
{
@ -63,12 +65,26 @@ namespace PackageManagement.Tests @@ -63,12 +65,26 @@ namespace PackageManagement.Tests
void CreateOptions(FakeSettings fakeSettings)
{
CreateProperties();
options = new PackageManagementOptions(properties, fakeSettings);
CreateSettingsProvider(fakeSettings);
options = new PackageManagementOptions(properties, settingsProvider);
}
void CreateSettingsProvider(FakeSettings fakeSettings)
{
projectService = new FakePackageManagementProjectService();
settingsProvider = TestablePackageManagementOptions.CreateSettingsProvider(fakeSettings, projectService);
}
void ChangeSettingsReturnedBySettingsProvider()
{
fakeSettings = new FakeSettings();
TestablePackageManagementOptions.ChangeSettingsReturnedBySettingsProvider(fakeSettings);
}
void CreateOptions(Properties properties, FakeSettings fakeSettings)
{
options = new PackageManagementOptions(properties, fakeSettings);
CreateSettingsProvider(fakeSettings);
options = new PackageManagementOptions(properties, settingsProvider);
}
void SaveOptions()
@ -88,6 +104,18 @@ namespace PackageManagement.Tests @@ -88,6 +104,18 @@ namespace PackageManagement.Tests
fakeSettings.SetPackageRestoreSetting(true);
}
void OpenSolution()
{
var helper = new SolutionHelper(@"d:\projects\MyProject\MySolution.sln");
projectService.FireSolutionOpenedEvent(helper.MSBuildSolution);
}
void CloseSolution()
{
var helper = new SolutionHelper(@"d:\projects\MyProject\MySolution.sln");
projectService.FireSolutionClosedEvent(helper.MSBuildSolution);
}
[Test]
public void PackageSources_OnePackageSourceInSettings_ContainsSinglePackageSourceFromSettings()
{
@ -465,5 +493,88 @@ namespace PackageManagement.Tests @@ -465,5 +493,88 @@ namespace PackageManagement.Tests
KeyValuePair<string, string> keyValuePair = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection();
Assert.AreEqual("False", keyValuePair.Value);
}
[Test]
public void PackageSources_SolutionOpenedAfterInitialPackageSourcesLoaded_ContainsPackageSourceFromSolutionSpecificSettings()
{
CreateSettings();
var packageSource = new PackageSource("http://codeplex.com", "Test");
fakeSettings.AddFakePackageSource(packageSource);
CreateOptions(fakeSettings);
RegisteredPackageSources initialSources = options.PackageSources;
var expectedInitialSources = new List<PackageSource>();
expectedInitialSources.Add(packageSource);
ChangeSettingsReturnedBySettingsProvider();
packageSource = new PackageSource("http://codeplex.com", "Test");
fakeSettings.AddFakePackageSource(packageSource);
var expectedSources = new List<PackageSource>();
expectedSources.Add(packageSource);
packageSource = new PackageSource("http://nuget.org", "ProjectSource");
fakeSettings.AddFakePackageSource(packageSource);
expectedSources.Add(packageSource);
OpenSolution();
RegisteredPackageSources actualSources = options.PackageSources;
Assert.AreEqual(expectedInitialSources, initialSources);
Assert.AreEqual(expectedSources, actualSources);
}
[Test]
public void PackageSources_SolutionClosedAfterInitialPackageSourcesLoaded_PackageSourcesReloaded()
{
CreateSettings();
var packageSource = new PackageSource("http://codeplex.com", "Test");
fakeSettings.AddFakePackageSource(packageSource);
var expectedInitialSources = new List<PackageSource>();
expectedInitialSources.Add(packageSource);
packageSource = new PackageSource("http://nuget.org", "ProjectSource");
fakeSettings.AddFakePackageSource(packageSource);
expectedInitialSources.Add(packageSource);
OpenSolution();
CreateOptions(fakeSettings);
RegisteredPackageSources initialSources = options.PackageSources;
ChangeSettingsReturnedBySettingsProvider();
packageSource = new PackageSource("http://codeplex.com", "Test");
fakeSettings.AddFakePackageSource(packageSource);
var expectedSources = new List<PackageSource>();
expectedSources.Add(packageSource);
CloseSolution();
RegisteredPackageSources actualSources = options.PackageSources;
Assert.AreEqual(expectedInitialSources, initialSources);
Assert.AreEqual(expectedSources, actualSources);
}
[Test]
public void PackageSources_SolutionClosedAfterInitialPackageSourcesLoaded_ActivePackageSourceReloaded()
{
CreateSettings();
var packageSource = new PackageSource("http://codeplex.com", "Test");
fakeSettings.AddFakePackageSource(packageSource);
var expectedInitialSources = new List<PackageSource>();
expectedInitialSources.Add(packageSource);
var initialActivePackageSource = new PackageSource("http://nuget.org", "ProjectSource");
fakeSettings.AddFakePackageSource(initialActivePackageSource);
fakeSettings.SetFakeActivePackageSource(initialActivePackageSource);
expectedInitialSources.Add(initialActivePackageSource);
OpenSolution();
CreateOptions(fakeSettings);
RegisteredPackageSources actualInitialPackageSources = options.PackageSources;
PackageSource actualInitialActivePackageSource = options.ActivePackageSource;
ChangeSettingsReturnedBySettingsProvider();
var expectedActivePackageSource = new PackageSource("http://codeplex.com", "Test");
fakeSettings.SetFakeActivePackageSource(expectedActivePackageSource);
fakeSettings.AddFakePackageSource(expectedActivePackageSource);
CloseSolution();
PackageSource actualSource = options.ActivePackageSource;
Assert.AreEqual(initialActivePackageSource, actualInitialActivePackageSource);
Assert.AreEqual(expectedActivePackageSource, actualSource);
Assert.AreEqual(expectedInitialSources, actualInitialPackageSources);
Assert.AreEqual(new PackageSource[] { expectedActivePackageSource }, options.PackageSources);
}
}
}

4
src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsViewModelTests.cs

@ -50,8 +50,10 @@ namespace PackageManagement.Tests @@ -50,8 +50,10 @@ namespace PackageManagement.Tests
void CreateOptions()
{
var properties = new Properties();
var projectService = new FakePackageManagementProjectService();
fakeSettings = new FakeSettings();
options = new PackageManagementOptions(properties, fakeSettings);
SettingsProvider settingsProvider = TestablePackageManagementOptions.CreateSettingsProvider(fakeSettings, projectService);
options = new PackageManagementOptions(properties, settingsProvider);
}
void EnablePackageRestoreInOptions()

80
src/AddIns/Misc/PackageManagement/Test/Src/SettingsProviderTests.cs

@ -0,0 +1,80 @@ @@ -0,0 +1,80 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.PackageManagement;
using ICSharpCode.PackageManagement.Design;
using NuGet;
using NUnit.Framework;
using PackageManagement.Tests.Helpers;
namespace PackageManagement.Tests
{
[TestFixture]
public class SettingsProviderTests
{
SettingsProvider settingsProvider;
FakeSettings fakeSettings;
FakePackageManagementProjectService projectService;
IFileSystem fileSystemUsedToLoadSettings;
string configFileUsedToLoadSettings;
IMachineWideSettings machinesettingsUsedToLoadSettings;
[SetUp]
public void SetUp()
{
fakeSettings = new FakeSettings();
projectService = new FakePackageManagementProjectService();
SettingsProvider.LoadDefaultSettings = LoadDefaultSettings;
settingsProvider = new SettingsProvider(projectService);
}
ISettings LoadDefaultSettings(IFileSystem fileSystem, string configFile, IMachineWideSettings machineSettings)
{
fileSystemUsedToLoadSettings = fileSystem;
configFileUsedToLoadSettings = configFile;
machinesettingsUsedToLoadSettings = machineSettings;
return fakeSettings;
}
void OpenSolution(string fileName)
{
var helper = new SolutionHelper(fileName);
projectService.OpenSolution = helper.MSBuildSolution;
}
[TearDown]
public void TearDown()
{
// This resets SettingsProvider.LoadDefaultSettings.
TestablePackageManagementOptions.CreateSettingsProvider(fakeSettings, projectService);
}
[Test]
public void LoadSettings_NoSolutionOpen_NullFileSystemAndNullConfigFileAndNullMachineSettingsUsed()
{
fileSystemUsedToLoadSettings = new FakeFileSystem();
configFileUsedToLoadSettings = "configFile";
ISettings settings = settingsProvider.LoadSettings();
Assert.IsNull(fileSystemUsedToLoadSettings);
Assert.IsNull(configFileUsedToLoadSettings);
Assert.IsNull(machinesettingsUsedToLoadSettings);
Assert.AreEqual(fakeSettings, settings);
}
[Test]
public void LoadSettings_SolutionOpen_FileSystemWithRootSetToSolutionDirectoryUsedToLoadSettings()
{
string fileName = @"d:\projects\MyProject\MyProject.sln";
OpenSolution(fileName);
ISettings settings = settingsProvider.LoadSettings();
Assert.AreEqual(@"d:\projects\MyProject", fileSystemUsedToLoadSettings.Root);
Assert.AreEqual(fakeSettings, settings);
}
}
}

15
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj

@ -61,6 +61,7 @@ @@ -61,6 +61,7 @@
</Reference>
<Reference Include="System.Design" />
<Reference Include="System.Drawing" />
<Reference Include="System.Drawing.Design" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
@ -83,6 +84,7 @@ @@ -83,6 +84,7 @@
<Folder Include="src\DesignableItems" />
<Folder Include="src\Factory" />
<Folder Include="src\Dialogs" />
<Folder Include="src\New Folder" />
<Folder Include="src\Wizard" />
<Folder Include="src\Toolbox" />
<Folder Include="src\TypeProvider" />
@ -124,6 +126,14 @@ @@ -124,6 +126,14 @@
<Compile Include="src\Designer\SectionDesigner.cs" />
<Compile Include="src\Designer\TextItemDesigner.cs" />
<Compile Include="src\Dialogs\DataTypeStringConverter.cs" />
<Compile Include="src\Dialogs\DefaultTextEditor.cs" />
<Compile Include="src\Dialogs\EditorDialog.cs" />
<Compile Include="src\Dialogs\EditorDialog.Designer.cs">
<DependentUpon>EditorDialog.cs</DependentUpon>
</Compile>
<Compile Include="src\Dialogs\ExpressionEditor.cs" />
<Compile Include="src\Dialogs\FormatStringConverter.cs" />
<Compile Include="src\Dialogs\IStringBasedEditorDialog.cs" />
<Compile Include="src\Factory\CreateFormSheetFromModel.cs" />
<Compile Include="src\Globals\DesignerGlobals.cs" />
<Compile Include="src\Globals\GlobalLists.cs" />
@ -192,5 +202,10 @@ @@ -192,5 +202,10 @@
<Name>ICSharpCode.Reporting</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="src\Dialogs\EditorDialog.resx">
<DependentUpon>EditorDialog.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

65
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseTextItem.cs

@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using ICSharpCode.Reporting.BaseClasses;
using ICSharpCode.Reporting.Globals;
using ICSharpCode.Reporting.Addin.Designer;
@ -32,8 +33,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -32,8 +33,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
ContentAlignment contentAlignment;
public BaseTextItem():base()
{
public BaseTextItem(){
DefaultSize = GlobalValues.PreferedSize;
Size = GlobalValues.PreferedSize;
BackColor = Color.White;
@ -42,11 +42,10 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -42,11 +42,10 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
}
[EditorBrowsableAttribute()]
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
// [EditorBrowsableAttribute()]
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e){
base.OnPaint(e);
this.Draw(e.Graphics);
Draw(e.Graphics);
}
@ -74,24 +73,23 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -74,24 +73,23 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
// [EditorAttribute(typeof(DefaultTextEditor),
// typeof(System.Drawing.Design.UITypeEditor) )]
[EditorAttribute(typeof(DefaultTextEditor),
typeof(UITypeEditor) )]
public override string Text {
get { return base.Text; }
set { base.Text = value;
this.Invalidate();
Invalidate();
}
}
#region Format and alignment
// [Browsable(true),
// Category("Appearance"),
// Description("String to format Number's Date's etc")]
// [DefaultValue("entry1")]
// [TypeConverter(typeof(FormatStringConverter))]
[Browsable(true),
Category("Appearance"),
Description("String to format Number's Date's etc")]
[DefaultValue("entry1")]
[TypeConverter(typeof(FormatStringConverter))]
public string FormatString {
get { return formatString; }
set {
@ -122,9 +120,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -122,9 +120,9 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
// [Category("Appearance")]
// [EditorAttribute(typeof(ContentAlignmentEditor),
// typeof(UITypeEditor) )]
[Category("Appearance")]
[EditorAttribute(typeof(ContentAlignmentEditor),
typeof(UITypeEditor) )]
public ContentAlignment ContentAlignment {
get { return contentAlignment; }
set {
@ -136,16 +134,16 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -136,16 +134,16 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
#endregion
#region RighToLeft
[Category("Appearance")]
public System.Windows.Forms.RightToLeft RTL
{
get { return base.RightToLeft; }
set { base.RightToLeft = value; }
}
#endregion
// #region RighToLeft
//
// [Category("Appearance")]
// public System.Windows.Forms.RightToLeft RTL
// {
// get { return base.RightToLeft; }
// set { base.RightToLeft = value; }
// }
//
// #endregion
#region DataType
@ -153,18 +151,17 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -153,18 +151,17 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
[Category("Databinding"),Description(datatypeOfTheUnderlyingColumn)]
[DefaultValue("System.String")]
[TypeConverter(typeof(DataTypeStringConverter))]
public string DataType {get;set;}
#endregion
#region Expression
// [Browsable(true),
// Category("Expression"),
// Description("Enter a valid Expression")]
// [EditorAttribute(typeof(DefaultTextEditor),
// typeof(System.Drawing.Design.UITypeEditor) )]
[Browsable(true),
Category("Expression"),
Description("Enter a valid Expression")]
[EditorAttribute(typeof(ExpressionEditor),
typeof(UITypeEditor) )]
public string Expression {get;set;}
#endregion

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/TextItemDesigner.cs

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections;
using ICSharpCode.Reporting.Addin.TypeProvider;
@ -19,8 +20,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -19,8 +20,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
{
protected override void PostFilterProperties(System.Collections.IDictionary properties)
{
protected override void PostFilterProperties(IDictionary properties){
TypeProviderHelper.RemoveProperties(properties);
base.PostFilterProperties(properties);
}

12
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/DataTypeStringConverter.cs

@ -17,26 +17,20 @@ namespace ICSharpCode.Reporting.Addin.Dialogs @@ -17,26 +17,20 @@ namespace ICSharpCode.Reporting.Addin.Dialogs
/// </summary>
class DataTypeStringConverter:StringConverter
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext context)
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext context){
//true means show a combobox
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context)
{
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context){
//true will limit to list. false will show the list, but allow free-form entry
return true;
}
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context)
{
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context){
return new StandardValuesCollection(GlobalLists.DataTypeList());
}
}
}

43
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/DefaultTextEditor.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 11.05.2014
* Time: 18:06
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms;
using ICSharpCode.Reports.Core.Dialogs;
namespace ICSharpCode.Reporting.Addin.Dialogs
{
/// <summary>
/// Description of DefaultTextEditor.
/// </summary>
public class DefaultTextEditor:UITypeEditor
{
const string textEditor = "TextEditor";
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
string s = String.Empty;;
if (value != null) {
s = value.ToString();
}
IStringBasedEditorDialog ed = new TextEditorDialog(s, textEditor);
return ed.ShowDialog() == DialogResult.OK ? ed.TextValue : s;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
}
}

94
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/EditorDialog.Designer.cs generated

@ -0,0 +1,94 @@ @@ -0,0 +1,94 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
namespace ICSharpCode.Reports.Core.Dialogs
{
partial class TextEditorDialog
{
/// <summary>
/// Designer variable used to keep track of non-visual components.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Disposes resources used by the form.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing) {
if (components != null) {
components.Dispose();
}
}
base.Dispose(disposing);
}
/// <summary>
/// This method is required for Windows Forms designer support.
/// Do not change the method contents inside the source code editor. The Forms designer might
/// not be able to load this method if it was changed manually.
/// </summary>
private void InitializeComponent()
{
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// okButton
//
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.Location = new System.Drawing.Point(152, 234);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(55, 22);
this.okButton.TabIndex = 1;
this.okButton.Text = "Ok";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.OkButtonClick);
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(248, 234);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(55, 22);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
//
// textBox1
//
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(20, 33);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(283, 172);
this.textBox1.TabIndex = 3;
//
// TextEditorDialog
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(327, 281);
this.ControlBox = false;
this.Controls.Add(this.textBox1);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Name = "TextEditorDialog";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "TextEditor";
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
}
}

49
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/EditorDialog.cs

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Windows.Forms;
using ICSharpCode.Reporting.Addin.Dialogs;
namespace ICSharpCode.Reports.Core.Dialogs
{
/// <summary>
/// Description of EditorDialog.
/// </summary>
///
public partial class TextEditorDialog : Form,IStringBasedEditorDialog
{
string textValue;
private TextEditorDialog()
{
InitializeComponent();
}
public TextEditorDialog(string text,string header):this()
{
this.textValue = text;
this.textBox1.Text = this.textValue;
this.Text = String.IsNullOrEmpty(header) ? this.Name : header;
}
public string TextValue {
get {
return textValue.Trim();
}
}
void OkButtonClick(object sender, EventArgs e)
{
textValue = this.textBox1.Text;
}
}
}

120
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/EditorDialog.resx

@ -0,0 +1,120 @@ @@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

40
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/ExpressionEditor.cs

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 11.05.2014
* Time: 18:37
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms;
using ICSharpCode.Reports.Core.Dialogs;
namespace ICSharpCode.Reporting.Addin.Dialogs
{
/// <summary>
/// Description of ExpressionEditor.
/// </summary>
public class ExpressionEditor:UITypeEditor
{
const string expressionEditor = "ExpressionEditor";
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
{
string s = String.Empty;;
if (value != null) {
s = value.ToString();
}
IStringBasedEditorDialog ed = new TextEditorDialog(s, expressionEditor);
return ed.ShowDialog() == DialogResult.OK ? ed.TextValue : s;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal;
}
}
}

40
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/FormatStringConverter.cs

@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 11.05.2014
* Time: 17:46
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.ComponentModel;
using ICSharpCode.Reporting.Addin.Globals;
namespace ICSharpCode.Reporting.Addin.Dialogs
{
/// <summary>
/// Description of FormatStringConverter.
/// </summary>
public class FormatStringConverter:StringConverter
{
public override bool GetStandardValuesSupported(ITypeDescriptorContext context){
//true means show a combobox
return true;
}
public override bool GetStandardValuesExclusive(ITypeDescriptorContext context){
//true will limit to list. false will show the list, but allow free-form entry
return true;
}
public override TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context){
return new StandardValuesCollection(GlobalLists.Formats());
}
}
}

22
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Dialogs/IStringBasedEditorDialog.cs

@ -0,0 +1,22 @@ @@ -0,0 +1,22 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 11.05.2014
* Time: 18:13
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Windows.Forms;
namespace ICSharpCode.Reporting.Addin.Dialogs
{
/// <summary>
/// Description of IStringBasedEditorDialog.
/// </summary>
public interface IStringBasedEditorDialog
{
DialogResult ShowDialog();
string TextValue {get;}
}
}

32
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Globals/GlobalLists.cs

@ -31,5 +31,37 @@ namespace ICSharpCode.Reporting.Addin.Globals @@ -31,5 +31,37 @@ namespace ICSharpCode.Reporting.Addin.Globals
"System.Int"};
#endregion
#region Formats
public static string[] Formats ()
{
return (string[])FormatList.Clone();
}
private static readonly string[] FormatList = new string[] { "",
"#,##0",
"#,##0.00",
"0",
"0.00",
"",
"dd/MM/yy",
"dd/MM/yyyy",
"MM/dd/yyyy",
"dddd, MMMM dd, yyyy",
"dddd, MMMM dd, yyyy HH:mm",
"dddd, MMMM dd, yyyy HH:mm:ss",
"MM/dd/yyyy HH:mm",
"MM/dd/yyyy HH:mm:ss", "MMMM dd",
"Ddd, dd MMM yyyy HH\':\'mm\'\"ss \'GMT\'",
"yyyy-MM-dd HH:mm:ss",
"yyyy-MM-dd HH:mm:ss GMT",
"HH:mm",
"HH:mm:ss",
"hh:mm:ss",
"yyyy-MM-dd HH:mm:ss", "html"};
#endregion
}
}

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/TypeProvider/TypeProviderHelper.cs

@ -108,8 +108,8 @@ namespace ICSharpCode.Reporting.Addin.TypeProvider @@ -108,8 +108,8 @@ namespace ICSharpCode.Reporting.Addin.TypeProvider
prop = props.Find("DataType",true);
allProperties.Add(prop);
prop = props.Find("RTL",true);
allProperties.Add(prop);
// prop = props.Find("RTL",true);
// allProperties.Add(prop);
}
public static void AddGraphicProperties (List<PropertyDescriptor> allProperties,

2
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Views/DesignerView.cs

@ -133,7 +133,7 @@ namespace ICSharpCode.Reporting.Addin.Views @@ -133,7 +133,7 @@ namespace ICSharpCode.Reporting.Addin.Views
LoggingService.Debug("ReportDesigner: CreateAndInitServiceContainer...");
var serviceContainer = new DefaultServiceContainer();
serviceContainer.AddService(typeof(IUIService), new UIService());
serviceContainer.AddService(typeof(IToolboxService),new ToolboxService());
serviceContainer.AddService(typeof(IToolboxService),new ICSharpCode.Reporting.Addin.Services.ToolboxService());
serviceContainer.AddService(typeof(IHelpService), new HelpService());
return serviceContainer;
}

17
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Wpf/Visitor/WpfVisitor.cs

@ -60,6 +60,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor @@ -60,6 +60,7 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
Canvas RenderSectionContainer (ExportContainer container) {
var canvas = FixedDocumentCreator.CreateContainer(container);
foreach (var element in container.ExportedItems) {
if (IsContainer(element)) {
@ -74,23 +75,17 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor @@ -74,23 +75,17 @@ namespace ICSharpCode.Reporting.WpfReportViewer.Visitor
return canvas;
}
void RenderRow(Canvas canvas, IExportContainer element)
void RenderRow(Canvas canvas, IExportContainer container)
{
if (IsGraphicsContainer(element)) {
canvas.Children.Add(RenderGraphicsContainer(element));
if (IsGraphicsContainer(container)) {
canvas.Children.Add(RenderGraphicsContainer(container));
} else {
canvas.Children.Add(RenderRow((ExportContainer)element));
canvas.Children.Add(RenderDataRow((ExportContainer)container));
}
}
public override void Visit(ExportRow exportRow)
{
Console.WriteLine("Reender ExportRow");
base.Visit(exportRow);
}
Canvas RenderRow (ExportContainer row) {
Canvas RenderDataRow (ExportContainer row) {
var rowCanvas = FixedDocumentCreator.CreateContainer(row);
var childCanvas = CreateItemsInContainer(row.ExportedItems);
rowCanvas.Children.Add(childCanvas);

2
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/ConvertForeachToForAction.cs

@ -67,7 +67,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -67,7 +67,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
{
bool hasIndexAccess;
var foreachStatement = GetForeachStatement(context, out hasIndexAccess);
if (foreachStatement == null || foreachStatement.EmbeddedStatement == null)
if (foreachStatement == null || foreachStatement.EmbeddedStatement.IsNull)
yield break;
var state = context.GetResolverStateBefore (foreachStatement.EmbeddedStatement);
string name = GetName(state, VariableNames);

7
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeActions/CreateOverloadWithoutParameterAction.cs

@ -53,7 +53,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -53,7 +53,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
return null;
// find existing method
var method = (IMethod)((MemberResolveResult)context.Resolve (methodDecl)).Member;
var resolveResult = context.Resolve(methodDecl) as MemberResolveResult;
if (resolveResult == null)
return null;
var method = resolveResult.Member as IMethod;
if (method == null)
return null;
var parameters = new List<IParameter> (method.Parameters.Where (param => param.Name != node.Name));
if (method.DeclaringType.GetMethods (
m => m.Name == method.Name && m.TypeParameters.Count == method.TypeParameters.Count)

18
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Custom/UnreachableCodeIssue.cs

@ -133,6 +133,18 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -133,6 +133,18 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
if (statement == null || !AddStatement(statement))
base.VisitChildren(node);
}
static TextLocation GetPrevEnd(AstNode node)
{
var prev = node.GetPrevNode(n => !(n is NewLineNode));
return prev != null ? prev.EndLocation : node.StartLocation;
}
static TextLocation GetNextStart(AstNode node)
{
var next = node.GetNextNode(n => !(n is NewLineNode));
return next != null ? next.StartLocation : node.EndLocation;
}
bool AddStatement(Statement statement)
{
@ -147,7 +159,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -147,7 +159,7 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
}
var prevEnd = statement.GetPrevNode(n => !(n is NewLineNode)).EndLocation;
var prevEnd = GetPrevEnd(statement);
TextLocation start;
TextLocation end;
@ -159,12 +171,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -159,12 +171,12 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
collectedStatements.Add(statement);
visitor.unreachableNodes.Add(statement);
collectedStatements.Add(ife.ElseToken);
end = ife.ElseToken.GetNextNode(n => !(n is NewLineNode)).StartLocation;
end = GetNextStart(ife.ElseToken);
} else if (statement.Role == IfElseStatement.FalseRole) {
var ife = (IfElseStatement)statement.Parent;
start = ife.ElseToken.StartLocation;
collectedStatements.Add(ife.ElseToken);
prevEnd = ife.ElseToken.GetPrevNode(n => !(n is NewLineNode)).EndLocation;
prevEnd = GetPrevEnd(ife.ElseToken);
collectedStatements.Add(statement);
visitor.unreachableNodes.Add(statement);
end = statement.EndLocation;

7
src/Libraries/NRefactory/ICSharpCode.NRefactory.CSharp.Refactoring/CodeIssues/Synced/RedundanciesInCode/RedundantCatchClauseIssue.cs

@ -146,8 +146,11 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring @@ -146,8 +146,11 @@ namespace ICSharpCode.NRefactory.CSharp.Refactoring
if (nextClause != null) {
if (nextClause.Type.IsNull && !IsThrowsClause(nextClause))
return false;
if (!IsThrowsClause(nextClause) && type.GetDefinition ().IsDerivedFrom (ctx.Resolve (nextClause.Type).Type.GetDefinition ()))
return false;
if (!IsThrowsClause(nextClause)) {
var typeDef = type.GetDefinition();
if (typeDef == null || typeDef.IsDerivedFrom(ctx.Resolve(nextClause.Type).Type.GetDefinition()))
return false;
}
}
n = n.NextSibling;
}

2
src/Libraries/NRefactory/ICSharpCode.NRefactory.Xml/DocumentationElement.cs

@ -39,6 +39,8 @@ namespace ICSharpCode.NRefactory.Xml @@ -39,6 +39,8 @@ namespace ICSharpCode.NRefactory.Xml
/// </summary>
public static XmlDocumentationElement Get(IEntity entity, bool inheritDocIfMissing = true)
{
if (entity == null)
return null;
var documentationComment = entity.Documentation;
if (documentationComment != null) {
return Create(documentationComment, entity);

2
src/Main/GlobalAssemblyInfo.cs.template

@ -46,7 +46,7 @@ internal static class RevisionClass @@ -46,7 +46,7 @@ internal static class RevisionClass
public const string Minor = "0";
public const string Build = "0";
public const string Revision = "$INSERTREVISION$";
public const string VersionName = "Beta 3"; // "" is not valid for no version name, you have to use null if you don't want a version name (eg "Beta 1")
public const string VersionName = "Beta 4"; // "" is not valid for no version name, you have to use null if you don't want a version name (eg "Beta 1")
public const string FullVersion = Major + "." + Minor + "." + Build + ".$INSERTREVISION$$INSERTBRANCHPOSTFIX$$INSERTVERSIONNAMEPOSTFIX$";
}

1
src/Main/SharpDevelop/Project/Solution.cs

@ -325,6 +325,7 @@ namespace ICSharpCode.SharpDevelop.Project @@ -325,6 +325,7 @@ namespace ICSharpCode.SharpDevelop.Project
sdSettings.Save(sdSettingsFileName);
}
} catch (IOException) {
} catch (UnauthorizedAccessException) {
// ignore errors writing to extra properties
}
}

Loading…
Cancel
Save