Browse Source

Move OutlineTreeView into WpfDesign.Designer.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3498 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
22cb860681
  1. 1
      samples/XamlDesigner/Document.cs
  2. 113
      samples/XamlDesigner/ExtensionMethods.cs
  3. 213
      samples/XamlDesigner/MainWindow.xaml
  4. 29
      samples/XamlDesigner/Outline.xaml
  5. 145
      samples/XamlDesigner/Themes/Generic.xaml
  6. 31
      samples/XamlDesigner/ToolboxView.xaml
  7. 53
      samples/XamlDesigner/ToolboxView.xaml.cs
  8. 14
      samples/XamlDesigner/XamlDesigner.csproj
  9. 23
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ExtensionMethods.cs
  10. BIN
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/Tag.png
  11. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragListener.cs
  12. 3
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeView.cs
  13. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeViewItem.cs
  14. 14
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/IconItem.cs
  15. 28
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml
  16. 16
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml.cs
  17. 8
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNode.cs
  18. 2
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs
  19. 151
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineView.xaml
  20. 18
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/WpfDesign.Designer.csproj
  21. 9
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml
  22. 4
      src/Main/Base/Project/Src/Project/CustomTool.cs

1
samples/XamlDesigner/Document.cs

@ -6,6 +6,7 @@ using System.ComponentModel;
using System.IO; using System.IO;
using ICSharpCode.WpfDesign.Designer; using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign.Designer.Xaml; using ICSharpCode.WpfDesign.Designer.Xaml;
using ICSharpCode.WpfDesign.Designer.OutlineView;
using System.Xml; using System.Xml;
using ICSharpCode.WpfDesign; using ICSharpCode.WpfDesign;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;

113
samples/XamlDesigner/ExtensionMethods.cs

@ -12,76 +12,67 @@ using System.Collections;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner
{ {
static class ExtensionMethods static class ExtensionMethods
{ {
public static IEnumerable<string> Paths(this IDataObject data) public static IEnumerable<string> Paths(this IDataObject data)
{ {
string[] paths = (string[])data.GetData(DataFormats.FileDrop); string[] paths = (string[])data.GetData(DataFormats.FileDrop);
if (paths != null) { if (paths != null) {
foreach (var path in paths) { foreach (var path in paths) {
yield return path; yield return path;
} }
} }
} }
public static T GetObject<T>(this IDataObject data)
{
return (T)data.GetData(typeof(T).FullName);
}
public static T FindAncestor<T>(this DependencyObject d) where T : class public static T GetObject<T>(this IDataObject data)
{ {
while (true) { return (T)data.GetData(typeof(T).FullName);
if (d == null) return null; }
if (d is T) return d as T;
d = VisualTreeHelper.GetParent(d);
}
}
public static Stream ToStream(this string s) public static Stream ToStream(this string s)
{ {
return new MemoryStream(Encoding.UTF8.GetBytes(s)); return new MemoryStream(Encoding.UTF8.GetBytes(s));
} }
public static void AddRange<T>(this ObservableCollection<T> col, IEnumerable<T> items) public static void AddRange<T>(this ObservableCollection<T> col, IEnumerable<T> items)
{ {
foreach (var item in items) { foreach (var item in items) {
col.Add(item); col.Add(item);
} }
} }
public static void KeepSyncronizedWith<S>(this IList target, ObservableCollection<S> source, Func<S, object> convert) public static void KeepSyncronizedWith<S>(this IList target, ObservableCollection<S> source, Func<S, object> convert)
{ {
target.Clear(); target.Clear();
foreach (var item in source) { foreach (var item in source) {
target.Add(convert(item)); target.Add(convert(item));
} }
source.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e) { source.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e) {
switch (e.Action) { switch (e.Action) {
case NotifyCollectionChangedAction.Add: case NotifyCollectionChangedAction.Add:
target.Add(convert((S)e.NewItems[0])); target.Add(convert((S)e.NewItems[0]));
break; break;
case NotifyCollectionChangedAction.Remove: case NotifyCollectionChangedAction.Remove:
target.RemoveAt(e.OldStartingIndex); target.RemoveAt(e.OldStartingIndex);
break; break;
case NotifyCollectionChangedAction.Move: case NotifyCollectionChangedAction.Move:
target.RemoveAt(e.OldStartingIndex); target.RemoveAt(e.OldStartingIndex);
target.Insert(e.NewStartingIndex, e.NewItems[0]); target.Insert(e.NewStartingIndex, e.NewItems[0]);
break; break;
case NotifyCollectionChangedAction.Replace: case NotifyCollectionChangedAction.Replace:
target[e.NewStartingIndex] = convert((S)e.NewItems[0]); target[e.NewStartingIndex] = convert((S)e.NewItems[0]);
break; break;
case NotifyCollectionChangedAction.Reset: case NotifyCollectionChangedAction.Reset:
target.Clear(); target.Clear();
break; break;
} }
}; };
} }
public static object GetDataContext(this RoutedEventArgs e) public static object GetDataContext(this RoutedEventArgs e)
{ {
@ -89,5 +80,5 @@ namespace ICSharpCode.XamlDesigner
if (f != null) return f.DataContext; if (f != null) return f.DataContext;
return null; return null;
} }
} }
} }

