5 changed files with 454 additions and 20 deletions
@ -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> |
@ -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…
Reference in new issue