Browse Source

AdvancedServiceDialog.xaml (ChildDialog of AddServiceReferenceDialog.xaml

pull/23/head
PeterForstmeier 14 years ago
parent
commit
32ff71c147
  1. 6
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  2. 13
      src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddServiceReferenceDialog.xaml
  3. 20
      src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddServiceReferenceViewModel.cs
  4. 201
      src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AdvancedServiceDialog.xaml
  5. 196
      src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AdvancedServiceViewModel.cs

6
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -254,6 +254,11 @@ @@ -254,6 +254,11 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\AddServiceReferenceViewModel.cs" />
<Compile Include="Src\Gui\Dialogs\ReferenceDialog\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\ToolNotFoundDialog.cs" />
<Compile Include="Src\Gui\Dialogs\ToolNotFoundDialog.Designer.cs">
@ -838,6 +843,7 @@ @@ -838,6 +843,7 @@
</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\Services\RefactoringService\ContextActions\ContextActionsBulbControl.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsControl.xaml" />
<Page Include="Src\Services\RefactoringService\ContextActions\ContextActionsHeaderedControl.xaml" />

13
src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddServiceReferenceDialog.xaml

@ -128,11 +128,21 @@ http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx?msg=3663052 @@ -128,11 +128,21 @@ http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx?msg=3663052
Margin="4" Background="White"
Text="{Binding DefaultNameSpace}">
</TextBox>
<Grid Grid.Row="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="2*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Content="Advanced..."
Command="{Binding AdvancedDialogCommand}"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Margin="0,4,12,12">
</Button>
<widgets:UniformGridWithSpacing
Columns="2"
Grid.Column="2"
Grid.Row="8"
HorizontalAlignment="Right"
Margin="0,4,12,12">
<Button
@ -149,4 +159,5 @@ http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx?msg=3663052 @@ -149,4 +159,5 @@ http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx?msg=3663052
Click="cancelButtonClick" />
</widgets:UniformGridWithSpacing>
</Grid>
</Grid>
</Window>

20
src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AddServiceReferenceViewModel.cs

@ -74,6 +74,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog @@ -74,6 +74,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog
GoCommand = new RelayCommand(ExecuteGo,CanExecuteGo);
DiscoverCommand = new RelayCommand(ExecuteDiscover,CanExecuteDiscover);
AdvancedDialogCommand = new RelayCommand(ExecuteAdvancedDialogCommand,CanExecuteAdvancedDialogCommand);
TwoValues = new ObservableCollection<TwoValue>();
}
@ -117,6 +118,25 @@ namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog @@ -117,6 +118,25 @@ namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog
#endregion
#region AdvancedDialogCommand
public System.Windows.Input.ICommand AdvancedDialogCommand {get;private set;}
private bool CanExecuteAdvancedDialogCommand ()
{
return true;
}
private void ExecuteAdvancedDialogCommand ()
{
var vm = new AdvancedServiceViewModel();
var view = new AdvancedServiceDialog();
view.DataContext = vm;
view.ShowDialog();
}
#endregion
#region discover service Code from Matt

201
src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AdvancedServiceDialog.xaml