213
samples/XamlDesigner/MainWindow.xaml

@ -4,116 +4,115 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sd="http://sharpdevelop.net" xmlns:sd="http://sharpdevelop.net"
xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock" xmlns:AvalonDock="clr-namespace:AvalonDock;assembly=AvalonDock"
xmlns:Outline="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView;assembly=ICSharpCode.WpfDesign.Designer"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner" xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
SnapsToDevicePixels="True" SnapsToDevicePixels="True"
AllowDrop="True" AllowDrop="True"
Title="{Binding Title}"> Title="{Binding Title}">
<Window.CommandBindings> <Window.CommandBindings>
<CommandBinding Command="New" <CommandBinding Command="New"
Executed="NewCommand_Executed" /> Executed="NewCommand_Executed" />
<CommandBinding Command="Open" <CommandBinding Command="Open"
Executed="OpenCommand_Executed" /> Executed="OpenCommand_Executed" />
<CommandBinding Command="Close" <CommandBinding Command="Close"
Executed="CloseCommand_Executed" Executed="CloseCommand_Executed"
CanExecute="CurrentDocument_CanExecute" CanExecute="CurrentDocument_CanExecute"
PreviewExecuted="CloseCommand_PreviewExecuted"/> PreviewExecuted="CloseCommand_PreviewExecuted"/>
<CommandBinding Command="Default:MainWindow.CloseAllCommand" <CommandBinding Command="Default:MainWindow.CloseAllCommand"
Executed="CloseAllCommand_Executed" Executed="CloseAllCommand_Executed"
CanExecute="CurrentDocument_CanExecute" /> CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="Save" <CommandBinding Command="Save"
Executed="SaveCommand_Executed" Executed="SaveCommand_Executed"
CanExecute="CurrentDocument_CanExecute" /> CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="SaveAs" <CommandBinding Command="SaveAs"
Executed="SaveAsCommand_Executed" Executed="SaveAsCommand_Executed"
CanExecute="CurrentDocument_CanExecute" /> CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="Default:MainWindow.SaveAllCommand" <CommandBinding Command="Default:MainWindow.SaveAllCommand"
Executed="SaveAllCommand_Executed" Executed="SaveAllCommand_Executed"
CanExecute="CurrentDocument_CanExecute" /> CanExecute="CurrentDocument_CanExecute" />
<CommandBinding Command="Default:MainWindow.ExitCommand" <CommandBinding Command="Default:MainWindow.ExitCommand"
Executed="ExitCommand_Executed" /> Executed="ExitCommand_Executed" />
</Window.CommandBindings> </Window.CommandBindings>
<DockPanel> <DockPanel>
<Menu DockPanel.Dock="Top"> <Menu DockPanel.Dock="Top">
<MenuItem Header="File"> <MenuItem Header="File">
<MenuItem Command="New" /> <MenuItem Command="New" />
<MenuItem Command="Open" /> <MenuItem Command="Open" />
<Separator /> <Separator />
<MenuItem Command="Close" /> <MenuItem Command="Close" />
<MenuItem Command="Default:MainWindow.CloseAllCommand" /> <MenuItem Command="Default:MainWindow.CloseAllCommand" />
<Separator /> <Separator />
<MenuItem Command="Save" /> <MenuItem Command="Save" />
<MenuItem Command="SaveAs" /> <MenuItem Command="SaveAs" />
<MenuItem Command="Default:MainWindow.SaveAllCommand" /> <MenuItem Command="Default:MainWindow.SaveAllCommand" />
<Separator /> <Separator />
<MenuItem Header="Recent Files" <MenuItem Header="Recent Files"
ItemsSource="{Binding RecentFiles}" ItemsSource="{Binding RecentFiles}"
IsEnabled="{Binding RecentFiles.Count, Converter={StaticResource FalseWhenZero}}" IsEnabled="{Binding RecentFiles.Count, Converter={StaticResource FalseWhenZero}}"
Click="RecentFiles_Click"/> Click="RecentFiles_Click"/>
<Separator /> <Separator />
<MenuItem Command="Default:MainWindow.ExitCommand" /> <MenuItem Command="Default:MainWindow.ExitCommand" />
</MenuItem> </MenuItem>
<MenuItem Header="Edit"> <MenuItem Header="Edit">
<MenuItem Command="Undo" /> <MenuItem Command="Undo" />
<MenuItem Command="Redo" /> <MenuItem Command="Redo" />
<Separator /> <Separator />
<MenuItem Command="Cut" /> <MenuItem Command="Cut" />
<MenuItem Command="Copy" /> <MenuItem Command="Copy" />
<MenuItem Command="Paste" /> <MenuItem Command="Paste" />
<MenuItem Command="Delete" /> <MenuItem Command="Delete" />
<MenuItem Command="SelectAll" /> <MenuItem Command="SelectAll" />
<Separator /> <Separator />
<MenuItem Command="Default:MainWindow.RefreshCommand" /> <MenuItem Command="Default:MainWindow.RefreshCommand" />
<MenuItem Command="Find" /> <MenuItem Command="Find" />
</MenuItem> </MenuItem>
</Menu> </Menu>
<AvalonDock:DockingManager x:Name="uxDockingManager"> <AvalonDock:DockingManager x:Name="uxDockingManager">
<AvalonDock:ResizingPanel> <AvalonDock:ResizingPanel>
<AvalonDock:DocumentPane x:Name="uxDocumentPane" <AvalonDock:DocumentPane x:Name="uxDocumentPane"
SelectedValue="{Binding CurrentDocument}" SelectedValue="{Binding CurrentDocument}"
SelectedValuePath="DataContext"/> SelectedValuePath="DataContext"/>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content1" Title="Toolbox"> <AvalonDock:DockableContent x:Name="content1" Title="Toolbox">
<Default:ToolboxView /> <Default:ToolboxView />
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content2" Title="Outline"> <AvalonDock:DockableContent x:Name="content2" Title="Outline">
<Default:Outline Root="{Binding CurrentDocument.OutlineRoot}"/> <Outline:Outline Root="{Binding CurrentDocument.OutlineRoot}"/>
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content3" Title="Errors"> <AvalonDock:DockableContent x:Name="content3" Title="Errors">
<Default:ErrorListView ItemsSource="{Binding CurrentDocument.XamlErrorService.Errors}"/> <Default:ErrorListView ItemsSource="{Binding CurrentDocument.XamlErrorService.Errors}"/>
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
<AvalonDock:DockablePane> <AvalonDock:DockablePane>
<AvalonDock:DockableContent x:Name="content4" Title="Properties"> <AvalonDock:DockableContent x:Name="content4" Title="Properties">
<sd:PropertyGridView x:Name="uxPropertyGridView" <sd:PropertyGridView x:Name="uxPropertyGridView"
SelectedItems="{Binding DataContext.CurrentDocument.SelectionService.SelectedItems, ElementName=root, FallbackValue={x:Null}}"/> SelectedItems="{Binding DataContext.CurrentDocument.SelectionService.SelectedItems, ElementName=root, FallbackValue={x:Null}}"/>
</AvalonDock:DockableContent> </AvalonDock:DockableContent>
</AvalonDock:DockablePane> </AvalonDock:DockablePane>
</AvalonDock:ResizingPanel> </AvalonDock:ResizingPanel>
</AvalonDock:DockingManager> </AvalonDock:DockingManager>
</DockPanel>
</DockPanel>
</Window> </Window>

29
samples/XamlDesigner/Outline.xaml

@ -1,29 +0,0 @@
<UserControl x:Class="ICSharpCode.XamlDesigner.Outline"
x:Name="root"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
xmlns:Converters="clr-namespace:ICSharpCode.XamlDesigner.Converters">
<UserControl.Resources>
<HierarchicalDataTemplate DataType="{x:Type Default:OutlineNode}"
ItemsSource="{Binding Children}">
<Default:IconItem Icon="Images/Tag.png"
Text="{Binding Name}" />
</HierarchicalDataTemplate>
</UserControl.Resources>
<Default:OutlineTreeView Root="{Binding Root, ElementName=root}">
<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type Default:DragTreeViewItem}">
<Setter Property="IsSelected"
Value="{Binding IsSelected}" />
<Setter Property="IsExpanded"
Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>
</ItemsControl.ItemContainerStyle>
</Default:OutlineTreeView>
</UserControl>

145
samples/XamlDesigner/Themes/Generic.xaml

@ -3,149 +3,4 @@
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner" xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"
xmlns:Converters="clr-namespace:ICSharpCode.XamlDesigner.Converters"> xmlns:Converters="clr-namespace:ICSharpCode.XamlDesigner.Converters">
<Converters:LevelConverter x:Key="LevelConverter" />
<Style TargetType="{x:Type Default:IconItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:IconItem}">
<StackPanel Orientation="Horizontal">
<Image Source="{TemplateBinding Icon}"
Stretch="None" />
<TextBlock Text="{TemplateBinding Text}"
VerticalAlignment="Center"
Margin="5 0 0 0" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Brush x:Key="InsertBrush">#FFC73C</Brush>
<Style x:Key="ExpandButtonStyle"
TargetType="ToggleButton">
<Setter Property="Focusable"
Value="False" />
<Setter Property="ClickMode"
Value="Press" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent">
<Border Width="9"
Height="9"
SnapsToDevicePixels="true"
BorderBrush="#FF7898B5"
BorderThickness="1"
CornerRadius="1">
<Border.Background>
<LinearGradientBrush EndPoint="1,1"
StartPoint="0,0">
<GradientStop Color="White"
Offset=".2" />
<GradientStop Color="#FFC0B7A6"
Offset="1" />
</LinearGradientBrush>
</Border.Background>
<Path Margin="1,1,1,1"
x:Name="ExpandPath"
Fill="Black"
Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z" />
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Data"
TargetName="ExpandPath"
Value="M 0 2 L 0 3 L 5 3 L 5 2 Z" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Default:DragTreeView}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:DragTreeView}">
<Grid Background="White">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<ItemsPresenter />
</ScrollViewer>
<Border x:Name="PART_InsertLine"
Background="{StaticResource InsertBrush}"
Height="2"
Width="50"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Visibility="Collapsed"
IsHitTestVisible="False" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Default:DragTreeViewItem}">
<Setter Property="Foreground"
Value="{x:Static SystemColors.ControlTextBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:DragTreeViewItem}">
<DockPanel Background="White">
<DockPanel x:Name="bg"
DockPanel.Dock="Top"
Background="{TemplateBinding Background}">
<ToggleButton x:Name="expandButton"
Style="{StaticResource ExpandButtonStyle}"
DockPanel.Dock="Left"
Margin="{TemplateBinding Level, Converter={StaticResource LevelConverter}}"
IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" />
<Border x:Name="contentBorder"
HorizontalAlignment="Left">
<ContentPresenter x:Name="PART_Header"
ContentSource="Header" />
</Border>
</DockPanel>
<ItemsPresenter x:Name="itemsHost" />
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded"
Value="False">
<Setter TargetName="itemsHost"
Property="Visibility"
Value="Collapsed" />
</Trigger>
<Trigger Property="HasItems"
Value="False">
<Setter TargetName="expandButton"
Property="Visibility"
Value="Hidden" />
</Trigger>
<Trigger Property="IsSelected"
Value="True">
<Setter TargetName="bg"
Property="Background"
Value="{x:Static SystemColors.HighlightBrush}" />
<Setter Property="Foreground"
Value="{x:Static SystemColors.HighlightTextBrush}" />
</Trigger>
<Trigger Property="IsDragHover"
Value="True">
<Setter TargetName="contentBorder"
Property="Background"
Value="{StaticResource InsertBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary> </ResourceDictionary>

