7 changed files with 147 additions and 7 deletions
@ -0,0 +1,22 @@ |
|||||||
|
// 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.Core; |
||||||
|
|
||||||
|
namespace ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference |
||||||
|
{ |
||||||
|
public static class ServiceReferenceOptions |
||||||
|
{ |
||||||
|
static Properties properties = PropertyService.Get("ServiceReferenceOptions", new Properties()); |
||||||
|
|
||||||
|
public static bool HasSvcUtilPath { |
||||||
|
get { return !String.IsNullOrEmpty(SvcUtilPath); } |
||||||
|
} |
||||||
|
|
||||||
|
public static string SvcUtilPath { |
||||||
|
get { return properties.Get<string>("SvcUtilPath", null); } |
||||||
|
set { properties.Set("SvcUtilPath", value); } |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,32 @@ |
|||||||
|
<gui:OptionPanel |
||||||
|
x:Class="ICSharpCode.SharpDevelop.Gui.OptionPanels.ServiceReference.ServiceReferenceOptionsPanel" |
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
|
xmlns:core="http://icsharpcode.net/sharpdevelop/core" |
||||||
|
xmlns:sd="clr-namespace:ICSharpCode.SharpDevelop" |
||||||
|
xmlns:gui="clr-namespace:ICSharpCode.SharpDevelop.Gui" |
||||||
|
xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets" |
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||||
|
xmlns:local="clr-namespace:ICSharpCode.SharpDevelop.Gui.OptionPanels"> |
||||||
|
<StackPanel> |
||||||
|
<GroupBox Header="SvcUtil Configuration"> |
||||||
|
<Grid> |
||||||
|
<Grid.ColumnDefinitions> |
||||||
|
<ColumnDefinition Width="Auto"/> |
||||||
|
<ColumnDefinition Width="*"/> |
||||||
|
<ColumnDefinition Width="Auto"/> |
||||||
|
</Grid.ColumnDefinitions> |
||||||
|
|
||||||
|
<Label Content="Path:"/> |
||||||
|
<TextBox |
||||||
|
Grid.Column="1" |
||||||
|
Text="{Binding SvcUtilPath}"/> |
||||||
|
<Button |
||||||
|
Grid.Column="2" |
||||||
|
Content="..." |
||||||
|
Command="{Binding BrowseCommand}" |
||||||
|
Padding="4, 0" |
||||||
|
Margin="4,0"/> |
||||||
|
</Grid> |
||||||
|
</GroupBox> |
||||||
|
</StackPanel> |
||||||
|
</gui:OptionPanel> |
||||||
@ -0,0 +1,63 @@ |
|||||||
|
// 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.ComponentModel; |
||||||
|
using System.Windows.Input; |
||||||
|
|
||||||
|
using ICSharpCode.SharpDevelop.Gui.Dialogs.ReferenceDialog.ServiceReference; |
||||||
|
using ICSharpCode.SharpDevelop.Widgets; |
||||||
|
using Microsoft.Win32; |
||||||
|
|
||||||
|
namespace ICSharpCode.SharpDevelop.Gui.OptionPanels.ServiceReference |
||||||
|
{ |
||||||
|
public partial class ServiceReferenceOptionsPanel : OptionPanel, INotifyPropertyChanged |
||||||
|
{ |
||||||
|
string svcUtilPath; |
||||||
|
bool changed; |
||||||
|
|
||||||
|
public ServiceReferenceOptionsPanel() |
||||||
|
{ |
||||||
|
InitializeComponent(); |
||||||
|
BrowseCommand = new RelayCommand(Browse); |
||||||
|
svcUtilPath = ServiceReferenceOptions.SvcUtilPath; |
||||||
|
DataContext = this; |
||||||
|
} |
||||||
|
|
||||||
|
public ICommand BrowseCommand { get; private set; } |
||||||
|
|
||||||
|
void Browse() |
||||||
|
{ |
||||||
|
var dialog = new OpenFileDialog(); |
||||||
|
if (dialog.ShowDialog() ?? false) { |
||||||
|
SvcUtilPath = dialog.FileName; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public string SvcUtilPath { |
||||||
|
get { return svcUtilPath; } |
||||||
|
set { |
||||||
|
svcUtilPath = value; |
||||||
|
changed = true; |
||||||
|
OnPropertyChanged("SvcUtilPath"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public override bool SaveOptions() |
||||||
|
{ |
||||||
|
if (changed) { |
||||||
|
ServiceReferenceOptions.SvcUtilPath = svcUtilPath; |
||||||
|
} |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
public event PropertyChangedEventHandler PropertyChanged; |
||||||
|
|
||||||
|
void OnPropertyChanged(string name) |
||||||
|
{ |
||||||
|
if (PropertyChanged != null) { |
||||||
|
PropertyChanged(this, new PropertyChangedEventArgs(name)); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue