Permalink
Browse files

Set Icon's for ServiceMethods in AddServiceReferenceDialog.xaml/ListView

  • Loading branch information...
1 parent 32ff71c commit 7784f273da1fcac84bc59747a47ff76c7995505f @PeterForstmeier PeterForstmeier committed Nov 8, 2011
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
-# SharpDevelop 4.1.0.8000
+# SharpDevelop 4.2.0.8225-alpha
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Main", "Main", "{256F5C28-532C-44C0-8AB8-D8EC5E492E01}"
ProjectSection(SolutionItems) = postProject
EndProjectSection
@@ -249,17 +249,17 @@
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\WebProjectOptions\WebProjectOptionsPanel.xaml.cs">
<DependentUpon>WebProjectOptionsPanel.xaml</DependentUpon>
</Compile>
- <Compile Include="Src\Gui\Dialogs\ReferenceDialog\AddServiceReferenceDialog.xaml.cs">
+ <Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReferenceHelper.cs" />
+ <Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AddServiceReferenceDialog.xaml.cs">
<DependentUpon>AddServiceReferenceDialog.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
- <Compile Include="Src\Gui\Dialogs\ReferenceDialog\AddServiceReferenceViewModel.cs" />
- <Compile Include="Src\Gui\Dialogs\ReferenceDialog\AdvancedServiceDialog.xaml.cs">
+ <Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AddServiceReferenceViewModel.cs" />
+ <Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AdvancedServiceDialog.xaml.cs">
<DependentUpon>AdvancedServiceDialog.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
- <Compile Include="Src\Gui\Dialogs\ReferenceDialog\AdvancedServiceViewModel.cs" />
- <Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReferenceHelper.cs" />
+ <Compile Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AdvancedServiceViewModel.cs" />
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.cs" />
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.Designer.cs">
<DependentUpon>ToolNotFoundDialog.cs</DependentUpon>
@@ -842,8 +842,8 @@
<DependentUpon>ProjectOptionPanel.cs</DependentUpon>
</Page>
<Page Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\WebProjectOptions\WebProjectOptionsPanel.xaml" />
- <Page Include="Src\Gui\Dialogs\ReferenceDialog\AddServiceReferenceDialog.xaml" />
- <Page Include="Src\Gui\Dialogs\ReferenceDialog\AdvancedServiceDialog.xaml" />
+ <Page Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AddServiceReferenceDialog.xaml" />
+ <Page Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference\AdvancedServiceDialog.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsBulbControl.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsControl.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsHeaderedControl.xaml" />
@@ -872,6 +872,7 @@
<Name>ICSharpCode.Core</Name>
<Private>False</Private>
</ProjectReference>
+ <Folder Include="Src\Gui\Dialogs\ReferenceDialog\ServiceReference" />
<Folder Include="themes" />
<Folder Include="Src\Bookmarks\Pad\Controls" />
<Folder Include="Src\Editor\AvalonEdit" />
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Window
- x:Class="ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.AddServiceReferenceDialog"
+ x:Class="ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference.AddServiceReferenceDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
@@ -15,9 +15,9 @@
<!--
- http://blogs.msdn.com/b/chkoenig/archive/2008/05/24/hierarchical-databinding-in-wpf.aspx
-http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx?msg=3663052
--->
+ http://blogs.msdn.com/b/chkoenig/archive/2008/05/24/hierarchical-databinding-in-wpf.aspx
+ http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx?msg=3663052
+ -->
<Window.Resources>
<HierarchicalDataTemplate x:Key="HeaderTemplate"
@@ -110,10 +110,16 @@ http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx?msg=3663052
ItemsSource="{Binding Path=TwoValues}">
<ListView.View>
<GridView>
- <GridViewColumn Header="" Width="150" DisplayMemberBinding="{Binding LeftValue}"></GridViewColumn>
- <!--
- <GridViewColumn Header="Value" Width="150" DisplayMemberBinding="{Binding RightValue}"></GridViewColumn>
- -->
+ <GridViewColumn>
+ <GridViewColumn.CellTemplate>
+ <DataTemplate>
+ <StackPanel Orientation="Horizontal">
+ <Image Width="16" Height="16" Source="{Binding Image}"/>
+ <TextBlock Text="{Binding Description}"/>
+ </StackPanel>
+ </DataTemplate>
+ </GridViewColumn.CellTemplate>
+ </GridViewColumn>
</GridView>
</ListView.View>
</ListView>
@@ -16,7 +16,9 @@
using System.Windows.Input;
using System.Windows.Media;
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog
+using ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference;
+
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference
{
/// <summary>
/// Interaction logic for AddServiceReferenceDialog.xaml
@@ -19,16 +19,20 @@
using System.Web.Services.Description;
using System.Web.Services.Discovery;
using System.Windows;
+using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
+using System.Windows.Media.Imaging;
using ICSharpCode.Core;
+using ICSharpCode.Core.Presentation;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Widgets;
+using ICSharpCode.SharpDevelop.Widgets.Resources;
using Microsoft.Win32;
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference
{
/// <summary>
/// Description of AddServiceReferenceViewModel.
@@ -44,7 +48,7 @@ public class AddServiceReferenceViewModel:ViewModelBase
string serviceDescriptionMessage;
string namespacePrefix = String.Empty;
- private ObservableCollection<TwoValue> twoValues;
+ private ObservableCollection<ImageAndDescription> twoValues;
private List<string> mruServices = new List<string>();
private string selectedService;
@@ -75,7 +79,7 @@ public AddServiceReferenceViewModel(IProject project)
GoCommand = new RelayCommand(ExecuteGo,CanExecuteGo);
DiscoverCommand = new RelayCommand(ExecuteDiscover,CanExecuteDiscover);
AdvancedDialogCommand = new RelayCommand(ExecuteAdvancedDialogCommand,CanExecuteAdvancedDialogCommand);
- TwoValues = new ObservableCollection<TwoValue>();
+ TwoValues = new ObservableCollection<ImageAndDescription>();
}
@@ -351,34 +355,33 @@ public string Title
}
- public ObservableCollection<TwoValue> TwoValues {
+ public ObservableCollection<ImageAndDescription> TwoValues {
get { return twoValues; }
set {
twoValues = value;
base.RaisePropertyChanged(() =>TwoValues);
}
}
+ //http://mikehadlow.blogspot.com/2006/06/simple-wsdl-object.html
void UpdateListView ()
{
ServiceDescription desc = null;
TwoValues.Clear();
- string l = String.Empty;
- string r;
if(ServiceItem.Tag is ServiceDescription) {
desc = (ServiceDescription)ServiceItem.Tag;
- r = desc.RetrievalUrl;
- var tv = new TwoValue(l,r);
+ var tv = new ImageAndDescription(PresentationResourceService.GetBitmapSource("Icons.16x16.Interface"),
+ desc.RetrievalUrl);
TwoValues.Add(tv);
}
- else if(ServiceItem.Tag is PortType) {
+ else if(ServiceItem.Tag is PortType)
+ {
PortType portType = (PortType)ServiceItem.Tag;
foreach (Operation op in portType.Operations)
- {
- l = op.Name;
- r = op.Documentation;
- TwoValues.Add(new TwoValue(l,r));
+ {
+ TwoValues.Add(new ImageAndDescription(PresentationResourceService.GetBitmapSource("Icons.16x16.Method"),
+ op.Name));
}
}
}
@@ -418,16 +421,16 @@ void Add(ServiceDescription description)
}
- public class TwoValue
+ public class ImageAndDescription
{
- public TwoValue(string left,string right)
+ public ImageAndDescription(BitmapSource bitmapSource,string description)
{
- LeftValue = left;
- RightValue = right;
+ Image = bitmapSource;
+ Description = description;
}
- public string LeftValue {get;set;}
- public string RightValue {get;set;}
+ public BitmapSource Image {get;set;}
+ public string Description {get;set;}
}
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Window
- x:Class="ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.AdvancedServiceDialog"
+ x:Class="ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference.AdvancedServiceDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog"
+ xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference"
xmlns:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
@@ -0,0 +1,43 @@
+/*
+ * Created by SharpDevelop.
+ * User: Peter Forstmeier
+ * Date: 02.11.2011
+ * Time: 19:49
+ *
+ * To change this template use Tools | Options | Coding | Edit Standard Headers.
+ */
+using System;
+using System.Collections.Generic;
+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;
+
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference
+{
+ /// <summary>
+ /// Interaction logic for AdvancedServiceDialog.xaml
+ /// </summary>
+ public partial class AdvancedServiceDialog : Window
+ {
+ public AdvancedServiceDialog()
+ {
+ InitializeComponent();
+ }
+
+ void okButtonClick(object sender, RoutedEventArgs e)
+ {
+ this.DialogResult = true;
+ Close();
+ }
+
+ void cancelButtonClick(object sender, RoutedEventArgs e)
+ {
+ this.DialogResult = false;
+ Close();
+ }
+ }
+}
@@ -12,7 +12,7 @@
using ICSharpCode.SharpDevelop.Widgets;
-namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog
+namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference
{
/// <summary>
/// Description of AdvancedServiceViewModel.
@@ -8,9 +8,10 @@
using System.Windows.Forms;
using System.Xml;
-using ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
+using ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog;
+using ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
namespace ICSharpCode.SharpDevelop.Project.Commands

0 comments on commit 7784f27

Please sign in to comment.