31
samples/XamlDesigner/ToolboxView.xaml

@ -1,25 +1,26 @@
<UserControl x:Class="ICSharpCode.XamlDesigner.ToolboxView" <UserControl x:Class="ICSharpCode.XamlDesigner.ToolboxView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Outline="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView;assembly=ICSharpCode.WpfDesign.Designer"
xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner"> xmlns:Default="clr-namespace:ICSharpCode.XamlDesigner">
<UserControl.Resources> <UserControl.Resources>
<HierarchicalDataTemplate DataType="{x:Type Default:AssemblyNode}" <HierarchicalDataTemplate DataType="{x:Type Default:AssemblyNode}"
ItemsSource="{Binding Controls}"> ItemsSource="{Binding Controls}">
<Default:IconItem Icon="Images/Reference.png" <Outline:IconItem Icon="Images/Reference.png"
Text="{Binding Name}" Text="{Binding Name}"
ToolTip="{Binding Path}" /> ToolTip="{Binding Path}" />
</HierarchicalDataTemplate> </HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type Default:ControlNode}"> <DataTemplate DataType="{x:Type Default:ControlNode}">
<Default:IconItem Icon="Images/Tag.png" <Outline:IconItem Icon="Images/Tag.png"
Text="{Binding Type.Name}" /> Text="{Binding Type.Name}" />
</DataTemplate> </DataTemplate>
</UserControl.Resources> </UserControl.Resources>
<TreeView x:Name="uxTreeView" <TreeView x:Name="uxTreeView"
ItemsSource="{Binding AssemblyNodes}" ItemsSource="{Binding AssemblyNodes}"
BorderThickness="0"/> BorderThickness="0"/>
</UserControl> </UserControl>