@ -0,0 +1,201 @@ @@ -0,0 +1,201 @@
<?xml version="1.0" encoding="utf-8"?>
<Window
x:Class="ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.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:core="http://icsharpcode.net/sharpdevelop/core"
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui"
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
Width="700" Height="600"
Title="{Binding Title}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition
Height="Auto"></RowDefinition>
<RowDefinition
Height="Auto"></RowDefinition>
<RowDefinition
Height="Auto"></RowDefinition>
<RowDefinition Height="40"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition ></ColumnDefinition>
<ColumnDefinition ></ColumnDefinition>
</Grid.ColumnDefinitions>
<GroupBox
Header="Client"
Grid.ColumnSpan="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Margin="25,0,0,0"
Text="Access level for generated classes:"></TextBlock>
<ComboBox
Grid.Column="1 " Margin="4"
gui:EnumBinding.EnumType="{x:Type local:Modifyers}" SelectedValue="{Binding SelectedModifyer}">
</ComboBox>
<CheckBox
Grid.Row="1" Margin="25,0,0,0"
VerticalAlignment="Center"
IsChecked="{Binding GenerateAsyncOperations}"
Content="Generate asynchronous operations"></CheckBox>
</Grid>
</GroupBox>
<GroupBox
Header="Data Type"
Grid.Row="1"
Grid.ColumnSpan="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="30"></RowDefinition>
<RowDefinition
Height="130"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<CheckBox
Margin="25,0,0,0"
VerticalAlignment="Center"
IsChecked="{Binding GenerateMessageContract}"
Content="Allways generate message contracts"></CheckBox>
<TextBlock
Margin="25,0,0,0"
Grid.Row="1"
VerticalAlignment="Center"
Text="Collection type:"></TextBlock>
<ComboBox
Grid.Row="1" Grid.Column="2" Margin="4"
gui:EnumBinding.EnumType="{x:Type local:CollectionTypes}"
SelectedValue="{Binding CollectionType}">
</ComboBox>
<TextBlock
Grid.Row="2"
Margin="25,0,0,0"
VerticalAlignment="Center"
Text="Dictionary collection type:"></TextBlock>
<ComboBox
Grid.Row="2"
Grid.Column="1" Margin="4"
gui:EnumBinding.EnumType="{x:Type local:DictionaryCollectionTypes}"
SelectedValue="{Binding DictionaryCollectionType}">
</ComboBox>
<CheckBox
VerticalAlignment="Center" Grid.Row="3"
Margin="25,0,0,0"
IsChecked="{Binding UseReferencedAssemblies}"
Content="Reuse types in referenced assemblies">
</CheckBox>
<RadioButton Grid.Row="4" Margin="45,0,0,0"
VerticalAlignment="Center"
GroupName="ReferenceType"
IsChecked="{Binding ReuseTypes}"
Content="Reuse types in all referenced assemblies">
</RadioButton>
<RadioButton Grid.Row="5" Margin="45,0,0,0"
VerticalAlignment="Center"
GroupName="ReferenceType"
IsChecked="{Binding ReuseReferencedTypes}"
Content="Reuse types in specified referenced assemblies">
</RadioButton>
<ListView Grid.Row="6" Grid.ColumnSpan="2" Width="400"
Margin="80,0,0,0"
ItemsSource="{Binding AssembliesToReference}"
IsEnabled="{Binding ListViewEnable}">
<!--
<ListView.View>
<GridView>
<GridViewColumn Header="ID" DisplayMemberBinding="{Binding ID}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Tag="{Binding}" Name="Complete" IsThreeState="False" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>-->
</ListView>
</Grid>
</GroupBox>
<GroupBox Grid.Row="2" Grid.ColumnSpan="2"
Header="Compatibility">
<Grid>
<Grid.RowDefinitions>
<RowDefinition
Height="Auto"></RowDefinition>
<RowDefinition
Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<TextBox
Margin="25,0,0,0"
Text="{Binding CompatibilityText, Mode=OneWay}"
Height="50" TextWrapping="Wrap"></TextBox>
<Button
Grid.Row="2"
Margin="25,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="Add Web Reference..." Width="140">
</Button>
</Grid>
</GroupBox>
<widgets:UniformGridWithSpacing
Grid.Row="3" Grid.Column="1"
Columns="2"
HorizontalAlignment="Right"
Margin="0,4,12,12">
<Button
Content="{core:Localize Global.OKButtonText}"
IsDefault="True"
Name="okButton"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Click="okButtonClick" />
<Button
Content="{core:Localize Global.CancelButtonText}"
IsCancel="True"
Name="cancelButton"
Style="{x:Static core:GlobalStyles.ButtonStyle}"
Click="cancelButtonClick" />
</widgets:UniformGridWithSpacing>
</Grid>
</Window>

196
src/Main/Base/Project/Src/Gui/Dialogs/ReferenceDialog/AdvancedServiceViewModel.cs

