Skip to content
Browse files

Support for saving project files

-Added icons for toolbar items
-Added Expression Dark skin and skinned UI elements
  • Loading branch information...
1 parent 30c9743 commit a29a849b1fffec59a8e71bad7b9ff98052eacd9b @HEskandari HEskandari committed
View
62 Rhino.Licensing.AdminTool.Tests/Dialogs/FileDialogTests.cs
@@ -1,17 +1,16 @@
-using System.Windows.Forms;
using Rhino.Licensing.AdminTool.ViewModels;
using Rhino.Mocks;
using Xunit;
using System.Linq;
using Xunit.Extensions;
-using FileDialog = Rhino.Licensing.AdminTool.Dialogs.FileDialog;
-using DialogForm = System.Windows.Forms.FileDialog;
-
+using DialogForm = System.Windows.Forms.FileDialog;
+using OpenFileDialog = Rhino.Licensing.AdminTool.Dialogs.OpenFileDialog;
+
namespace Rhino.Licensing.AdminTool.Tests.Dialogs
{
public class FileDialogTests
{
- private DialogForm _dialogForm;
+ private readonly DialogForm _dialogForm;
public FileDialogTests()
{
@@ -21,10 +20,10 @@ public FileDialogTests()
[Fact]
public void ShowDialog_Sets_Selected_Files()
{
- var model = new OpenFileDialogViewModel();
- var dialog = new TestFileDialog(_dialogForm, model);
+ var model = new OpenFileDialogViewModel();
+ var dialog = new TestOpenFileDialog(_dialogForm) { ViewModel = model };
- _dialogForm.Expect(x => x.ShowDialog()).Return(DialogResult.OK);
+ _dialogForm.Expect(x => x.ShowDialog()).Return(System.Windows.Forms.DialogResult.OK);
_dialogForm.Expect(x => x.FileName).Return("License.lic");
_dialogForm.Expect(x => x.FileNames).Return(new[] {"License.lic", "License2.lic"});
@@ -39,8 +38,8 @@ public void ShowDialog_Sets_Selected_Files()
[Fact]
public void Dialog_Disposes_Upon_Destruction()
{
- var model = new OpenFileDialogViewModel();
- var dialog = new TestFileDialog(_dialogForm, model);
+ var model = new OpenFileDialogViewModel();
+ var dialog = new TestOpenFileDialog(_dialogForm) { ViewModel = model };
dialog.ShowDialog();
dialog.Dispose();
@@ -49,13 +48,13 @@ public void Dialog_Disposes_Upon_Destruction()
}
[Theory]
- [InlineData(DialogResult.OK, true)]
- [InlineData(DialogResult.Cancel, false)]
- [InlineData(DialogResult.Abort, null)]
- public void DialogResult_Maps_To_ViewModel_Result(DialogResult dialogResult, bool? mappedResult)
+ [InlineData(System.Windows.Forms.DialogResult.OK, true)]
+ [InlineData(System.Windows.Forms.DialogResult.Cancel, false)]
+ [InlineData(System.Windows.Forms.DialogResult.Abort, null)]
+ public void DialogResult_Maps_To_ViewModel_Result(System.Windows.Forms.DialogResult dialogResult, bool? mappedResult)
{
var model = new OpenFileDialogViewModel();
- var dialog = new TestFileDialog(_dialogForm, model);
+ var dialog = new TestOpenFileDialog(_dialogForm) { ViewModel = model };
_dialogForm.Expect(x => x.ShowDialog()).Return(dialogResult);
@@ -64,26 +63,19 @@ public void DialogResult_Maps_To_ViewModel_Result(DialogResult dialogResult, boo
Assert.Equal(mappedResult, model.Result);
}
- public class TestFileDialog : FileDialog
- {
- private readonly System.Windows.Forms.FileDialog _dialog;
- private readonly IFileDialogViewModel _viewModel;
-
- public TestFileDialog(System.Windows.Forms.FileDialog dialog, IFileDialogViewModel viewModel)
- {
- _dialog = dialog;
- _viewModel = viewModel;
- }
-
- protected override System.Windows.Forms.FileDialog Dialog
- {
- get { return _dialog; }
- }
-
- public override IFileDialogViewModel ViewModel
- {
- get { return _viewModel; }
- }
+ public class TestOpenFileDialog : OpenFileDialog
+ {
+ private readonly DialogForm _form;
+
+ public TestOpenFileDialog(DialogForm form)
+ {
+ _form = form;
+ }
+
+ protected override DialogForm Dialog
+ {
+ get { return _form; }
+ }
}
}
}
View
2 Rhino.Licensing.AdminTool.Tests/Dialogs/OpenFileDialogTests.cs
@@ -53,8 +53,8 @@ private IOpenFileDialogViewModel CreateOpenFileDialogModel()
public class OpenFileDialogStub : OpenFileDialog
{
public OpenFileDialogStub(IOpenFileDialogViewModel viewModel)
- : base(viewModel)
{
+ base.ViewModel = viewModel;
}
public System.Windows.Forms.OpenFileDialog GetCoreDialog()
View
2 Rhino.Licensing.AdminTool.Tests/Dialogs/SaveFileDialogTests.cs
@@ -55,8 +55,8 @@ private ISaveFileDialogViewModel CreateSaveFileDialogModel()
public class SaveFileDialogStub : SaveFileDialog
{
public SaveFileDialogStub(ISaveFileDialogViewModel viewModel)
- : base(viewModel)
{
+ base.ViewModel = viewModel;
}
public System.Windows.Forms.SaveFileDialog GetCoreDialog()
View
12 Rhino.Licensing.AdminTool.Tests/Services/DialogServiceTests.cs
@@ -15,12 +15,12 @@ public void Can_Show_OpenFileDialog()
{
var model = CreateOpenFileDialogModel(true);
var factory = MockRepository.GenerateMock<IDialogFactory>();
- var dialog = MockRepository.GenerateMock<OpenFileDialog>(model);
+ var dialog = MockRepository.GenerateMock<OpenFileDialog>();
- factory.Expect(x => x.Create<OpenFileDialog>()).Return(dialog);
+ factory.Expect(x => x.Create<OpenFileDialog, IOpenFileDialogViewModel>(Arg.Is(model))).Return(dialog);
dialog.Expect(x => x.ViewModel).Return(model);
- new DialogService(factory).ShowOpenFileDialog();
+ new DialogService(factory).ShowOpenFileDialog(model);
dialog.AssertWasCalled(x => x.ShowDialog(), x => x.Repeat.Once());
}
@@ -30,13 +30,13 @@ public void Can_Show_SaveFileDialog()
{
var model = CreateSaveFileDialogModel(true);
var factory = MockRepository.GenerateMock<IDialogFactory>();
- var dialog = MockRepository.GenerateMock<SaveFileDialog>(model);
+ var dialog = MockRepository.GenerateMock<SaveFileDialog>();
var service = new DialogService(factory) as IDialogService;
- factory.Expect(x => x.Create<SaveFileDialog>()).Return(dialog);
+ factory.Expect(x => x.Create<SaveFileDialog, ISaveFileDialogViewModel>(Arg.Is(model))).Return(dialog);
- service.ShowSaveFileDialog();
+ service.ShowSaveFileDialog(model);
dialog.AssertWasCalled(x => x.ShowDialog(), x => x.Repeat.Once());
}
View
73 Rhino.Licensing.AdminTool.Tests/ViewModels/ProjectViewModelTests.cs
@@ -82,33 +82,26 @@ public void Can_Save_If_Name_Is_Provided()
[Fact]
public void Save_Action_Will_Open_SaveDialog()
- {
- _dialogService.Expect(x => x.ShowSaveFileDialog())
- .Return(new SaveFileDialogViewModel
- {
- Result = true
- });
+ {
+ var dialogModel = new SaveFileDialogViewModel {Result = true};
+ _dialogService.Expect(x => x.ShowSaveFileDialog(dialogModel));
- var vm = CreateViewModel();
+ var vm = CreateViewModel(dialogModel);
vm.Save();
- _dialogService.AssertWasCalled(x => x.ShowSaveFileDialog(), x => x.Repeat.Once());
+ _dialogService.AssertWasCalled(x => x.ShowSaveFileDialog(Arg.Is(dialogModel)), x => x.Repeat.Once());
}
[Fact]
public void Save_Action_Will_Call_ProjectService_If_Proper_Result_Is_Set()
{
var existingFile = Path.GetTempFileName();
- var choosenFile = new FileInfo(existingFile);
+ var choosenFile = new FileInfo(existingFile);
+ var model = new SaveFileDialogViewModel {Result = true, FileName = existingFile};
- _dialogService.Expect(x => x.ShowSaveFileDialog())
- .Return(new SaveFileDialogViewModel
- {
- Result = true,
- FileName = existingFile
- });
+ _dialogService.Expect(x => x.ShowSaveFileDialog(model));
- var vm = CreateViewModel();
+ var vm = CreateViewModel(model);
vm.Save();
_projectService.Expect(x => x.Save(Arg<Project>.Is.Anything, Arg.Is(choosenFile))).Repeat.Once();
@@ -117,15 +110,10 @@ public void Save_Action_Will_Call_ProjectService_If_Proper_Result_Is_Set()
[Fact]
public void Will_Not_Proceed_To_Save_When_No_File_Is_Selected()
{
- var vm = CreateViewModel();
-
- _dialogService.Expect(x => x.ShowSaveFileDialog())
- .Return(new SaveFileDialogViewModel
- {
- Result = true,
- FileName = null
- });
-
+ var dialogModel = new SaveFileDialogViewModel {Result = true, FileName = null};
+ _dialogService.Expect(x => x.ShowSaveFileDialog(dialogModel));
+
+ var vm = CreateViewModel(dialogModel);
vm.Save();
_projectService.AssertWasNotCalled(x => x.Save(Arg<Project>.Is.Anything, Arg<FileInfo>.Is.Anything));
@@ -143,11 +131,42 @@ public void Can_Generate_Key_Pair()
Assert.NotNull(vm.CurrentProject.Product.PrivateKey);
Assert.Contains("<P>", vm.CurrentProject.Product.PrivateKey); //Makes sure it is only private
Assert.Contains("<Modulus>", vm.CurrentProject.Product.PublicKey); //Makes sure it is public
+ }
+
+ [Fact]
+ public void Default_Project_Save_Dialog()
+ {
+ var vm = new ProjectViewModel(_projectService, _dialogService);
+ var dialogModel = vm.CreateSaveDialogModel();
+
+ Assert.Equal("Rhino License|*.rlic", dialogModel.Filter);
+ Assert.True(dialogModel.OverwritePrompt);
}
- private ProjectViewModel CreateViewModel()
+ private ProjectViewModel CreateViewModel(ISaveFileDialogViewModel model)
{
- return new ProjectViewModel(_projectService, _dialogService);
+ return new TestProjectViewModel(_projectService, _dialogService, model);
+ }
+
+ private ProjectViewModel CreateViewModel()
+ {
+ return new TestProjectViewModel(_projectService, _dialogService, null);
+ }
+
+ public class TestProjectViewModel : ProjectViewModel
+ {
+ private readonly ISaveFileDialogViewModel _dialogModel;
+
+ public TestProjectViewModel(IProjectService projectService, IDialogService dialogService, ISaveFileDialogViewModel model)
+ : base(projectService, dialogService)
+ {
+ _dialogModel = model;
+ }
+
+ public override ISaveFileDialogViewModel CreateSaveDialogModel()
+ {
+ return _dialogModel;
+ }
}
}
}
View
1 Rhino.Licensing.AdminTool/App.xaml
@@ -6,6 +6,7 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Theme/ExpressionDark.xaml" />
+ <ResourceDictionary Source="/Theme/AppStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
View
32 Rhino.Licensing.AdminTool/Dialogs/FileDialog.cs
@@ -4,8 +4,11 @@
namespace Rhino.Licensing.AdminTool.Dialogs
{
- public abstract class FileDialog : IDisposable
- {
+ public abstract class FileDialog<T> : IDisposable
+ where T : IFileDialogViewModel
+ {
+ private T _viewModel;
+
public virtual void ShowDialog()
{
var result = Dialog.ShowDialog();
@@ -15,16 +18,25 @@ public virtual void ShowDialog()
ViewModel.Result = MappedResult(result);
}
- protected abstract System.Windows.Forms.FileDialog Dialog
+ protected abstract FileDialog Dialog
{
get;
- }
-
- public abstract IFileDialogViewModel ViewModel
- {
- get;
- }
-
+ }
+
+ public virtual T ViewModel
+ {
+ get { return _viewModel; }
+ set
+ {
+ _viewModel = value;
+ BindDialogToViewModel();
+ }
+ }
+
+ protected virtual void BindDialogToViewModel()
+ {
+ }
+
public void Dispose()
{
Dispose(true);
View
72 Rhino.Licensing.AdminTool/Dialogs/OpenFileDialog.cs
@@ -1,38 +1,36 @@
-using Rhino.Licensing.AdminTool.ViewModels;
-using OpenDialog = System.Windows.Forms.OpenFileDialog;
-
-namespace Rhino.Licensing.AdminTool.Dialogs
-{
- public class OpenFileDialog : FileDialog
- {
- private readonly OpenDialog _openFileDialog;
- private readonly IOpenFileDialogViewModel _viewModel;
-
- public OpenFileDialog(IOpenFileDialogViewModel viewModel)
- {
- _viewModel = viewModel;
- _openFileDialog = new OpenDialog
- {
- AddExtension = viewModel.AddExtension,
- CheckFileExists = viewModel.CheckFileExists,
- CheckPathExists = viewModel.CheckPathExists,
- DefaultExt = viewModel.DefaultExtension,
- FileName = viewModel.FileName,
- Filter = viewModel.Filter,
- InitialDirectory = viewModel.InitialDirectory,
- Multiselect = viewModel.MultiSelect,
- Title = viewModel.Title
- };
- }
-
- protected override System.Windows.Forms.FileDialog Dialog
- {
- get { return _openFileDialog; }
- }
-
- public override IFileDialogViewModel ViewModel
- {
- get { return _viewModel; }
- }
- }
+using System.Windows.Forms;
+using Rhino.Licensing.AdminTool.ViewModels;
+using OpenDialog = System.Windows.Forms.OpenFileDialog;
+
+namespace Rhino.Licensing.AdminTool.Dialogs
+{
+ public class OpenFileDialog : FileDialog<IOpenFileDialogViewModel>
+ {
+ private readonly OpenDialog _openFileDialog;
+
+ public OpenFileDialog()
+ {
+ _openFileDialog = new OpenDialog();
+ }
+
+ protected override FileDialog Dialog
+ {
+ get { return _openFileDialog; }
+ }
+
+ protected override void BindDialogToViewModel()
+ {
+ base.BindDialogToViewModel();
+
+ _openFileDialog.AddExtension = ViewModel.AddExtension;
+ _openFileDialog.CheckFileExists = ViewModel.CheckFileExists;
+ _openFileDialog.CheckPathExists = ViewModel.CheckPathExists;
+ _openFileDialog.DefaultExt = ViewModel.DefaultExtension;
+ _openFileDialog.FileName = ViewModel.FileName;
+ _openFileDialog.Filter = ViewModel.Filter;
+ _openFileDialog.InitialDirectory = ViewModel.InitialDirectory;
+ _openFileDialog.Multiselect = ViewModel.MultiSelect;
+ _openFileDialog.Title = ViewModel.Title;
+ }
+ }
}
View
77 Rhino.Licensing.AdminTool/Dialogs/SaveFileDialog.cs
@@ -1,41 +1,38 @@
-using Rhino.Licensing.AdminTool.ViewModels;
-using SaveDialog = System.Windows.Forms.SaveFileDialog;
-
-
-namespace Rhino.Licensing.AdminTool.Dialogs
-{
- public class SaveFileDialog : FileDialog
- {
- private readonly ISaveFileDialogViewModel _viewModel;
- private readonly SaveDialog _dialog;
-
- public SaveFileDialog(ISaveFileDialogViewModel viewModel)
- {
- _viewModel = viewModel;
- _dialog = new SaveDialog
- {
- AddExtension = viewModel.AddExtension,
- CheckFileExists = viewModel.CheckFileExists,
- CheckPathExists = viewModel.CheckPathExists,
- DefaultExt = viewModel.DefaultExtension,
- FileName = viewModel.FileName,
- Filter = viewModel.Filter,
- InitialDirectory = viewModel.InitialDirectory,
- Title = viewModel.Title,
- AutoUpgradeEnabled = true,
- OverwritePrompt = viewModel.OverwritePrompt,
- SupportMultiDottedExtensions = viewModel.SupportMultiDottedExtensions,
- };
- }
-
- protected override System.Windows.Forms.FileDialog Dialog
- {
- get { return _dialog; }
- }
-
- public override IFileDialogViewModel ViewModel
- {
- get { return _viewModel; }
- }
- }
+using System.Windows.Forms;
+using Rhino.Licensing.AdminTool.ViewModels;
+using SaveDialog = System.Windows.Forms.SaveFileDialog;
+
+namespace Rhino.Licensing.AdminTool.Dialogs
+{
+ public class SaveFileDialog : FileDialog<ISaveFileDialogViewModel>
+ {
+ private readonly SaveDialog _dialog;
+
+ public SaveFileDialog()
+ {
+ _dialog = new SaveDialog();
+ }
+
+ protected override FileDialog Dialog
+ {
+ get { return _dialog; }
+ }
+
+ protected override void BindDialogToViewModel()
+ {
+ base.BindDialogToViewModel();
+
+ _dialog.AddExtension = ViewModel.AddExtension;
+ _dialog.CheckFileExists = ViewModel.CheckFileExists;
+ _dialog.CheckPathExists = ViewModel.CheckPathExists;
+ _dialog.DefaultExt = ViewModel.DefaultExtension;
+ _dialog.FileName = ViewModel.FileName;
+ _dialog.Filter = ViewModel.Filter;
+ _dialog.InitialDirectory = ViewModel.InitialDirectory;
+ _dialog.Title = ViewModel.Title;
+ _dialog.AutoUpgradeEnabled = true;
+ _dialog.OverwritePrompt = ViewModel.OverwritePrompt;
+ _dialog.SupportMultiDottedExtensions = ViewModel.SupportMultiDottedExtensions;
+ }
+ }
}
View
19 Rhino.Licensing.AdminTool/Factories/IDialogFactory.cs
@@ -4,18 +4,21 @@
namespace Rhino.Licensing.AdminTool.Factories
{
public interface IDialogFactory
- {
- /// <summary>
- /// Creates a new FileDialog
- /// </summary>
- /// <typeparam name="T"></typeparam>
- /// <returns></returns>
- T Create<T>() where T : FileDialog;
+ {
+ /// <summary>
+ /// Creates a new FileDialog
+ /// </summary>
+ /// <typeparam name="T">dialog Type</typeparam>
+ /// <typeparam name="TViewModel">viewModel</typeparam>
+ /// <returns></returns>
+ T Create<T, TViewModel>(TViewModel viewModel)
+ where T : FileDialog<TViewModel>
+ where TViewModel : IFileDialogViewModel;
/// <summary>
/// Releases file dialog for garbage collection
/// </summary>
/// <param name="dialog"></param>
- void Release(FileDialog dialog);
+ void Release(object dialog);
}
}
View
BIN Rhino.Licensing.AdminTool/Images/Close.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Rhino.Licensing.AdminTool/Images/Copy.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Rhino.Licensing.AdminTool/Images/GenerateKey.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Rhino.Licensing.AdminTool/Images/New.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Rhino.Licensing.AdminTool/Images/NewLicense.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Rhino.Licensing.AdminTool/Images/Open.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Rhino.Licensing.AdminTool/Images/Paste.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN Rhino.Licensing.AdminTool/Images/Save.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
400 Rhino.Licensing.AdminTool/Rhino.Licensing.AdminTool.csproj
@@ -1,198 +1,216 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
- <ProductVersion>8.0.30703</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{9C11E95F-82A2-4A40-8E15-33487A64F7D2}</ProjectGuid>
- <OutputType>WinExe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Rhino.Licensing.AdminTool</RootNamespace>
- <AssemblyName>Rhino.Licensing.AdminTool</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <TargetFrameworkProfile>
- </TargetFrameworkProfile>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- <WarningLevel>4</WarningLevel>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <PlatformTarget>x86</PlatformTarget>
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup>
- <ApplicationIcon>App.ico</ApplicationIcon>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Caliburn.Core">
- <HintPath>..\SharedLibs\Caliburn.Core.dll</HintPath>
- </Reference>
- <Reference Include="Caliburn.PresentationFramework">
- <HintPath>..\SharedLibs\Caliburn.PresentationFramework.dll</HintPath>
- </Reference>
- <Reference Include="Caliburn.ShellFramework">
- <HintPath>..\SharedLibs\Caliburn.ShellFramework.dll</HintPath>
- </Reference>
- <Reference Include="Caliburn.Windsor">
- <HintPath>..\SharedLibs\Caliburn.Windsor.dll</HintPath>
- </Reference>
- <Reference Include="Castle.Core">
- <HintPath>..\SharedLibs\Castle.Core.dll</HintPath>
- </Reference>
- <Reference Include="Castle.DynamicProxy2">
- <HintPath>..\SharedLibs\Castle.DynamicProxy2.dll</HintPath>
- </Reference>
- <Reference Include="Castle.MicroKernel">
- <HintPath>..\SharedLibs\Castle.MicroKernel.dll</HintPath>
- </Reference>
- <Reference Include="Castle.Windsor">
- <HintPath>..\SharedLibs\Castle.Windsor.dll</HintPath>
- </Reference>
- <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\SharedLibs\log4net.dll</HintPath>
- </Reference>
- <Reference Include="Microsoft.Practices.ServiceLocation">
- <HintPath>..\SharedLibs\Microsoft.Practices.ServiceLocation.dll</HintPath>
- </Reference>
- <Reference Include="PresentationCore" />
- <Reference Include="PresentationFramework" />
- <Reference Include="System" />
- <Reference Include="System.Data" />
- <Reference Include="System.Runtime.Serialization" />
- <Reference Include="System.Security" />
- <Reference Include="System.Windows.Forms" />
- <Reference Include="System.Xml" />
- <Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
- <Reference Include="System.Data.DataSetExtensions" />
- <Reference Include="WindowsBase" />
- </ItemGroup>
- <ItemGroup>
- <ApplicationDefinition Include="App.xaml">
- <Generator>MSBuild:Compile</Generator>
- <SubType>Designer</SubType>
- </ApplicationDefinition>
- <Compile Include="App.xaml.cs">
- <DependentUpon>App.xaml</DependentUpon>
- <SubType>Code</SubType>
- </Compile>
- <Compile Include="Controls\FXPopup.cs" />
- <Compile Include="Dialogs\FileDialog.cs" />
- <Compile Include="Dialogs\OpenFileDialog.cs" />
- <Compile Include="Dialogs\SaveFileDialog.cs" />
- <Compile Include="Extensions\ContainerExtensions.cs" />
- <Compile Include="Extensions\ReflectionExtensions.cs" />
- <Compile Include="Extensions\StringExtensions.cs" />
- <Compile Include="Factories\IDialogFactory.cs" />
- <Compile Include="Factories\IViewModelFactory.cs" />
- <Compile Include="Model\Product.cs" />
- <Compile Include="Model\Project.cs" />
- <Compile Include="Services\DialogService.cs" />
- <Compile Include="Services\ProjectService.cs" />
- <Compile Include="Startup\FactoryRegistration.cs" />
- <Compile Include="Startup\GuyWire.cs" />
- <Compile Include="Startup\ServiceRegistration.cs" />
- <Compile Include="Startup\ViewModelRegistration.cs" />
- <Compile Include="Startup\ViewRegistration.cs" />
- <Compile Include="ValueConverters\BoolToVisibilityCollapsedConverter.cs" />
- <Compile Include="ViewModels\AboutViewModel.cs" />
- <Compile Include="ViewModels\FileDialogViewModel.cs" />
- <Compile Include="ViewModels\OpenFileDialogViewModel.cs" />
- <Compile Include="ViewModels\ProjectViewModel.cs" />
- <Compile Include="ViewModels\SaveFileDialogViewModel.cs" />
- <Compile Include="ViewModels\ShellViewModel.cs" />
- <Compile Include="Views\AboutView.xaml.cs">
- <DependentUpon>AboutView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\ProjectView.xaml.cs">
- <DependentUpon>ProjectView.xaml</DependentUpon>
- </Compile>
- <Compile Include="Views\ShellView.xaml.cs">
- <DependentUpon>ShellView.xaml</DependentUpon>
- </Compile>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Properties\AssemblyInfo.cs">
- <SubType>Code</SubType>
- </Compile>
- <AppDesigner Include="Properties\" />
- </ItemGroup>
- <ItemGroup>
- <Page Include="Theme\ExpressionDark.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\AboutView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\ProjectView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- <Page Include="Views\ShellView.xaml">
- <SubType>Designer</SubType>
- <Generator>MSBuild:Compile</Generator>
- </Page>
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5 SP1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <Resource Include="App.ico" />
- </ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9C11E95F-82A2-4A40-8E15-33487A64F7D2}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Rhino.Licensing.AdminTool</RootNamespace>
+ <AssemblyName>Rhino.Licensing.AdminTool</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <TargetFrameworkProfile>
+ </TargetFrameworkProfile>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <WarningLevel>4</WarningLevel>
+ <PublishUrl>publish\</PublishUrl>
+ <Install>true</Install>
+ <InstallFrom>Disk</InstallFrom>
+ <UpdateEnabled>false</UpdateEnabled>
+ <UpdateMode>Foreground</UpdateMode>
+ <UpdateInterval>7</UpdateInterval>
+ <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+ <UpdatePeriodically>false</UpdatePeriodically>
+ <UpdateRequired>false</UpdateRequired>
+ <MapFileExtensions>true</MapFileExtensions>
+ <ApplicationRevision>0</ApplicationRevision>
+ <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+ <IsWebBootstrapper>false</IsWebBootstrapper>
+ <UseApplicationTrust>false</UseApplicationTrust>
+ <BootstrapperEnabled>true</BootstrapperEnabled>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <PlatformTarget>x86</PlatformTarget>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ApplicationIcon>App.ico</ApplicationIcon>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Caliburn.Core">
+ <HintPath>..\SharedLibs\Caliburn.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Caliburn.PresentationFramework">
+ <HintPath>..\SharedLibs\Caliburn.PresentationFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="Caliburn.ShellFramework">
+ <HintPath>..\SharedLibs\Caliburn.ShellFramework.dll</HintPath>
+ </Reference>
+ <Reference Include="Caliburn.Windsor">
+ <HintPath>..\SharedLibs\Caliburn.Windsor.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Core">
+ <HintPath>..\SharedLibs\Castle.Core.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.DynamicProxy2">
+ <HintPath>..\SharedLibs\Castle.DynamicProxy2.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.MicroKernel">
+ <HintPath>..\SharedLibs\Castle.MicroKernel.dll</HintPath>
+ </Reference>
+ <Reference Include="Castle.Windsor">
+ <HintPath>..\SharedLibs\Castle.Windsor.dll</HintPath>
+ </Reference>
+ <Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\SharedLibs\log4net.dll</HintPath>
+ </Reference>
+ <Reference Include="Microsoft.Practices.ServiceLocation">
+ <HintPath>..\SharedLibs\Microsoft.Practices.ServiceLocation.dll</HintPath>
+ </Reference>
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Runtime.Serialization" />
+ <Reference Include="System.Security" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="WindowsBase" />
+ </ItemGroup>
+ <ItemGroup>
+ <ApplicationDefinition Include="App.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </ApplicationDefinition>
+ <Compile Include="App.xaml.cs">
+ <DependentUpon>App.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Controls\FXPopup.cs" />
+ <Compile Include="Dialogs\FileDialog.cs" />
+ <Compile Include="Dialogs\OpenFileDialog.cs" />
+ <Compile Include="Dialogs\SaveFileDialog.cs" />
+ <Compile Include="Extensions\ContainerExtensions.cs" />
+ <Compile Include="Extensions\ReflectionExtensions.cs" />
+ <Compile Include="Extensions\StringExtensions.cs" />
+ <Compile Include="Factories\IDialogFactory.cs" />
+ <Compile Include="Factories\IViewModelFactory.cs" />
+ <Compile Include="Model\Product.cs" />
+ <Compile Include="Model\Project.cs" />
+ <Compile Include="Services\DialogService.cs" />
+ <Compile Include="Services\ProjectService.cs" />
+ <Compile Include="Startup\FactoryRegistration.cs" />
+ <Compile Include="Startup\GuyWire.cs" />
+ <Compile Include="Startup\ServiceRegistration.cs" />
+ <Compile Include="Startup\ViewModelRegistration.cs" />
+ <Compile Include="Startup\ViewRegistration.cs" />
+ <Compile Include="ValueConverters\BoolToVisibilityCollapsedConverter.cs" />
+ <Compile Include="ViewModels\AboutViewModel.cs" />
+ <Compile Include="ViewModels\FileDialogViewModel.cs" />
+ <Compile Include="ViewModels\OpenFileDialogViewModel.cs" />
+ <Compile Include="ViewModels\ProjectViewModel.cs" />
+ <Compile Include="ViewModels\SaveFileDialogViewModel.cs" />
+ <Compile Include="ViewModels\ShellViewModel.cs" />
+ <Compile Include="Views\AboutView.xaml.cs">
+ <DependentUpon>AboutView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Views\ProjectView.xaml.cs">
+ <DependentUpon>ProjectView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Views\ShellView.xaml.cs">
+ <DependentUpon>ShellView.xaml</DependentUpon>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <AppDesigner Include="Properties\" />
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="Theme\AppStyles.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Theme\ExpressionDark.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Views\AboutView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Views\ProjectView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Views\ShellView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ </ItemGroup>
+ <ItemGroup>
+ <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+ <Install>false</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+ <Visible>False</Visible>
+ <ProductName>.NET Framework 3.5 SP1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+ <Visible>False</Visible>
+ <ProductName>Windows Installer 3.1</ProductName>
+ <Install>true</Install>
+ </BootstrapperPackage>
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="App.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\GenerateKey.png" />
+ <Resource Include="Images\New.png" />
+ <Resource Include="Images\NewLicense.png" />
+ <Resource Include="Images\Open.png" />
+ <Resource Include="Images\Save.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Close.png" />
+ </ItemGroup>
+ <ItemGroup>
+ <Resource Include="Images\Copy.png" />
+ <Resource Include="Images\Paste.png" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
- -->
+ -->
</Project>
View
24 Rhino.Licensing.AdminTool/Services/DialogService.cs
@@ -11,13 +11,13 @@ public interface IDialogService
/// Shows a OpenFileDialog
/// </summary>
/// <returns></returns>
- IOpenFileDialogViewModel ShowOpenFileDialog();
+ void ShowOpenFileDialog(IOpenFileDialogViewModel model);
/// <summary>
/// Shows a SaveFileDialog
/// </summary>
/// <returns></returns>
- ISaveFileDialogViewModel ShowSaveFileDialog();
+ void ShowSaveFileDialog(ISaveFileDialogViewModel model);
}
public class DialogService : IDialogService
@@ -29,26 +29,24 @@ public DialogService(IDialogFactory dialogFactory)
_dialogFactory = dialogFactory;
}
- public virtual IOpenFileDialogViewModel ShowOpenFileDialog()
+ public virtual void ShowOpenFileDialog(IOpenFileDialogViewModel model)
{
- var dialog = _dialogFactory.Create<OpenFileDialog>();
-
+ var dialog = _dialogFactory.Create<OpenFileDialog, IOpenFileDialogViewModel>(model);
+
+ dialog.ViewModel = model;
dialog.ShowDialog();
_dialogFactory.Release(dialog);
-
- return dialog.ViewModel as IOpenFileDialogViewModel;
}
- public virtual ISaveFileDialogViewModel ShowSaveFileDialog()
- {
- var dialog = _dialogFactory.Create<SaveFileDialog>();
-
+ public virtual void ShowSaveFileDialog(ISaveFileDialogViewModel model)
+ {
+ var dialog = _dialogFactory.Create<SaveFileDialog, ISaveFileDialogViewModel>(model);
+
+ dialog.ViewModel = model;
dialog.ShowDialog();
_dialogFactory.Release(dialog);
-
- return dialog.ViewModel as ISaveFileDialogViewModel;
}
}
View
12 Rhino.Licensing.AdminTool/Theme/AppStyles.xaml
@@ -0,0 +1,12 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+ <Style TargetType="{x:Type Image}" x:Key="ToolbarImageStyle">
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
+ <Setter Property="Opacity" Value="0.50"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+
+</ResourceDictionary>
View
262 Rhino.Licensing.AdminTool/Theme/ExpressionDark.xaml
@@ -7,6 +7,8 @@
xmlns:cnv="clr-namespace:Rhino.Licensing.AdminTool.ValueConverters">
<cnv:BoolToVisibilityCollapsedConverter x:Key="DefaultBoolToVisibilityCollapsedConverter" />
+ <BorderGapMaskConverter x:Key="BorderGapMaskConverter" />
+ <DropShadowBitmapEffect x:Key="PopupDropShadow" ShadowDepth="1.5" Softness="0.15" />
<FontFamily x:Key="IconFontFamily">Tahoma</FontFamily>
<FontWeight x:Key="IconFontWeight">Normal</FontWeight>
@@ -79,7 +81,9 @@
<Color x:Key="SliderGradEnd">#FF4C4C4C</Color>
<Color x:Key="TabSelectionColor">#808080</Color>
<Color x:Key="MenuTextColor">#FFFFFFFF</Color>
-
+ <Color x:Key="ControlBackgroundColor">#FF333333</Color>
+
+ <SolidColorBrush x:Key="ControlBackgroundBrush" Color="{StaticResource ControlBackgroundColor}" />
<SolidColorBrush x:Key="MenuTextBrush" Color="{StaticResource MenuTextColor}" />
<SolidColorBrush x:Key="TabSelectionBrush" Color="{StaticResource TabSelectionColor}" />
<SolidColorBrush x:Key="LayerChild0Brush" Color="{StaticResource LayerChild0Color}" />
@@ -153,66 +157,6 @@
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
- <LinearGradientBrush x:Key="ProgressBarBackground" EndPoint="1,0" StartPoint="0,0">
- <GradientStop Color="#BABABA" Offset="0"/>
- <GradientStop Color="#C7C7C7" Offset="0.5"/>
- <GradientStop Color="#BABABA" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarBorderBrush" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#B2B2B2" Offset="0"/>
- <GradientStop Color="#8C8C8C" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarGlassyHighlight" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#50FFFFFF" Offset="0.5385"/>
- <GradientStop Color="#00FFFFFF" Offset="0.5385"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarTopHighlight" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#80FFFFFF" Offset="0.05"/>
- <GradientStop Color="#00FFFFFF" Offset="0.25"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarIndicatorAnimatedFill" EndPoint="0,0" StartPoint="-100,0" MappingMode="Absolute">
- <GradientStop Color="#00000000" Offset="0"/>
- <GradientStop Color="#FF000000" Offset="0.4"/>
- <GradientStop Color="#FF000000" Offset="0.6"/>
- <GradientStop Color="#00000000" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarIndicatorDarkEdgeLeft" EndPoint="1,0" StartPoint="0,0">
- <GradientStop Color="#0C000000" Offset="0"/>
- <GradientStop Color="#20000000" Offset="0.3"/>
- <GradientStop Color="#00000000" Offset="1"/>
- </LinearGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarIndicatorDarkEdgeRight" EndPoint="1,0" StartPoint="0,0">
- <GradientStop Color="#00000000" Offset="0"/>
- <GradientStop Color="#20000000" Offset="0.7"/>
- <GradientStop Color="#0C000000" Offset="1"/>
- </LinearGradientBrush>
-
- <RadialGradientBrush x:Key="ProgressBarIndicatorLightingEffectLeft" RelativeTransform="1,0,0,1,0.5,0.5" RadiusX="1" RadiusY="1">
- <GradientStop Color="#60FFFFC4" Offset="0"/>
- <GradientStop Color="#00FFFFC4" Offset="1"/>
- </RadialGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarIndicatorLightingEffect" EndPoint="0,0" StartPoint="0,1">
- <GradientStop Color="#60FFFFC4" Offset="0"/>
- <GradientStop Color="#00FFFFC4" Offset="1"/>
- </LinearGradientBrush>
-
- <RadialGradientBrush x:Key="ProgressBarIndicatorLightingEffectRight" RelativeTransform="1,0,0,1,-0.5,0.5" RadiusX="1" RadiusY="1">
- <GradientStop Color="#60FFFFC4" Offset="0"/>
- <GradientStop Color="#00FFFFC4" Offset="1"/>
- </RadialGradientBrush>
-
- <LinearGradientBrush x:Key="ProgressBarIndicatorGlassyHighlight" EndPoint="0,1" StartPoint="0,0">
- <GradientStop Color="#90FFFFFF" Offset="0.5385"/>
- <GradientStop Color="#00FFFFFF" Offset="0.5385"/>
- </LinearGradientBrush>
-
<!--Window Close Button-->
<DrawingImage x:Key="CloseButton">
<DrawingImage.Drawing>
@@ -324,12 +268,74 @@
</Style>
<!--GroupBox-->
- <Style TargetType="{x:Type GroupBox}">
- <Setter Property="Background" Value="Transparent"/>
- <Setter Property="BorderBrush" Value="{StaticResource ButtonDefaultBorderBrush}"/>
- <Setter Property="BorderThickness" Value="0.5"/>
- </Style>
-
+ <Style TargetType="{x:Type GroupBox}">
+ <Setter Property="BorderBrush" Value="#D5DFE5" />
+ <Setter Property="BorderThickness" Value="1" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type GroupBox}">
+ <Grid SnapsToDevicePixels="true">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="6" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="6" />
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="6" />
+ </Grid.RowDefinitions>
+ <Border Grid.ColumnSpan="4" Grid.RowSpan="4" Background="{DynamicResource LightBrush}" CornerRadius="4,4,4,4" BorderThickness="1,1,1,1" />
+ <Border Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" BorderThickness="1,1,1,1" CornerRadius="4" BorderBrush="{DynamicResource NormalBorderBrush}">
+ <Border.OpacityMask>
+ <MultiBinding Converter="{StaticResource BorderGapMaskConverter}" ConverterParameter="7">
+ <Binding Path="ActualWidth" ElementName="Header" />
+ <Binding Path="ActualWidth" RelativeSource="{RelativeSource Self}" />
+ <Binding Path="ActualHeight" RelativeSource="{RelativeSource Self}" />
+ </MultiBinding>
+ </Border.OpacityMask>
+ <Border BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
+ <Border.BorderBrush>
+ <SolidColorBrush Color="{DynamicResource MainColor}" />
+ </Border.BorderBrush>
+ <Border BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
+ <Border.BorderBrush>
+ <SolidColorBrush Color="{DynamicResource MainColor}" />
+ </Border.BorderBrush>
+ </Border>
+ </Border>
+ </Border>
+ <Border Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="1" Grid.RowSpan="3" Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" />
+ <Border Grid.ColumnSpan="4" Grid.RowSpan="2" Background="{DynamicResource NormalBrush}" BorderThickness="1,1,1,0" CornerRadius="2,2,0,0" x:Name="Main" BorderBrush="{DynamicResource NormalBorderBrush}" />
+ <Rectangle Opacity="1" Stroke="{x:Null}" RadiusX="3" RadiusY="3" VerticalAlignment="Stretch" Height="Auto" x:Name="Shine" Grid.ColumnSpan="4" Grid.RowSpan="2" Margin="1,1,1,1">
+ <Rectangle.Fill>
+ <LinearGradientBrush EndPoint="0.5,0.971" StartPoint="0.5,0.042">
+ <GradientStop Color="#26FFFFFF" Offset="0" />
+ <GradientStop Color="#00FFFFFF" Offset="1" />
+ <GradientStop Color="#26FFFFFF" Offset="0.467" />
+ <GradientStop Color="#00FFFFFF" Offset="0.475" />
+ </LinearGradientBrush>
+ </Rectangle.Fill>
+ </Rectangle>
+
+ <Border x:Name="Header" Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Padding="3,1,3,0">
+ <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" Margin="0,4,0,4" />
+ </Border>
+
+ <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="{TemplateBinding Padding}" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="2" />
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ <Setter Property="Foreground">
+ <Setter.Value>
+ <SolidColorBrush Color="{DynamicResource WhiteColor}" />
+ </Setter.Value>
+ </Setter>
+ </Style>
+
<!--TextBlock-->
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{StaticResource Text1Brush}"/>
@@ -1291,20 +1297,18 @@
</Style>
<!--StatusBar Separator-->
- <Style x:Key="{x:Static StatusBar.SeparatorStyleKey}" TargetType="{x:Type Separator}">
- <Setter Property="MinWidth" Value="1"/>
- <Setter Property="MinHeight" Value="1"/>
- <Setter Property="Margin" Value="2"/>
- <Setter Property="Focusable" Value="false" />
- <Setter Property="SnapsToDevicePixels" Value="true"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Separator}">
- <Border SnapsToDevicePixels="true" Background="{DynamicResource MenuTextBrush}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
+ <Style TargetType="{x:Type Separator}">
+ <Setter Property="Height" Value="1" />
+ <Setter Property="Margin" Value="0,2,0,2" />
+ <Setter Property="Focusable" Value="false" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type Separator}">
+ <Border BorderBrush="{DynamicResource SolidBorderBrush}" BorderThickness="1" />
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
<!--Menu Separator-->
<Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="{x:Type Separator}">
@@ -1340,22 +1344,28 @@
</Style>
<!--Menu-->
- <Style x:Key="{x:Type Menu}" TargetType="{x:Type Menu}">
- <Setter Property="Background" Value="{DynamicResource MenuBackgroundBrush}" />
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Menu}">
- <StackPanel Background="{TemplateBinding Background}" IsItemsHost="true" ClipToBounds="true" Orientation="Horizontal" />
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Value="{DynamicResource MenuBackgroundBrush}" Property="Background" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
+ <Style TargetType="{x:Type Menu}">
+ <Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}" />
+ <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
+ <Setter Property="SnapsToDevicePixels" Value="True" />
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type Menu}">
+ <Grid>
+ <Border Margin="1" x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
+ <StackPanel Background="{TemplateBinding Background}" IsItemsHost="True" ClipToBounds="True" Orientation="Horizontal" />
+ </Grid>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter Property="Background" Value="{DynamicResource DisabledBackgroundBrush}" TargetName="Border" />
+ <Setter Property="BorderBrush" Value="{DynamicResource DisabledBorderBrush}" TargetName="Border" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
<!--Menu Items-->
<ControlTemplate TargetType="{x:Type MenuItem}" x:Key="SubmenuHeaderStyle">
@@ -1564,4 +1574,62 @@
<Setter Property="SnapsToDevicePixels" Value="true" />
</Style>
+ <Style x:Key="{x:Static ToolBar.ButtonStyleKey}" TargetType="{x:Type Button}" BasedOn="{x:Null}">
+ <Setter Property="FocusVisualStyle" Value="{DynamicResource NuclearButtonFocusVisual}" />
+ <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
+ <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
+ <Setter Property="Template" Value="{DynamicResource ButtonTemplate}" />
+ <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
+ <Setter Property="FontSize" Value="10"/>
+ <Setter Property="MinHeight" Value="18"/>
+ <Setter Property="MinWidth" Value="50"/>
+ </Style>
+
+ <Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" TargetType="{x:Type CheckBox}">
+ <Setter Property="FontSize" Value="10"/>
+ <Setter Property="SnapsToDevicePixels" Value="true" />
+ <Setter Property="FocusVisualStyle" Value="{DynamicResource CheckBoxFocusVisual}" />
+ <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
+ <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
+ <Setter Property="Template" Value="{DynamicResource CheckBoxTemplate}" />
+ <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
+ </Style>
+
+ <Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" TargetType="{x:Type RadioButton}">
+ <Setter Property="FontSize" Value="10"/>
+ <Setter Property="SnapsToDevicePixels" Value="true" />
+ <Setter Property="FocusVisualStyle" Value="{DynamicResource RadioButtonFocusVisual}" />
+ <Setter Property="Background" Value="{DynamicResource NormalBrush}" />
+ <Setter Property="BorderBrush" Value="{DynamicResource NormalBorderBrush}" />
+ <Setter Property="Template" Value="{DynamicResource RadioButtonTemplate}" />
+ <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
+ <Style.Triggers>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter Property="Foreground">
+ <Setter.Value>
+ <SolidColorBrush Color="{DynamicResource TopGradientSelectColor}" />
+ </Setter.Value>
+ </Setter>
+ </Trigger>
+ </Style.Triggers>
+ </Style>
+
+ <Style x:Key="{x:Static ToolBar.ComboBoxStyleKey}" TargetType="{x:Type ComboBox}">
+ <Setter Property="FontSize" Value="10"/>
+ <Setter Property="SnapsToDevicePixels" Value="true" />
+ <Setter Property="Template" Value="{DynamicResource ComboBoxTemplate}" />
+ <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
+ </Style>
+
+ <Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="{x:Type TextBox}">
+ <Setter Property="FontSize" Value="10"/>
+ <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
+ <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+ <Setter Property="AllowDrop" Value="true" />
+ <Setter Property="Template" Value="{DynamicResource TextBoxTemplate}" />
+ <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
+ <Setter Property="Background" Value="{DynamicResource ControlBackgroundBrush}"/>
+ <Setter Property="BorderBrush" Value="#FF000000"/>
+ </Style>
+
</ResourceDictionary>
View
18 Rhino.Licensing.AdminTool/ViewModels/ProjectViewModel.cs
@@ -1,3 +1,4 @@
+using System;
using System.IO;
using System.Security.Cryptography;
using Caliburn.PresentationFramework.Filters;
@@ -49,12 +50,23 @@ public virtual bool CanSave()
[AutoCheckAvailability]
public virtual void Save()
{
- var dialogModel = _dialogService.ShowSaveFileDialog();
+ var model = CreateSaveDialogModel();
- if (dialogModel.Result.GetValueOrDefault(false) && dialogModel.FileName.IsNotEmpty())
+ _dialogService.ShowSaveFileDialog(model);
+
+ if (model.Result.GetValueOrDefault(false) && model.FileName.IsNotEmpty())
{
- _projectService.Save(CurrentProject, new FileInfo(dialogModel.FileName));
+ _projectService.Save(CurrentProject, new FileInfo(model.FileName));
}
}
+
+ public virtual ISaveFileDialogViewModel CreateSaveDialogModel()
+ {
+ return new SaveFileDialogViewModel
+ {
+ Filter = "Rhino License|*.rlic",
+ OverwritePrompt = true,
+ };
+ }
}
}
View
49 Rhino.Licensing.AdminTool/Views/ProjectView.xaml
@@ -13,19 +13,19 @@
HorizontalAlignment="Left"
Orientation="Horizontal">
- <Button
- Content="Save"
- cal:Message.Attach="[Event Click]=[Action Save]"/>
+ <Button cal:Message.Attach="[Event Click]=[Action Save]" ToolTip="Save" Margin="2">
+ <Image Source="/Images/Save.png" Width="32" Height="32" Style="{DynamicResource ToolbarImageStyle}"/>
+ </Button>
- <Button
- Content="Close"
- cal:Message.Attach="[Event Click]=[Action TryClose]"/>
+ <Button cal:Message.Attach="[Event Click]=[Action TryClose]" ToolTip="Close" Margin="2">
+ <Image Source="/Images/Close.png" Width="32" Height="32" Style="{DynamicResource ToolbarImageStyle}"/>
+ </Button>
- <Rectangle Style="{DynamicResource ToolSeparator}" />
-
- <Button
- Content="Generate Key Pair"
- cal:Message.Attach="[Event Click]=[Action GenerateKey]"/>
+ <Separator Margin="2"/>
+
+ <Button cal:Message.Attach="[Event Click]=[Action GenerateKey]" ToolTip="Generate Key" Margin="2">
+ <Image Source="/Images/GenerateKey.png" Width="32" Height="32" Style="{DynamicResource ToolbarImageStyle}"/>
+ </Button>
</ToolBarPanel>
@@ -33,8 +33,8 @@
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
- <RowDefinition Height="2*"/>
- <RowDefinition Height="2*"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -48,18 +48,19 @@
<TextBox Text="{Binding Path=CurrentProject.Product.Name}"
Grid.Column="1" Grid.Row="0" />
- <TextBox Text="{Binding Path=CurrentProject.Product.PublicKey}"
- IsReadOnly="True"
- TextWrapping="WrapWithOverflow"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- Grid.Column="1" Grid.Row="1" />
+ <DockPanel Grid.Column="1" Grid.Row="1">
+ <Button DockPanel.Dock="Right" Margin="2" Height="20" Width="20">
+ <Image Source="/Images/Copy.png" />
+ </Button>
+ <TextBox Text="{Binding Path=CurrentProject.Product.PublicKey}" IsReadOnly="True" />
+ </DockPanel>
- <TextBox Text="{Binding Path=CurrentProject.Product.PrivateKey}"
- IsReadOnly="True"
- TextWrapping="WrapWithOverflow"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- Grid.Column="1" Grid.Row="2" />
-
+ <DockPanel Grid.Column="1" Grid.Row="2">
+ <Button DockPanel.Dock="Right" Margin="2" Height="20" Width="20">
+ <Image Source="/Images/Copy.png" />
+ </Button>
+ <TextBox Text="{Binding Path=CurrentProject.Product.PrivateKey}" IsReadOnly="True" />
+ </DockPanel>
</Grid>
</GroupBox>

0 comments on commit a29a849

Please sign in to comment.
Something went wrong with that request. Please try again.