53
samples/XamlDesigner/ToolboxView.xaml.cs

@ -1,6 +1,10 @@
using ICSharpCode.WpfDesign.Designer.OutlineView;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Text; using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
@ -11,24 +15,21 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Reflection;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using ICSharpCode.WpfDesign.Designer.Services; using ICSharpCode.WpfDesign.Designer.Services;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.XamlDesigner
{ {
public partial class ToolboxView public partial class ToolboxView
{ {
public ToolboxView() public ToolboxView()
{ {
DataContext = Toolbox.Instance; DataContext = Toolbox.Instance;
InitializeComponent(); InitializeComponent();
new DragListener(this).DragStarted += Toolbox_DragStarted; new DragListener(this).DragStarted += Toolbox_DragStarted;
uxTreeView.SelectedItemChanged += uxTreeView_SelectedItemChanged; uxTreeView.SelectedItemChanged += uxTreeView_SelectedItemChanged;
uxTreeView.GotKeyboardFocus += uxTreeView_GotKeyboardFocus; uxTreeView.GotKeyboardFocus += uxTreeView_GotKeyboardFocus;
} }
void uxTreeView_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e) void uxTreeView_GotKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
{ {
@ -47,7 +48,7 @@ namespace ICSharpCode.XamlDesigner
void PrepareTool(ControlNode node, bool drag) void PrepareTool(ControlNode node, bool drag)
{ {
if (node != null) { if (node != null) {
var tool = new CreateComponentTool(node.Type); var tool = new CreateComponentTool(node.Type);
if (Shell.Instance.CurrentDocument != null) { if (Shell.Instance.CurrentDocument != null) {
Shell.Instance.CurrentDocument.DesignContext.Services.Tool.CurrentTool = tool; Shell.Instance.CurrentDocument.DesignContext.Services.Tool.CurrentTool = tool;
@ -55,22 +56,22 @@ namespace ICSharpCode.XamlDesigner
DragDrop.DoDragDrop(this, tool, DragDropEffects.Copy); DragDrop.DoDragDrop(this, tool, DragDropEffects.Copy);
} }
} }
} }
} }
protected override void OnKeyDown(KeyEventArgs e) protected override void OnKeyDown(KeyEventArgs e)
{ {
if (e.Key == Key.Delete) { if (e.Key == Key.Delete) {
Remove(); Remove();
} }
} }
void Remove() void Remove()
{ {
AssemblyNode node = uxTreeView.SelectedItem as AssemblyNode; AssemblyNode node = uxTreeView.SelectedItem as AssemblyNode;
if (node != null) { if (node != null) {
Toolbox.Instance.Remove(node); Toolbox.Instance.Remove(node);
} }
} }
} }
} }

14
samples/XamlDesigner/XamlDesigner.csproj

@ -108,21 +108,11 @@
<Compile Include="DocumentView.xaml.cs"> <Compile Include="DocumentView.xaml.cs">
<DependentUpon>DocumentView.xaml</DependentUpon> <DependentUpon>DocumentView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="DragListener.cs" />
<Compile Include="DragTreeView.cs" />
<Compile Include="DragTreeViewItem.cs" />
<Compile Include="ErrorListView.xaml.cs"> <Compile Include="ErrorListView.xaml.cs">
<DependentUpon>ErrorListView.xaml</DependentUpon> <DependentUpon>ErrorListView.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ExtensionMethods.cs" /> <Compile Include="ExtensionMethods.cs" />
<Compile Include="IconItem.cs" />
<Compile Include="MainWindow_Commands.cs" /> <Compile Include="MainWindow_Commands.cs" />
<Compile Include="Outline.xaml.cs">
<DependentUpon>Outline.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="OutlineNode.cs" />
<Compile Include="OutlineTreeView.cs" />
<Compile Include="Shell.cs" /> <Compile Include="Shell.cs" />
<Compile Include="MainWindow.xaml.cs"> <Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
@ -161,10 +151,6 @@
<None Include="TestFiles\2.xaml"> <None Include="TestFiles\2.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</None> </None>
<Page Include="Outline.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<None Include="TestFiles\3.xaml"> <None Include="TestFiles\3.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</None> </None>

23
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/ExtensionMethods.cs