@ -0,0 +1,196 @@ @@ -0,0 +1,196 @@
/*
* Created by SharpDevelop.
* User: Peter Forstmeier
* Date: 02.11.2011
* Time: 19:50
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using ICSharpCode.SharpDevelop.Widgets;
namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog
{
/// <summary>
/// Description of AdvancedServiceViewModel.
/// </summary>
///
public enum Modifyers
{
//[Description("${res:Dialog.ProjectOptions.RunPostBuildEvent.Always}")]
Public,
//[Description("${res:Dialog.ProjectOptions.RunPostBuildEvent.OnOutputUpdated}")]
Internal
}
public enum CollectionTypes
{
[Description("System.Array")]
Array,
[Description("System.Collections.ArrayList")]
ArrayList,
[Description("System.Collections.Generic.LinkedList")]
LinkedList,
[Description("System.Collections.Generic.List")]
List,
[Description("System.Collections.ObjectModel.Collection")]
Collection,
[Description("System.Collections.ObjectModel.ObservableCollection")]
ObservableCollection,
[Description("System.ComponentModel.BindingList")]
BindingList
}
public enum DictionaryCollectionTypes
{
Dictionary,
SortedList,
SortedDictionary,
HashTable,
KeyedCollection,
SortedList_2,
HybridDictionary,
ListDictionary,
OrderedDictionary
}
internal class AdvancedServiceViewModel:ViewModelBase
{
private string compatibilityText ="Add a web Reference instead of a Service Reference. ";
private string c_2 ="thios will generate code base on .NET Framework 2.0 Web services technology";
public AdvancedServiceViewModel()
{
Title ="Service Reference Settings";
UseReferencedAssemblies = true;
AssembliesToReference = new ObservableCollection <string>();
AssembliesToReference.Add("Microsoft.CSharp");
AssembliesToReference.Add("mscorlib");
AssembliesToReference.Add("System.Core");
AssembliesToReference.Add("System.Data");
AssembliesToReference.Add("System.Data.DataSetExtensions");
AssembliesToReference.Add("System.Runtime.Serialization");
AssembliesToReference.Add("System.ServiceModel");
AssembliesToReference.Add("System.Xml");
AssembliesToReference.Add("System.Xml.Linq");
}
public string Title {get;set;}
private Modifyers selectedModifyer;
public Modifyers SelectedModifyer {
get { return selectedModifyer; }
set { selectedModifyer = value;
base.RaisePropertyChanged(() =>SelectedModifyer); }
}
bool generateAsyncOperations;
public bool GenerateAsyncOperations {
get { return generateAsyncOperations; }
set { generateAsyncOperations = value;
base.RaisePropertyChanged(() =>GenerateAsyncOperations);}
}
bool generateMessageContract;
public bool GenerateMessageContract {
get { return generateMessageContract; }
set { generateMessageContract = value;
base.RaisePropertyChanged(() =>GenerateMessageContract);}
}
private CollectionTypes collectionType;
public CollectionTypes CollectionType {
get { return collectionType; }
set { collectionType = value;
base.RaisePropertyChanged(() =>CollectionType);}
}
private DictionaryCollectionTypes dictionaryCollectionType;
public DictionaryCollectionTypes DictionaryCollectionType {
get { return dictionaryCollectionType; }
set { dictionaryCollectionType = value;
base.RaisePropertyChanged(() =>DictionaryCollectionType);}
}
private bool useReferencedAssemblies;
public bool UseReferencedAssemblies {
get { return useReferencedAssemblies; }
set { useReferencedAssemblies = value;
if (useReferencedAssemblies) {
ReuseTypes = true;
}
else {
ReuseTypes = false;
}
base.RaisePropertyChanged(() =>UseReferencedAssemblies);}
}
private bool reuseTypes;
public bool ReuseTypes {
get { return reuseTypes; }
set { reuseTypes = value;
if (reuseTypes) {
}
else
{
}
base.RaisePropertyChanged(() =>ReuseTypes);}
}
private bool reuseReferencedTypes;
public bool ReuseReferencedTypes {
get { return reuseReferencedTypes; }
set { reuseReferencedTypes = value;
if (reuseReferencedTypes)
{
ListViewEnable = true;
} else
{
ListViewEnable = false;
}
base.RaisePropertyChanged(() => ReuseReferencedTypes);}
}
private bool listViewEnable;
public bool ListViewEnable {
get { return listViewEnable; }
set { listViewEnable = value;
base.RaisePropertyChanged(() => ListViewEnable);}
}
public ObservableCollection <string> AssembliesToReference {get;private set;}
public string CompatibilityText
{
get {
return compatibilityText + c_2;
}
}
}
}
Loading…
Cancel
Save