@ -34,13 +34,22 @@ namespace ICSharpCode.WpfDesign.Designer
} }
public static T FindAncestor<T>(this DependencyObject d, string name) where T : class public static T FindAncestor<T>(this DependencyObject d, string name) where T : class
{ {
while (true) { while (true) {
if (d == null) return null; if (d == null) return null;
if (d is T && d is FrameworkElement && (d as FrameworkElement).Name == name) return d as T; if (d is T && d is FrameworkElement && (d as FrameworkElement).Name == name) return d as T;
d = VisualTreeHelper.GetParent(d); d = VisualTreeHelper.GetParent(d);
} }
} }
public static T FindAncestor<T>(this DependencyObject d) where T : class
{
while (true) {
if (d == null) return null;
if (d is T) return d as T;
d = VisualTreeHelper.GetParent(d);
}
}
public static T FindChild<T>(this DependencyObject d) where T : class public static T FindChild<T>(this DependencyObject d) where T : class
{ {

BIN
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Images/Tag.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

2
samples/XamlDesigner/DragListener.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragListener.cs

@ -5,7 +5,7 @@ using System.Text;
using System.Windows; using System.Windows;
using System.Windows.Input; using System.Windows.Input;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class DragListener public class DragListener
{ {

3
samples/XamlDesigner/DragTreeView.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeView.cs

@ -12,10 +12,9 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Collections.Specialized; using System.Collections.Specialized;
using ICSharpCode.XamlDesigner.Converters;
using System.Collections; using System.Collections;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
// limitations: // limitations:
// - Do not use ItemsSource (use Root) // - Do not use ItemsSource (use Root)

2
samples/XamlDesigner/DragTreeViewItem.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/DragTreeViewItem.cs

@ -13,7 +13,7 @@ using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class DragTreeViewItem : TreeViewItem public class DragTreeViewItem : TreeViewItem
{ {

14
samples/XamlDesigner/IconItem.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/IconItem.cs

@ -6,23 +6,23 @@ using System.Windows.Controls;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class IconItem : Control public class IconItem : Control
{ {
static IconItem() static IconItem()
{ {
DefaultStyleKeyProperty.OverrideMetadata(typeof(IconItem), DefaultStyleKeyProperty.OverrideMetadata(typeof(IconItem),
new FrameworkPropertyMetadata(typeof(IconItem))); new FrameworkPropertyMetadata(typeof(IconItem)));
} }
public static readonly DependencyProperty IconProperty = public static readonly DependencyProperty IconProperty =
DependencyProperty.Register("Icon", typeof(ImageSource), typeof(IconItem)); DependencyProperty.Register("Icon", typeof(ImageSource), typeof(IconItem));
public ImageSource Icon { public ImageSource Icon {
get { return (ImageSource)GetValue(IconProperty); } get { return (ImageSource)GetValue(IconProperty); }
set { SetValue(IconProperty, value); } set { SetValue(IconProperty, value); }
} }
public static readonly DependencyProperty TextProperty = public static readonly DependencyProperty TextProperty =
DependencyProperty.Register("Text", typeof(string), typeof(IconItem)); DependencyProperty.Register("Text", typeof(string), typeof(IconItem));

28
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml

@ -0,0 +1,28 @@
<UserControl x:Class="ICSharpCode.WpfDesign.Designer.OutlineView.Outline"
x:Name="root"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Default="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView">
<UserControl.Resources>
<HierarchicalDataTemplate DataType="{x:Type Default:OutlineNode}"
ItemsSource="{Binding Children}">
<Default:IconItem Icon="../Images/Tag.png"
Text="{Binding Name}" />
</HierarchicalDataTemplate>
</UserControl.Resources>
<Default:OutlineTreeView Root="{Binding Root, ElementName=root}">
<ItemsControl.ItemContainerStyle>
<Style TargetType="{x:Type Default:DragTreeViewItem}">
<Setter Property="IsSelected"
Value="{Binding IsSelected}" />
<Setter Property="IsExpanded"
Value="{Binding IsExpanded, Mode=TwoWay}" />
</Style>
</ItemsControl.ItemContainerStyle>
</Default:OutlineTreeView>
</UserControl>

16
samples/XamlDesigner/Outline.xaml.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/Outline.xaml.cs

@ -12,14 +12,14 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public partial class Outline public partial class Outline
{ {
public Outline() public Outline()
{ {
InitializeComponent(); InitializeComponent();
} }
public static readonly DependencyProperty RootProperty = public static readonly DependencyProperty RootProperty =
DependencyProperty.Register("Root", typeof(OutlineNode), typeof(Outline)); DependencyProperty.Register("Root", typeof(OutlineNode), typeof(Outline));
@ -28,5 +28,5 @@ namespace ICSharpCode.XamlDesigner
get { return (OutlineNode)GetValue(RootProperty); } get { return (OutlineNode)GetValue(RootProperty); }
set { SetValue(RootProperty, value); } set { SetValue(RootProperty, value); }
} }
} }
} }

8
samples/XamlDesigner/OutlineNode.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineNode.cs

@ -9,7 +9,7 @@ using System.Collections;
using ICSharpCode.WpfDesign.Designer; using ICSharpCode.WpfDesign.Designer;
using ICSharpCode.WpfDesign.XamlDom; using ICSharpCode.WpfDesign.XamlDom;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class OutlineNode : INotifyPropertyChanged public class OutlineNode : INotifyPropertyChanged
{ {
@ -65,7 +65,7 @@ namespace ICSharpCode.XamlDesigner
if (isSelected != value) { if (isSelected != value) {
isSelected = value; isSelected = value;
SelectionService.SetSelectedComponents(new[] { DesignItem }, SelectionService.SetSelectedComponents(new[] { DesignItem },
value ? SelectionTypes.Add : SelectionTypes.Remove); value ? SelectionTypes.Add : SelectionTypes.Remove);
RaisePropertyChanged("IsSelected"); RaisePropertyChanged("IsSelected");
} }
} }
@ -138,7 +138,7 @@ namespace ICSharpCode.XamlDesigner
if (DesignItem.ContentProperty.IsCollection) { if (DesignItem.ContentProperty.IsCollection) {
foreach (var node in nodes) { foreach (var node in nodes) {
if (!CollectionSupport.CanCollectionAdd(DesignItem.ContentProperty.ReturnType, if (!CollectionSupport.CanCollectionAdd(DesignItem.ContentProperty.ReturnType,
node.DesignItem.ComponentType)) { node.DesignItem.ComponentType)) {
return false; return false;
} }
} }
@ -147,7 +147,7 @@ namespace ICSharpCode.XamlDesigner
else { else {
return after == null && nodes.Count() == 1 && return after == null && nodes.Count() == 1 &&
DesignItem.ContentProperty.DeclaringType.IsAssignableFrom( DesignItem.ContentProperty.DeclaringType.IsAssignableFrom(
nodes.First().DesignItem.ComponentType); nodes.First().DesignItem.ComponentType);
} }
} }

2
samples/XamlDesigner/OutlineTreeView.cs → src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineTreeView.cs

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace ICSharpCode.XamlDesigner namespace ICSharpCode.WpfDesign.Designer.OutlineView
{ {
public class OutlineTreeView : DragTreeView public class OutlineTreeView : DragTreeView
{ {

151
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/OutlineView/OutlineView.xaml

@ -0,0 +1,151 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Default="clr-namespace:ICSharpCode.WpfDesign.Designer.OutlineView"
xmlns:Converters="clr-namespace:ICSharpCode.WpfDesign.Designer.Converters"
>
<Converters:LevelConverter x:Key="LevelConverter" />
<Style TargetType="{x:Type Default:IconItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:IconItem}">
<StackPanel Orientation="Horizontal">
<Image Source="{TemplateBinding Icon}"
Stretch="None" />
<TextBlock Text="{TemplateBinding Text}"
VerticalAlignment="Center"
Margin="5 0 0 0" />
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ExpandButtonStyle"
TargetType="ToggleButton">
<Setter Property="Focusable"
Value="False" />
<Setter Property="ClickMode"
Value="Press" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent">
<Border Width="9"
Height="9"
SnapsToDevicePixels="true"
BorderBrush="#FF7898B5"
BorderThickness="1"
CornerRadius="1">
<Border.Background>
<LinearGradientBrush EndPoint="1,1"
StartPoint="0,0">
<GradientStop Color="White"
Offset=".2" />
<GradientStop Color="#FFC0B7A6"
Offset="1" />
</LinearGradientBrush>
</Border.Background>
<Path Margin="1,1,1,1"
x:Name="ExpandPath"
Fill="Black"
Data="M 0 2 L 0 3 L 2 3 L 2 5 L 3 5 L 3 3 L 5 3 L 5 2 L 3 2 L 3 0 L 2 0 L 2 2 Z" />
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked"
Value="True">
<Setter Property="Data"
TargetName="ExpandPath"
Value="M 0 2 L 0 3 L 5 3 L 5 2 Z" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Brush x:Key="InsertBrush">#FFC73C</Brush>
<Style TargetType="{x:Type Default:DragTreeView}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:DragTreeView}">
<Grid Background="White">
<ScrollViewer HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<ItemsPresenter />
</ScrollViewer>
<Border x:Name="PART_InsertLine"
Background="{StaticResource InsertBrush}"
Height="2"
Width="50"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Visibility="Collapsed"
IsHitTestVisible="False" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Default:DragTreeViewItem}">
<Setter Property="Foreground"
Value="{x:Static SystemColors.ControlTextBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Default:DragTreeViewItem}">
<DockPanel Background="White">
<DockPanel x:Name="bg"
DockPanel.Dock="Top"
Background="{TemplateBinding Background}">
<ToggleButton x:Name="expandButton"
Style="{StaticResource ExpandButtonStyle}"
DockPanel.Dock="Left"
Margin="{TemplateBinding Level, Converter={StaticResource LevelConverter}}"
IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" />
<Border x:Name="contentBorder"
HorizontalAlignment="Left">
<ContentPresenter x:Name="PART_Header"
ContentSource="Header" />
</Border>
</DockPanel>
<ItemsPresenter x:Name="itemsHost" />
</DockPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded"
Value="False">
<Setter TargetName="itemsHost"
Property="Visibility"
Value="Collapsed" />
</Trigger>
<Trigger Property="HasItems"
Value="False">
<Setter TargetName="expandButton"
Property="Visibility"
Value="Hidden" />
</Trigger>
<Trigger Property="IsSelected"
Value="True">
<Setter TargetName="bg"
Property="Background"
Value="{x:Static SystemColors.HighlightBrush}" />
<Setter Property="Foreground"
Value="{x:Static SystemColors.HighlightTextBrush}" />
</Trigger>
<Trigger Property="IsDragHover"
Value="True">
<Setter TargetName="contentBorder"
Property="Background"
Value="{StaticResource InsertBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

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

@ -116,6 +116,17 @@
<Compile Include="Extensions\ResizeThumbExtension.cs" /> <Compile Include="Extensions\ResizeThumbExtension.cs" />
<Compile Include="Extensions\WindowResizeBehavior.cs" /> <Compile Include="Extensions\WindowResizeBehavior.cs" />
<Compile Include="BasicMetadata.cs" /> <Compile Include="BasicMetadata.cs" />
<Compile Include="OutlineView\DragListener.cs" />
<Compile Include="OutlineView\DragTreeView.cs" />
<Compile Include="OutlineView\DragTreeViewItem.cs" />
<Compile Include="OutlineView\IconItem.cs" />
<Compile Include="OutlineView\Outline.xaml.cs">
<DependentUpon>Outline.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="OutlineView\OutlineNode.cs">
</Compile>
<Compile Include="OutlineView\OutlineTreeView.cs" />
<Compile Include="PropertyGrid\Editors\BoolEditor.xaml.cs"> <Compile Include="PropertyGrid\Editors\BoolEditor.xaml.cs">
<DependentUpon>BoolEditor.xaml</DependentUpon> <DependentUpon>BoolEditor.xaml</DependentUpon>
</Compile> </Compile>
@ -186,6 +197,7 @@
<Compile Include="Xaml\XamlDesignItem.cs" /> <Compile Include="Xaml\XamlDesignItem.cs" />
<Compile Include="Xaml\XamlModelProperty.cs" /> <Compile Include="Xaml\XamlModelProperty.cs" />
<Compile Include="Xaml\XamlModelPropertyCollection.cs" /> <Compile Include="Xaml\XamlModelPropertyCollection.cs" />
<Resource Include="Images\Tag.png" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj"> <ProjectReference Include="..\..\WpfDesign.XamlDom\Project\WpfDesign.XamlDom.csproj">
@ -212,6 +224,11 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="OutlineView\Outline.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="OutlineView\OutlineView.xaml" />
<Page Include="PropertyGrid\Editors\BoolEditor.xaml"> <Page Include="PropertyGrid\Editors\BoolEditor.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -267,6 +284,7 @@
<Page Include="Themes\Generic.xaml"> <Page Include="Themes\Generic.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Folder Include="OutlineView" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Resource Include="Images\Class.png" /> <Resource Include="Images\Class.png" />

9
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/themes/generic.xaml

@ -1,6 +1,7 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/Controls/ControlStyles.xaml" /> <ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/Controls/ControlStyles.xaml" />
</ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/ICSharpCode.WpfDesign.Designer;component/OutlineView/OutlineView.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>

4
src/Main/Base/Project/Src/Project/CustomTool.cs

@ -375,7 +375,9 @@ namespace ICSharpCode.SharpDevelop.Project
ICustomTool customTool = GetCustomTool(baseItem.CustomTool); ICustomTool customTool = GetCustomTool(baseItem.CustomTool);
if (customTool == null) { if (customTool == null) {
string message = "Cannot find custom tool '" + baseItem.CustomTool + "'."; string message = "Cannot find custom tool '" + baseItem.CustomTool + "'.";
CustomToolContext.StaticMessageView.AppendLine(message); if (!baseItem.CustomTool.StartsWith("MSBuild:")) {
CustomToolContext.StaticMessageView.AppendLine(message);
}
if (showMessageBoxOnErrors) { if (showMessageBoxOnErrors) {
MessageService.ShowError(message); MessageService.ShowError(message);
} }

Loading…
Cancel
Save