Refactor, using latest bovender framework.
This commit is contained in:
parent
812042d4bf
commit
63012281db
@ -44,6 +44,7 @@ namespace Tests.Controller.Elements
|
|||||||
public void TearDown()
|
public void TearDown()
|
||||||
{
|
{
|
||||||
((_Document)_document).Close(WdSaveOptions.wdDoNotSaveChanges);
|
((_Document)_document).Close(WdSaveOptions.wdDoNotSaveChanges);
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(_document);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -32,14 +32,14 @@ namespace Tests.Controller
|
|||||||
[SetUp]
|
[SetUp]
|
||||||
public void SetUp()
|
public void SetUp()
|
||||||
{
|
{
|
||||||
_savedSettings = zaaReloaded2.Properties.Settings.Default.SettingsRepository;
|
_savedSettings = zaaReloaded2.UserSettings.Default.SettingsRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
[TearDown]
|
[TearDown]
|
||||||
public void TearDown()
|
public void TearDown()
|
||||||
{
|
{
|
||||||
zaaReloaded2.Properties.Settings.Default.SettingsRepository = _savedSettings;
|
zaaReloaded2.UserSettings.Default.SettingsRepository = _savedSettings;
|
||||||
zaaReloaded2.Properties.Settings.Default.Save();
|
zaaReloaded2.UserSettings.Default.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -41,8 +41,8 @@
|
|||||||
<AssemblyOriginatorKeyFile>zaaReloaded2.pfx</AssemblyOriginatorKeyFile>
|
<AssemblyOriginatorKeyFile>zaaReloaded2.pfx</AssemblyOriginatorKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Bovender, Version=0.14.1.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
|
<Reference Include="Bovender, Version=0.14.4.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Bovender.0.14.1.0\lib\net40\Bovender.dll</HintPath>
|
<HintPath>..\packages\Bovender.0.14.4.0\lib\net40\Bovender.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.Office.Interop.Word, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
|
||||||
@ -52,9 +52,9 @@
|
|||||||
<HintPath>..\packages\NLog.4.3.7\lib\net40\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.3.7\lib\net40\NLog.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\packages\NUnit.3.4.1\lib\net40\nunit.framework.dll</HintPath>
|
||||||
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
@ -70,8 +70,8 @@
|
|||||||
<Reference Include="System.Xaml" />
|
<Reference Include="System.Xaml" />
|
||||||
<Reference Include="System.XML" />
|
<Reference Include="System.XML" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="YamlDotNet, Version=3.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="YamlDotNet, Version=3.9.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
|
<HintPath>..\packages\YamlDotNet.Signed.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -115,6 +115,7 @@
|
|||||||
<Compile Include="ViewModels\SettingsViewModelTest.cs" />
|
<Compile Include="ViewModels\SettingsViewModelTest.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<None Include="app.config" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
<None Include="Tests.licenseheader" />
|
<None Include="Tests.licenseheader" />
|
||||||
<None Include="zaaReloaded2.pfx" />
|
<None Include="zaaReloaded2.pfx" />
|
||||||
|
29
Tests/app.config
Executable file
29
Tests/app.config
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
app.config
|
||||||
|
part of zaaReloaded2
|
||||||
|
|
||||||
|
Copyright 2016 Daniel Kraus
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
<configuration>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="YamlDotNet" publicKeyToken="ec19458f3c15af5e" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-3.9.0.0" newVersion="3.9.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Bovender" version="0.14.1.0" targetFramework="net40" />
|
<package id="Bovender" version="0.14.4.0" targetFramework="net40" />
|
||||||
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net40" />
|
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net40" />
|
||||||
<package id="NLog" version="4.3.7" targetFramework="net40" />
|
<package id="NLog" version="4.3.7" targetFramework="net40" />
|
||||||
<package id="NUnit" version="2.6.4" targetFramework="net40" />
|
<package id="NUnit" version="3.4.1" targetFramework="net40" />
|
||||||
<package id="YamlDotNet" version="3.9.0" targetFramework="net40" />
|
<package id="YamlDotNet.Signed" version="3.9.0" targetFramework="net40" />
|
||||||
</packages>
|
</packages>
|
@ -42,7 +42,7 @@ namespace zaaReloaded2
|
|||||||
if (CanFormat())
|
if (CanFormat())
|
||||||
{
|
{
|
||||||
SettingsRepository repository = SettingsRepository.Load();
|
SettingsRepository repository = SettingsRepository.Load();
|
||||||
Guid lastSettingsUid = Properties.Settings.Default.LastSettings;
|
Guid lastSettingsUid = UserSettings.Default.LastSettings;
|
||||||
Settings lastSettings = repository.FindByGuid(lastSettingsUid);
|
Settings lastSettings = repository.FindByGuid(lastSettingsUid);
|
||||||
if (lastSettings != null)
|
if (lastSettings != null)
|
||||||
{
|
{
|
||||||
@ -72,8 +72,7 @@ namespace zaaReloaded2
|
|||||||
SettingsViewModel settingsVM = args.Content.ViewModel as SettingsViewModel;
|
SettingsViewModel settingsVM = args.Content.ViewModel as SettingsViewModel;
|
||||||
Settings settings = settingsVM.RevealModelObject() as Settings;
|
Settings settings = settingsVM.RevealModelObject() as Settings;
|
||||||
DoFormat(settings);
|
DoFormat(settings);
|
||||||
Properties.Settings.Default.LastSettings = settings.Uid;
|
UserSettings.Default.LastSettings = settings.Uid;
|
||||||
Properties.Settings.Default.Save();
|
|
||||||
};
|
};
|
||||||
vm.InjectInto<SettingsRepositoryView>().ShowDialog();
|
vm.InjectInto<SettingsRepositoryView>().ShowDialog();
|
||||||
}
|
}
|
||||||
@ -127,8 +126,8 @@ namespace zaaReloaded2
|
|||||||
|
|
||||||
public static void ShowPreferences()
|
public static void ShowPreferences()
|
||||||
{
|
{
|
||||||
ViewModels.PreferencesViewModel.Default.InjectInto<Views.PreferencesView>()
|
ViewModels.PreferencesViewModel vm = new PreferencesViewModel();
|
||||||
.ShowDialog();
|
vm.InjectInto<Views.PreferencesView>().ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ApplyDanielsStyle()
|
public static void ApplyDanielsStyle()
|
||||||
@ -149,11 +148,15 @@ namespace zaaReloaded2
|
|||||||
// (NB Technically, there is never _no_ selection in a document.)
|
// (NB Technically, there is never _no_ selection in a document.)
|
||||||
Word.Window activeWindow = Globals.ThisAddIn.Application.ActiveWindow;
|
Word.Window activeWindow = Globals.ThisAddIn.Application.ActiveWindow;
|
||||||
Word.Selection sel = activeWindow.Selection;
|
Word.Selection sel = activeWindow.Selection;
|
||||||
if (!(sel.Paragraphs.Count > 1
|
Word.Paragraphs paragraphs = sel.Paragraphs;
|
||||||
|
Word.Document document = activeWindow.Document;
|
||||||
|
if (!(paragraphs.Count > 1
|
||||||
|| (sel.Text.Length > 1 && sel.Text.EndsWith("\r"))))
|
|| (sel.Text.Length > 1 && sel.Text.EndsWith("\r"))))
|
||||||
{
|
{
|
||||||
if (!Medication.Importer.AutoDetect(activeWindow.Document))
|
Logger.Info("FormatDrugs: Attempting to auto-detect");
|
||||||
|
if (!Medication.Importer.AutoDetect(document))
|
||||||
{
|
{
|
||||||
|
Logger.Info("FormatDrugs: Failed to auto-detect");
|
||||||
NotificationAction a = new NotificationAction();
|
NotificationAction a = new NotificationAction();
|
||||||
a.Caption = "Formatieren nicht möglich";
|
a.Caption = "Formatieren nicht möglich";
|
||||||
a.Message = "Das Dokument scheint keine Medikationsliste zu enthalten.";
|
a.Message = "Das Dokument scheint keine Medikationsliste zu enthalten.";
|
||||||
@ -163,20 +166,27 @@ namespace zaaReloaded2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Medication.Importer importer = new Medication.Importer(activeWindow.Selection.Text);
|
Logger.Info("FormatDrugs: Importing");
|
||||||
|
Medication.Importer importer = new Medication.Importer(sel.Text);
|
||||||
Medication.Formatter formatter = new Medication.Formatter(importer.Prescriptions);
|
Medication.Formatter formatter = new Medication.Formatter(importer.Prescriptions);
|
||||||
|
|
||||||
|
Logger.Info("FormatDrugs: Formatting");
|
||||||
switch (columns)
|
switch (columns)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
formatter.FormatOneColumn(activeWindow.Document);
|
formatter.FormatOneColumn(document);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
formatter.FormatTwoColumns(activeWindow.Document);
|
formatter.FormatTwoColumns(document);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Logger.Info("FormatDrugs: Cleaning up");
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(document);
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(paragraphs);
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(sel);
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(activeWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -187,13 +197,19 @@ namespace zaaReloaded2
|
|||||||
{
|
{
|
||||||
// If no "real" selection exists, attempt to auto-detect the lab data.
|
// If no "real" selection exists, attempt to auto-detect the lab data.
|
||||||
// (NB Technically, there is never _no_ selection in a document.)
|
// (NB Technically, there is never _no_ selection in a document.)
|
||||||
Word.Window activeWindow = Globals.ThisAddIn.Application.ActiveWindow;
|
Word.Application word = Globals.ThisAddIn.Application;
|
||||||
Word.Selection sel = activeWindow.Selection;
|
Word.Document activeDocument = word.ActiveDocument;
|
||||||
if (!(sel.Paragraphs.Count > 1
|
Word.Window activeWindow = word.ActiveWindow;
|
||||||
|| (sel.Text.Length > 1 && sel.Text.EndsWith("\r"))))
|
Word.Selection selection = activeWindow.Selection;
|
||||||
|
Word.Paragraphs paragraphs = selection.Paragraphs;
|
||||||
|
if (!(paragraphs.Count > 1
|
||||||
|
|| (selection.Text.Length > 1 && selection.Text.EndsWith("\r"))))
|
||||||
{
|
{
|
||||||
if (!AutoDetect.Detect(activeWindow.Document))
|
Logger.Info("DoFormat: Attempting to auto-detect");
|
||||||
|
Word.Document doc = activeWindow.Document;
|
||||||
|
if (!AutoDetect.Detect(doc))
|
||||||
{
|
{
|
||||||
|
Logger.Info("DoFormat: Automatic detection failed");
|
||||||
NotificationAction a = new NotificationAction();
|
NotificationAction a = new NotificationAction();
|
||||||
a.Caption = "Formatieren nicht möglich";
|
a.Caption = "Formatieren nicht möglich";
|
||||||
a.Message = "Das Dokument scheint keine Lauris-Labordaten zu enthalten.";
|
a.Message = "Das Dokument scheint keine Lauris-Labordaten zu enthalten.";
|
||||||
@ -201,43 +217,64 @@ namespace zaaReloaded2
|
|||||||
a.Invoke();
|
a.Invoke();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Don't release the COM object here
|
||||||
|
// Bovender.ComHelpers.ReleaseComObject(doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Logger.Info("DoFormat: Importing");
|
||||||
ZaaImporter importer = new ZaaImporter();
|
ZaaImporter importer = new ZaaImporter();
|
||||||
importer.Import(Globals.ThisAddIn.Application.ActiveWindow.Selection.Text);
|
importer.Import(selection.Text);
|
||||||
Formatter.Formatter formatter = new Formatter.Formatter(
|
Formatter.Formatter formatter = new Formatter.Formatter(activeDocument);
|
||||||
Globals.ThisAddIn.Application.ActiveDocument);
|
|
||||||
formatter.Settings = settings;
|
formatter.Settings = settings;
|
||||||
formatter.Laboratory = importer.Laboratory;
|
formatter.Laboratory = importer.Laboratory;
|
||||||
CommentPool.Default.Reset();
|
CommentPool.Default.Reset();
|
||||||
CommentPool.Default.FillInComment += CommentPool_FillInComment;
|
CommentPool.Default.FillInComment += CommentPool_FillInComment;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Logger.Info("DoFormat: Formatting");
|
||||||
formatter.Run();
|
formatter.Run();
|
||||||
}
|
}
|
||||||
catch (NoLaboratoryDataException)
|
catch (NoLaboratoryDataException e)
|
||||||
{
|
{
|
||||||
|
Logger.Warn("DoFormat: No lab data?!");
|
||||||
|
Logger.Warn(e);
|
||||||
NotificationAction a = new NotificationAction();
|
NotificationAction a = new NotificationAction();
|
||||||
a.Caption = "Formatieren nicht möglich";
|
a.Caption = "Formatieren nicht möglich";
|
||||||
a.Message = "Die aktuelle Markierung scheint keine Labordaten zu enthalten.";
|
a.Message = "Die aktuelle Markierung scheint keine Labordaten zu enthalten.";
|
||||||
a.OkButtonText = "Schließen";
|
a.OkButtonText = "Schließen";
|
||||||
a.Invoke();
|
a.Invoke();
|
||||||
}
|
}
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(paragraphs);
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(selection);
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(activeWindow);
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(activeDocument);
|
||||||
|
Logger.Info("DoFormat: Finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CommentPool_FillInComment(object sender, ItemCommentEventArgs e)
|
private static void CommentPool_FillInComment(object sender, ItemCommentEventArgs e)
|
||||||
{
|
{
|
||||||
if (Preferences.Default.SuppressItemCommentInteraction)
|
if (UserSettings.Default.SuppressItemCommentInteraction)
|
||||||
{
|
{
|
||||||
|
Logger.Info("CommentPool_FillInComment: Comment interaction is suppressed by user settings");
|
||||||
e.Comment.IsCancelled = true;
|
e.Comment.IsCancelled = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Logger.Info("CommentPool_FillInComment: Requesting user interaction");
|
||||||
ItemCommentViewModel vm = new ItemCommentViewModel(e.Comment);
|
ItemCommentViewModel vm = new ItemCommentViewModel(e.Comment);
|
||||||
vm.InjectInto<ItemCommentView>().ShowDialog();
|
vm.InjectInto<ItemCommentView>().ShowDialog();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ namespace zaaReloaded2.Controller
|
|||||||
/// </remarks>
|
/// </remarks>
|
||||||
public static SettingsRepository Load()
|
public static SettingsRepository Load()
|
||||||
{
|
{
|
||||||
string s = Properties.Settings.Default.SettingsRepository;
|
string s = UserSettings.Default.SettingsRepository;
|
||||||
if (String.IsNullOrEmpty(s))
|
if (String.IsNullOrEmpty(s))
|
||||||
{
|
{
|
||||||
return new SettingsRepository();
|
return new SettingsRepository();
|
||||||
@ -67,7 +67,7 @@ namespace zaaReloaded2.Controller
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
MemoryStream stream = new MemoryStream();
|
MemoryStream stream = new MemoryStream();
|
||||||
string encoded = Properties.Settings.Default.SettingsRepository;
|
string encoded = UserSettings.Default.SettingsRepository;
|
||||||
byte[] bytes = Convert.FromBase64String(encoded);
|
byte[] bytes = Convert.FromBase64String(encoded);
|
||||||
stream.Write(bytes, 0, bytes.Length);
|
stream.Write(bytes, 0, bytes.Length);
|
||||||
stream.Position = 0;
|
stream.Position = 0;
|
||||||
@ -94,8 +94,7 @@ namespace zaaReloaded2.Controller
|
|||||||
serializer.Serialize(stream, this);
|
serializer.Serialize(stream, this);
|
||||||
stream.Position = 0;
|
stream.Position = 0;
|
||||||
string encoded = Convert.ToBase64String(stream.ToArray());
|
string encoded = Convert.ToBase64String(stream.ToArray());
|
||||||
Properties.Settings.Default.SettingsRepository = encoded;
|
UserSettings.Default.SettingsRepository = encoded;
|
||||||
Properties.Settings.Default.Save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -48,7 +48,7 @@ namespace zaaReloaded2.ExceptionHandler
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return zaaReloaded2.Updater.Version.CurrentVersion().ToString();
|
return zaaReloaded2.Updater.Version.Current.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +86,11 @@ namespace zaaReloaded2.ExceptionHandler
|
|||||||
return @"x:\Code\zaaReloaded2\zaaReloaded2\";
|
return @"x:\Code\zaaReloaded2\zaaReloaded2\";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override Bovender.UserSettings.UserSettingsBase UserSettings
|
||||||
|
{
|
||||||
|
get { return zaaReloaded2.UserSettings.Default; }
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -272,15 +272,18 @@ namespace zaaReloaded2.Formatter
|
|||||||
{
|
{
|
||||||
if (Document != null)
|
if (Document != null)
|
||||||
{
|
{
|
||||||
|
Logger.Info("CreateStyles");
|
||||||
Style style;
|
Style style;
|
||||||
// Don't see a better way to check for the existence of a particular
|
// Don't see a better way to check for the existence of a particular
|
||||||
// paragraph style than by using a try...catch construction.
|
// paragraph style than by using a try...catch construction.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
style = Document.Styles[Properties.Settings.Default.StyleParagraph];
|
style = Document.Styles[Properties.Settings.Default.StyleParagraph];
|
||||||
|
Logger.Info("CreateStyles: Found paragraph style in document");
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Logger.Info("CreateStyles: Need to create paragraph style");
|
||||||
// Add default paragraph style for laboratory
|
// Add default paragraph style for laboratory
|
||||||
style = Document.Styles.Add(Properties.Settings.Default.StyleParagraph);
|
style = Document.Styles.Add(Properties.Settings.Default.StyleParagraph);
|
||||||
style.Font.Size = 10; // pt
|
style.Font.Size = 10; // pt
|
||||||
@ -293,13 +296,16 @@ namespace zaaReloaded2.Formatter
|
|||||||
style.ParagraphFormat.FirstLineIndent = -36; // pt
|
style.ParagraphFormat.FirstLineIndent = -36; // pt
|
||||||
style.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
|
style.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
|
||||||
}
|
}
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(style);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
style = Document.Styles[Properties.Settings.Default.StyleHeader];
|
style = Document.Styles[Properties.Settings.Default.StyleHeader];
|
||||||
|
Logger.Info("CreateStyles: Found header style in document");
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
Logger.Info("CreateStyles: Need to create header style");
|
||||||
// Add header paragraph style for laboratory
|
// Add header paragraph style for laboratory
|
||||||
style = Document.Styles.Add(Properties.Settings.Default.StyleHeader);
|
style = Document.Styles.Add(Properties.Settings.Default.StyleHeader);
|
||||||
style.Font.Size = 10; // pt
|
style.Font.Size = 10; // pt
|
||||||
@ -313,6 +319,7 @@ namespace zaaReloaded2.Formatter
|
|||||||
style.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
|
style.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphJustify;
|
||||||
style.set_NextParagraphStyle(Document.Styles[Properties.Settings.Default.StyleParagraph]);
|
style.set_NextParagraphStyle(Document.Styles[Properties.Settings.Default.StyleParagraph]);
|
||||||
}
|
}
|
||||||
|
Bovender.ComHelpers.ReleaseComObject(style);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
try
|
try
|
||||||
@ -422,5 +429,13 @@ namespace zaaReloaded2.Formatter
|
|||||||
Table _table;
|
Table _table;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,12 +105,14 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
Match match;
|
Match match;
|
||||||
if (_numericalRegex.IsMatch(LaurisText))
|
if (_numericalRegex.IsMatch(LaurisText))
|
||||||
{
|
{
|
||||||
|
Logger.Debug("ParseLauris: Numerical match");
|
||||||
match = _numericalRegex.Match(LaurisText);
|
match = _numericalRegex.Match(LaurisText);
|
||||||
ParseLimits(match);
|
ParseLimits(match);
|
||||||
Value = match.Groups["value"].Value.Trim().Replace(',', '.');
|
Value = match.Groups["value"].Value.Trim().Replace(',', '.');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Logger.Debug("ParseLauris: Not a numerical match");
|
||||||
match = _categoricalRegex.Match(LaurisText);
|
match = _categoricalRegex.Match(LaurisText);
|
||||||
Normal = match.Groups["normal"].Value.Trim();
|
Normal = match.Groups["normal"].Value.Trim();
|
||||||
Value = match.Groups["value"].Value.Trim();
|
Value = match.Groups["value"].Value.Trim();
|
||||||
@ -120,6 +122,11 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
OriginalName = match.Groups["name"].Value.Trim();
|
OriginalName = match.Groups["name"].Value.Trim();
|
||||||
Name = OriginalName;
|
Name = OriginalName;
|
||||||
Unit = match.Groups["unit"].Value.Trim();
|
Unit = match.Groups["unit"].Value.Trim();
|
||||||
|
Logger.Debug("ParseLauris: Match: {0}, {1}", Name, Unit);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.Debug("ParseLauris: No match: \"{0}\"", LaurisText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +139,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
{
|
{
|
||||||
if (match.Groups["limits"].Success)
|
if (match.Groups["limits"].Success)
|
||||||
{
|
{
|
||||||
|
Logger.Debug("ParseLimits: Has limits");
|
||||||
Match limitMatch = _limitRegex.Match(match.Groups["limits"].Value);
|
Match limitMatch = _limitRegex.Match(match.Groups["limits"].Value);
|
||||||
if (limitMatch.Groups["limit1"].Success && limitMatch.Groups["limit2"].Success)
|
if (limitMatch.Groups["limit1"].Success && limitMatch.Groups["limit2"].Success)
|
||||||
{
|
{
|
||||||
@ -210,5 +218,13 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
static readonly Regex _materialRegex = new Regex(@"\((?<material>(SU|PU))\)");
|
static readonly Regex _materialRegex = new Regex(@"\((?<material>(SU|PU))\)");
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ using System.Text;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using zaaReloaded2.Thesaurus;
|
using zaaReloaded2.Thesaurus;
|
||||||
using zaaReloaded2.LabModel;
|
using zaaReloaded2.LabModel;
|
||||||
|
using Bovender.Extensions;
|
||||||
|
|
||||||
namespace zaaReloaded2.Importer.ZaaImporter
|
namespace zaaReloaded2.Importer.ZaaImporter
|
||||||
{
|
{
|
||||||
@ -112,6 +113,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
Match m = _expectedFormat.Match(OriginalParagraph);
|
Match m = _expectedFormat.Match(OriginalParagraph);
|
||||||
if (m.Success)
|
if (m.Success)
|
||||||
{
|
{
|
||||||
|
Logger.Info("Parse: Matches Lauris paragraph format");
|
||||||
Items = new ItemDictionary();
|
Items = new ItemDictionary();
|
||||||
if (m.Groups["caption"].Success)
|
if (m.Groups["caption"].Success)
|
||||||
{
|
{
|
||||||
@ -127,6 +129,8 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Logger.Info("Parse: Does not match Lauris paragraph format");
|
||||||
|
Logger.Info("Parse: {0}", OriginalParagraph.TruncateWithEllipsis(40));
|
||||||
IsLaurisParagraph = false;
|
IsLaurisParagraph = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -140,5 +144,13 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
Thesaurus.Units _unitDictionary;
|
Thesaurus.Units _unitDictionary;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -199,6 +199,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
Match m = _timeStampRegex.Match(paragraph);
|
Match m = _timeStampRegex.Match(paragraph);
|
||||||
if (m.Success)
|
if (m.Success)
|
||||||
{
|
{
|
||||||
|
Logger.Info("ParseParagraph: Matches time stamp");
|
||||||
DateTime dt;
|
DateTime dt;
|
||||||
if (DateTime.TryParseExact(
|
if (DateTime.TryParseExact(
|
||||||
m.Groups["datetime"].Value,
|
m.Groups["datetime"].Value,
|
||||||
@ -218,6 +219,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
// the normal format of a paragraph generated from Lauris.
|
// the normal format of a paragraph generated from Lauris.
|
||||||
if (m.Groups["tail"].Success)
|
if (m.Groups["tail"].Success)
|
||||||
{
|
{
|
||||||
|
Logger.Debug("ParseParagraph: Time stamp has tail, adding dummy caption");
|
||||||
paragraph = "DUMMY CAPTION: " + m.Groups["tail"].Value;
|
paragraph = "DUMMY CAPTION: " + m.Groups["tail"].Value;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -228,12 +230,14 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
|
|
||||||
if (!String.IsNullOrEmpty(paragraph))
|
if (!String.IsNullOrEmpty(paragraph))
|
||||||
{
|
{
|
||||||
|
Logger.Info("ParseParagraph: Not a time stamp");
|
||||||
LaurisParagraph lp = new LaurisParagraph(
|
LaurisParagraph lp = new LaurisParagraph(
|
||||||
paragraph,
|
paragraph,
|
||||||
_parameterDictionary,
|
_parameterDictionary,
|
||||||
_unitDictionary);
|
_unitDictionary);
|
||||||
if (lp.IsLaurisParagraph)
|
if (lp.IsLaurisParagraph)
|
||||||
{
|
{
|
||||||
|
Logger.Debug("ParseParagraph: Merging Lauris paragraph");
|
||||||
Items.Merge(lp.Items);
|
Items.Merge(lp.Items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -259,5 +263,13 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
Units _unitDictionary;
|
Units _unitDictionary;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
/// <param name="text">ZAA-formatted Lauris output to import.</param>
|
/// <param name="text">ZAA-formatted Lauris output to import.</param>
|
||||||
public void Import(string text)
|
public void Import(string text)
|
||||||
{
|
{
|
||||||
|
Logger.Info("Import");
|
||||||
string[] paragraphs = Helpers.SplitParagraphs(text);
|
string[] paragraphs = Helpers.SplitParagraphs(text);
|
||||||
LaurisTimePoint timePoint = null;
|
LaurisTimePoint timePoint = null;
|
||||||
|
|
||||||
@ -76,6 +77,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
// create a new time point.
|
// create a new time point.
|
||||||
if (LaurisTimePoint.IsTimeStampLine(paragraph))
|
if (LaurisTimePoint.IsTimeStampLine(paragraph))
|
||||||
{
|
{
|
||||||
|
Logger.Info("Import: Time stamp line: {0}", paragraph);
|
||||||
timePoint = new LaurisTimePoint(paragraph, _parameters, _units);
|
timePoint = new LaurisTimePoint(paragraph, _parameters, _units);
|
||||||
// Add the time point to the laboratory only if none
|
// Add the time point to the laboratory only if none
|
||||||
// with the same time stamp exists yet.
|
// with the same time stamp exists yet.
|
||||||
@ -94,6 +96,7 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
// if no time point exists yet, create one.
|
// if no time point exists yet, create one.
|
||||||
else if (LaurisParagraph.ResemblesLaurisParagraph(paragraph))
|
else if (LaurisParagraph.ResemblesLaurisParagraph(paragraph))
|
||||||
{
|
{
|
||||||
|
Logger.Info("Import: Lauris paragraph detected");
|
||||||
if (timePoint == null)
|
if (timePoint == null)
|
||||||
{
|
{
|
||||||
timePoint = new LaurisTimePoint(_parameters, _units);
|
timePoint = new LaurisTimePoint(_parameters, _units);
|
||||||
@ -101,6 +104,11 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
}
|
}
|
||||||
timePoint.AddParagraph(paragraph);
|
timePoint.AddParagraph(paragraph);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.Debug("Import: Neither time line, nor Lauris paragraph");
|
||||||
|
Logger.Debug("Import: {0}", paragraph.TruncateWithEllipsis(30));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,5 +131,13 @@ namespace zaaReloaded2.Importer.ZaaImporter
|
|||||||
Units _units;
|
Units _units;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,12 @@ namespace zaaReloaded2.LabModel
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public enum Material
|
public enum Material
|
||||||
{
|
{
|
||||||
|
[Description("Serum")]
|
||||||
|
/// Serum (default -- first declared)
|
||||||
|
S,
|
||||||
|
[Description("EDTA-Blut")]
|
||||||
|
/// EDTA blood
|
||||||
|
E,
|
||||||
[Description("Blut")]
|
[Description("Blut")]
|
||||||
/// Blood
|
/// Blood
|
||||||
B,
|
B,
|
||||||
|
109
zaaReloaded2/LogFile.cs
Executable file
109
zaaReloaded2/LogFile.cs
Executable file
@ -0,0 +1,109 @@
|
|||||||
|
/* LogFile.cs
|
||||||
|
* part of zaaReloaded2
|
||||||
|
*
|
||||||
|
* Copyright 2016 Daniel Kraus
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using NLog;
|
||||||
|
using NLog.Config;
|
||||||
|
using NLog.Targets;
|
||||||
|
using NLog.Targets.Wrappers;
|
||||||
|
|
||||||
|
namespace zaaReloaded2
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides logging to file and to the debug console; wraps
|
||||||
|
/// NLog configuration and targets.
|
||||||
|
/// </summary>
|
||||||
|
public class LogFile : Bovender.Logging.LogFile
|
||||||
|
{
|
||||||
|
#region Singleton
|
||||||
|
|
||||||
|
new public static LogFile Default { get { return _lazy.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<LogFile> _lazy = new Lazy<LogFile>(
|
||||||
|
() =>
|
||||||
|
{
|
||||||
|
LogFile logFile = new LogFile();
|
||||||
|
Bovender.Logging.LogFile.LogFileProvider = new Func<Bovender.Logging.LogFile>(() => logFile);
|
||||||
|
return logFile;
|
||||||
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Static properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets whether file logging is enabled, without initializing
|
||||||
|
/// the singleton instance if it isn't.
|
||||||
|
/// </summary>
|
||||||
|
new public static bool IsInitializedAndEnabled
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _lazy.IsValueCreated && Default.IsFileLoggingEnabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the folder where log files are stored.
|
||||||
|
/// </summary>
|
||||||
|
public override string LogFolder
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_logFolder == null)
|
||||||
|
{
|
||||||
|
_logFolder = System.IO.Path.Combine(
|
||||||
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||||
|
Properties.Settings.Default.AppDataFolder,
|
||||||
|
Properties.Settings.Default.UserFolder);
|
||||||
|
}
|
||||||
|
return _logFolder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
private LogFile()
|
||||||
|
: base()
|
||||||
|
{ }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Private fields
|
||||||
|
|
||||||
|
string _logFolder;
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
@ -1,73 +0,0 @@
|
|||||||
/* Preferences.cs
|
|
||||||
* part of zaaReloaded2
|
|
||||||
*
|
|
||||||
* Copyright 2015 Daniel Kraus
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace zaaReloaded2
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Holds user preferences.
|
|
||||||
/// </summary>
|
|
||||||
public class Preferences
|
|
||||||
{
|
|
||||||
#region Singleton
|
|
||||||
|
|
||||||
public static Preferences Default
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return _instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static readonly Preferences _instance = new Preferences();
|
|
||||||
|
|
||||||
static Preferences() { }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Properties
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets whether the add-in should not ask for
|
|
||||||
/// item comments (i.e. typist mode).
|
|
||||||
/// </summary>
|
|
||||||
public bool SuppressItemCommentInteraction
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return Properties.Settings.Default.SuppressItemCommentInteraction;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
Properties.Settings.Default.SuppressItemCommentInteraction = value;
|
|
||||||
Properties.Settings.Default.Save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructors
|
|
||||||
|
|
||||||
protected Preferences() { }
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
110
zaaReloaded2/Properties/Settings.Designer.cs
generated
110
zaaReloaded2/Properties/Settings.Designer.cs
generated
@ -23,18 +23,6 @@ namespace zaaReloaded2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
|
||||||
public string SettingsRepository {
|
|
||||||
get {
|
|
||||||
return ((string)(this["SettingsRepository"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["SettingsRepository"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2")]
|
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2")]
|
||||||
@ -89,17 +77,6 @@ namespace zaaReloaded2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
public global::System.DateTime LastUpdateCheck {
|
|
||||||
get {
|
|
||||||
return ((global::System.DateTime)(this["LastUpdateCheck"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastUpdateCheck"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("http://www.apache.org/licenses/LICENSE-2.0")]
|
[global::System.Configuration.DefaultSettingValueAttribute("http://www.apache.org/licenses/LICENSE-2.0")]
|
||||||
@ -127,18 +104,6 @@ namespace zaaReloaded2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("00000000-0000-0000-0000-000000000000")]
|
|
||||||
public global::System.Guid LastSettings {
|
|
||||||
get {
|
|
||||||
return ((global::System.Guid)(this["LastSettings"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastSettings"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Laborwerte")]
|
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Laborwerte")]
|
||||||
@ -184,18 +149,6 @@ namespace zaaReloaded2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
|
||||||
public string ImportExportPath {
|
|
||||||
get {
|
|
||||||
return ((string)(this["ImportExportPath"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["ImportExportPath"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Überschrift")]
|
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Überschrift")]
|
||||||
@ -223,30 +176,6 @@ namespace zaaReloaded2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
|
||||||
public bool SuppressItemCommentInteraction {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["SuppressItemCommentInteraction"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["SuppressItemCommentInteraction"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("False")]
|
|
||||||
public bool FirstRunWizardShown {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["FirstRunWizardShown"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["FirstRunWizardShown"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("BITTE_ERGÄNZEN")]
|
[global::System.Configuration.DefaultSettingValueAttribute("BITTE_ERGÄNZEN")]
|
||||||
@ -265,18 +194,6 @@ namespace zaaReloaded2.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool NeedUpgrade {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["NeedUpgrade"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["NeedUpgrade"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Medikamente")]
|
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2-Medikamente")]
|
||||||
@ -285,5 +202,32 @@ namespace zaaReloaded2.Properties {
|
|||||||
return ((string)(this["DrugsParagraph"]));
|
return ((string)(this["DrugsParagraph"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("user")]
|
||||||
|
public string UserFolder {
|
||||||
|
get {
|
||||||
|
return ((string)(this["UserFolder"]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("zaaReloaded2")]
|
||||||
|
public string AppDataFolder {
|
||||||
|
get {
|
||||||
|
return ((string)(this["AppDataFolder"]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[global::System.Configuration.ApplicationScopedSettingAttribute()]
|
||||||
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
|
[global::System.Configuration.DefaultSettingValueAttribute("settings.yml")]
|
||||||
|
public string UserSettingsFile {
|
||||||
|
get {
|
||||||
|
return ((string)(this["UserSettingsFile"]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="zaaReloaded2.Properties" GeneratedClassName="Settings">
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="zaaReloaded2.Properties" GeneratedClassName="Settings">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings>
|
||||||
<Setting Name="SettingsRepository" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="AddinName" Type="System.String" Scope="Application">
|
<Setting Name="AddinName" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">zaaReloaded2</Value>
|
<Value Profile="(Default)">zaaReloaded2</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
@ -23,9 +20,6 @@
|
|||||||
<Setting Name="ExceptionPostUrl" Type="System.String" Scope="Application">
|
<Setting Name="ExceptionPostUrl" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">http://zaa.nephrowiki.de/postreport.php</Value>
|
<Value Profile="(Default)">http://zaa.nephrowiki.de/postreport.php</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="LastUpdateCheck" Type="System.DateTime" Scope="User">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LicenseUrl" Type="System.Uri" Scope="Application">
|
<Setting Name="LicenseUrl" Type="System.Uri" Scope="Application">
|
||||||
<Value Profile="(Default)">http://www.apache.org/licenses/LICENSE-2.0</Value>
|
<Value Profile="(Default)">http://www.apache.org/licenses/LICENSE-2.0</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
@ -35,9 +29,6 @@
|
|||||||
<Setting Name="SettingsNameClinic" Type="System.String" Scope="Application">
|
<Setting Name="SettingsNameClinic" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">Standard für NepA</Value>
|
<Value Profile="(Default)">Standard für NepA</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="LastSettings" Type="System.Guid" Scope="User">
|
|
||||||
<Value Profile="(Default)">00000000-0000-0000-0000-000000000000</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="StyleParagraph" Type="System.String" Scope="Application">
|
<Setting Name="StyleParagraph" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">zaaReloaded2-Laborwerte</Value>
|
<Value Profile="(Default)">zaaReloaded2-Laborwerte</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
@ -53,9 +44,6 @@
|
|||||||
<Setting Name="SerializationVersion" Type="System.Int32" Scope="Application">
|
<Setting Name="SerializationVersion" Type="System.Int32" Scope="Application">
|
||||||
<Value Profile="(Default)">2</Value>
|
<Value Profile="(Default)">2</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="ImportExportPath" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="StyleHeader" Type="System.String" Scope="Application">
|
<Setting Name="StyleHeader" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">zaaReloaded2-Überschrift</Value>
|
<Value Profile="(Default)">zaaReloaded2-Überschrift</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
@ -65,23 +53,23 @@
|
|||||||
<Setting Name="AbnormalStyle" Type="zaaReloaded2.Formatter.AbnormalStyle" Scope="Application">
|
<Setting Name="AbnormalStyle" Type="zaaReloaded2.Formatter.AbnormalStyle" Scope="Application">
|
||||||
<Value Profile="(Default)">None</Value>
|
<Value Profile="(Default)">None</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="SuppressItemCommentInteraction" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">False</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="FirstRunWizardShown" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">False</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="ManualCommentPrompt" Type="System.String" Scope="Application">
|
<Setting Name="ManualCommentPrompt" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">BITTE_ERGÄNZEN</Value>
|
<Value Profile="(Default)">BITTE_ERGÄNZEN</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="Repository" Type="System.String" Scope="Application">
|
<Setting Name="Repository" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">http://git.bovender.de</Value>
|
<Value Profile="(Default)">http://git.bovender.de</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
<Setting Name="NeedUpgrade" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="DrugsParagraph" Type="System.String" Scope="Application">
|
<Setting Name="DrugsParagraph" Type="System.String" Scope="Application">
|
||||||
<Value Profile="(Default)">zaaReloaded2-Medikamente</Value>
|
<Value Profile="(Default)">zaaReloaded2-Medikamente</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="UserFolder" Type="System.String" Scope="Application">
|
||||||
|
<Value Profile="(Default)">user</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="AppDataFolder" Type="System.String" Scope="Application">
|
||||||
|
<Value Profile="(Default)">zaaReloaded2</Value>
|
||||||
|
</Setting>
|
||||||
|
<Setting Name="UserSettingsFile" Type="System.String" Scope="Application">
|
||||||
|
<Value Profile="(Default)">settings.yml</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
@ -24,11 +24,14 @@ using System.Windows;
|
|||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
namespace zaaReloaded2
|
namespace zaaReloaded2
|
||||||
{
|
{
|
||||||
public partial class ThisAddIn
|
public partial class ThisAddIn
|
||||||
{
|
{
|
||||||
|
#region Static property
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the subdirectory for addin data in the user profile directory.
|
/// Gets the subdirectory for addin data in the user profile directory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -42,43 +45,72 @@ namespace zaaReloaded2
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Start up and shut down
|
||||||
|
|
||||||
private void ThisAddIn_Startup(object sender, System.EventArgs e)
|
private void ThisAddIn_Startup(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
Bovender.ExceptionHandler.CentralHandler.ManageExceptionCallback += CentralHandler_ManageExceptionCallback;
|
#if DEBUG
|
||||||
Bovender.WpfHelpers.RegisterTextBoxSelectAll();
|
Bovender.Logging.LogFile.Default.EnableDebugLogging();
|
||||||
|
#endif
|
||||||
if (Properties.Settings.Default.NeedUpgrade)
|
try
|
||||||
{
|
{
|
||||||
Properties.Settings.Default.Upgrade();
|
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
|
||||||
Properties.Settings.Default.NeedUpgrade = false;
|
if (System.IO.File.Exists(config.FilePath))
|
||||||
Properties.Settings.Default.Save();
|
{
|
||||||
|
System.IO.File.Delete(config.FilePath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Warn("ThisAddIn_Startup: Unable to delete user config file");
|
||||||
|
Logger.Warn(ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bovender.ExceptionHandler.CentralHandler.ManageExceptionCallback += CentralHandler_ManageExceptionCallback;
|
||||||
|
Bovender.WpfHelpers.RegisterTextBoxSelectAll();
|
||||||
|
UserSettings userSettings = UserSettings.Default;
|
||||||
|
|
||||||
CheckForUpdates();
|
CheckForUpdates();
|
||||||
_oldCaption = Globals.ThisAddIn.Application.Caption;
|
Microsoft.Office.Interop.Word.Application word = Globals.ThisAddIn.Application;
|
||||||
Globals.ThisAddIn.Application.Caption =
|
_oldCaption = word.Caption;
|
||||||
|
word.Caption =
|
||||||
String.Format(
|
String.Format(
|
||||||
"{0} ({1} {2})",
|
"{0} ({1} {2})",
|
||||||
_oldCaption,
|
_oldCaption,
|
||||||
Properties.Settings.Default.AddinName,
|
Properties.Settings.Default.AddinName,
|
||||||
Updater.Version.CurrentVersion().ToString()
|
Updater.Version.Current.ToString()
|
||||||
);
|
);
|
||||||
|
|
||||||
ViewModels.FirstRunViewModel.InjectIntoIfNeeded<Views.FirstRunView>();
|
ViewModels.FirstRunViewModel.InjectIntoIfNeeded<Views.FirstRunView>();
|
||||||
|
Logger.Info("ThisAddIn_Startup: Finished startup");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
|
private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
|
||||||
{
|
{
|
||||||
if (_updaterVM != null && _updaterVM.IsUpdatePending)
|
UserSettings.Default.LastVersionSeen = Updater.Version.Current.ToString();
|
||||||
|
UserSettings.Default.Save();
|
||||||
|
|
||||||
|
if (_updaterVM != null && _updaterVM.InstallCommand.CanExecute(null))
|
||||||
{
|
{
|
||||||
if (_updaterVM.InstallUpdateCommand.CanExecute(null))
|
Logger.Info("ThisAddIn_Shutdown: Installing update");
|
||||||
_updaterVM.InstallUpdateCommand.Execute(null);
|
_updaterVM.InstallCommand.Execute(null);
|
||||||
}
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
Logger.Info("ThisAddIn_Shutdown: Resetting application caption");
|
||||||
Globals.ThisAddIn.Application.Caption = _oldCaption;
|
Globals.ThisAddIn.Application.Caption = _oldCaption;
|
||||||
}
|
}
|
||||||
catch { }
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Logger.Warn("ThisAddIn_Shutdown: Failed to reset application caption");
|
||||||
|
Logger.Warn(ex);
|
||||||
}
|
}
|
||||||
|
Logger.Info("ThisAddIn_Shutdown: Finished shutdown");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
|
||||||
@ -109,24 +141,23 @@ namespace zaaReloaded2
|
|||||||
|
|
||||||
void CheckForUpdates()
|
void CheckForUpdates()
|
||||||
{
|
{
|
||||||
if (DateTime.Today == Properties.Settings.Default.LastUpdateCheck.Date)
|
// Check only once per day
|
||||||
|
if (DateTime.Today == UserSettings.Default.LastUpdateCheck.Date)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Properties.Settings.Default.LastUpdateCheck = DateTime.Today;
|
Logger.Info("CheckForUpdates");
|
||||||
Properties.Settings.Default.Save();
|
UserSettings.Default.LastUpdateCheck = DateTime.Today;
|
||||||
|
ReleaseInfo releaseInfo = new ReleaseInfo(new Uri(Properties.Settings.Default.VersionInfoFile));
|
||||||
_updaterVM = new UpdaterViewModel(new Updater.Updater());
|
ReleaseInfoViewModel releaseInfoVM = new ReleaseInfoViewModel(releaseInfo, Updater.Version.Current);
|
||||||
if (!_updaterVM.CanCheckForUpdate) return;
|
releaseInfoVM.UpdateAvailableMessage.Sent += (sender, args) =>
|
||||||
|
|
||||||
_updaterVM.UpdateAvailableMessage.Sent += UpdateAvailableMessage_Sent;
|
|
||||||
_updaterVM.CheckForUpdateCommand.Execute(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UpdateAvailableMessage_Sent(object sender, MessageArgs<ViewModelMessageContent> e)
|
|
||||||
{
|
{
|
||||||
UpdaterViewModel uvm = e.Content.ViewModel as UpdaterViewModel;
|
Logger.Info("CheckForUpdates: Received update-available message");
|
||||||
uvm.DestinationFolder = System.IO.Path.GetTempPath();
|
Updater.Updater updater = Updater.Updater.CreateDefault(releaseInfo);
|
||||||
uvm.DownloadUpdateCommand.Execute(null);
|
updater.DestinationFolder = System.IO.Path.GetTempPath();
|
||||||
|
_updaterVM = new UpdaterViewModel(updater);
|
||||||
|
_updaterVM.StartProcess();
|
||||||
|
};
|
||||||
|
releaseInfoVM.StartProcess();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -145,8 +176,8 @@ namespace zaaReloaded2
|
|||||||
#region Private fields
|
#region Private fields
|
||||||
|
|
||||||
Ribbon _ribbon;
|
Ribbon _ribbon;
|
||||||
UpdaterViewModel _updaterVM;
|
|
||||||
string _oldCaption;
|
string _oldCaption;
|
||||||
|
UpdaterViewModel _updaterVM;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -163,5 +194,13 @@ namespace zaaReloaded2
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Updater.cs
|
using Bovender.Versioning;
|
||||||
|
/* Updater.cs
|
||||||
* part of zaaReloaded2
|
* part of zaaReloaded2
|
||||||
*
|
*
|
||||||
* Copyright 2015 Daniel Kraus
|
* Copyright 2015 Daniel Kraus
|
||||||
@ -24,23 +25,38 @@ namespace zaaReloaded2.Updater
|
|||||||
{
|
{
|
||||||
class Updater : Bovender.Versioning.Updater
|
class Updater : Bovender.Versioning.Updater
|
||||||
{
|
{
|
||||||
protected override Bovender.Versioning.SemanticVersion GetCurrentVersion()
|
#region Static properties
|
||||||
|
|
||||||
|
public static Updater Default { get; set; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Public static methods
|
||||||
|
|
||||||
|
public static Updater CreateDefault(IReleaseInfo releaseInfo)
|
||||||
{
|
{
|
||||||
return Version.CurrentVersion();
|
Default = new Updater(releaseInfo);
|
||||||
|
return Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Uri GetVersionInfoUri()
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
public Updater(Bovender.Versioning.IReleaseInfo releaseInfo)
|
||||||
|
: base(releaseInfo)
|
||||||
{
|
{
|
||||||
return new Uri(Properties.Settings.Default.VersionInfoFile);
|
CurrentVersion = Version.Current;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string BuildDestinationFileName()
|
#endregion
|
||||||
{
|
|
||||||
return System.IO.Path.Combine(
|
|
||||||
DestinationFolder,
|
|
||||||
DownloadUri.ToString().Split('/').Last()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,18 +26,41 @@ namespace zaaReloaded2.Updater
|
|||||||
{
|
{
|
||||||
class Version : SemanticVersion
|
class Version : SemanticVersion
|
||||||
{
|
{
|
||||||
#region Static 'overrides'
|
#region Current version singleton
|
||||||
|
|
||||||
|
public static SemanticVersion Current
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _lazy.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static readonly Lazy<SemanticVersion> _lazy =
|
||||||
|
new Lazy<SemanticVersion>(() => new Version());
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Public method
|
||||||
|
|
||||||
|
public string BrandName
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Properties.Settings.Default.AddinName + " " + ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the current version of the XL Toolbox addin.
|
/// Creates an instance with the current zaaReloaded2 version
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
private Version() : base(Assembly.GetExecutingAssembly()) { }
|
||||||
new public static SemanticVersion CurrentVersion()
|
|
||||||
{
|
public Version(string version) : base(version) { }
|
||||||
return Bovender.Versioning.SemanticVersion.CurrentVersion(
|
|
||||||
Assembly.GetExecutingAssembly()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
198
zaaReloaded2/UserSettings.cs
Executable file
198
zaaReloaded2/UserSettings.cs
Executable file
@ -0,0 +1,198 @@
|
|||||||
|
/* UserSettings.cs
|
||||||
|
* part of zaaReloaded2
|
||||||
|
*
|
||||||
|
* Copyright 2016 Daniel Kraus
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace zaaReloaded2
|
||||||
|
{
|
||||||
|
[Serializable]
|
||||||
|
class UserSettings : Bovender.UserSettings.UserSettingsBase
|
||||||
|
{
|
||||||
|
#region Static property
|
||||||
|
|
||||||
|
public static string UserSettingsFile
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Path.Combine(
|
||||||
|
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||||
|
Properties.Settings.Default.AppDataFolder,
|
||||||
|
Properties.Settings.Default.UserFolder,
|
||||||
|
Properties.Settings.Default.UserSettingsFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Singleton factory
|
||||||
|
|
||||||
|
new public static UserSettings Default
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _lazy.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Lazy<UserSettings> _lazy = new Lazy<UserSettings>(() =>
|
||||||
|
{
|
||||||
|
// Logger.Info("Initializing singleton instance");
|
||||||
|
UserSettings s = FromFileOrDefault<UserSettings>(UserSettingsFile);
|
||||||
|
Bovender.UserSettings.UserSettingsBase.Default = s;
|
||||||
|
return s;
|
||||||
|
});
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region User settings
|
||||||
|
|
||||||
|
public DateTime LastUpdateCheck
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_lastUpdateCheck == null)
|
||||||
|
{
|
||||||
|
_lastUpdateCheck = new DateTime(2016, 1, 1);
|
||||||
|
}
|
||||||
|
return _lastUpdateCheck;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_lastUpdateCheck = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LastVersionSeen
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_lastVersionSeen == null)
|
||||||
|
{
|
||||||
|
_lastVersionSeen = DEFAULT_VERSION;
|
||||||
|
}
|
||||||
|
return _lastVersionSeen;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_lastVersionSeen = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int UpdateCheckInterval
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_updateCheckInterval <= 0)
|
||||||
|
{
|
||||||
|
_updateCheckInterval = 7;
|
||||||
|
}
|
||||||
|
return _updateCheckInterval;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_updateCheckInterval = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool EnableLogging
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return LogFile.IsInitializedAndEnabled;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
LogFile.Default.IsFileLoggingEnabled = true;
|
||||||
|
}
|
||||||
|
else if (LogFile.IsInitializedAndEnabled)
|
||||||
|
{
|
||||||
|
LogFile.Default.IsFileLoggingEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public string ImportExportPath { get; set; }
|
||||||
|
|
||||||
|
public bool SuppressItemCommentInteraction { get; set; }
|
||||||
|
|
||||||
|
public Guid LastSettings
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_lastSettings == null)
|
||||||
|
{
|
||||||
|
_lastSettings = new Guid("00000000-0000-0000-0000-000000000000");
|
||||||
|
}
|
||||||
|
return _lastSettings;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_lastSettings = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string SettingsRepository { get; set; }
|
||||||
|
|
||||||
|
[YamlDotNet.Serialization.YamlIgnore]
|
||||||
|
public bool FirstRun { get { return LastVersionSeen == DEFAULT_VERSION; } }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Private fields
|
||||||
|
|
||||||
|
private DateTime _lastUpdateCheck;
|
||||||
|
private int _updateCheckInterval;
|
||||||
|
private string _lastVersionSeen;
|
||||||
|
private Guid _lastSettings;
|
||||||
|
private const string DEFAULT_VERSION = "0.0.0";
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Overrides
|
||||||
|
|
||||||
|
public override string GetSettingsFilePath()
|
||||||
|
{
|
||||||
|
return UserSettingsFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructor
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a new instance. This should never be called directly, use
|
||||||
|
/// the singleton factory instead. The constructor must be public to
|
||||||
|
/// enable deserialization.
|
||||||
|
/// </summary>
|
||||||
|
public UserSettings() { }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Class logger
|
||||||
|
|
||||||
|
private static NLog.Logger Logger { get { return _logger.Value; } }
|
||||||
|
|
||||||
|
private static readonly Lazy<NLog.Logger> _logger = new Lazy<NLog.Logger>(() => NLog.LogManager.GetCurrentClassLogger());
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
@ -67,7 +67,7 @@ namespace zaaReloaded2.ViewModels
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return zaaReloaded2.Updater.Version.CurrentVersion().ToString();
|
return zaaReloaded2.Updater.Version.Current.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ namespace zaaReloaded2.ViewModels
|
|||||||
public static void InjectIntoIfNeeded<T>()
|
public static void InjectIntoIfNeeded<T>()
|
||||||
where T: System.Windows.Window, new()
|
where T: System.Windows.Window, new()
|
||||||
{
|
{
|
||||||
if (!Properties.Settings.Default.FirstRunWizardShown)
|
if (UserSettings.Default.FirstRun)
|
||||||
{
|
{
|
||||||
FirstRunViewModel vm = new FirstRunViewModel();
|
FirstRunViewModel vm = new FirstRunViewModel();
|
||||||
vm.InjectInto<T>().Show();
|
vm.InjectInto<T>().Show();
|
||||||
@ -93,34 +93,19 @@ namespace zaaReloaded2.ViewModels
|
|||||||
void DoSelectDoctorsMode()
|
void DoSelectDoctorsMode()
|
||||||
{
|
{
|
||||||
// Properties will be saved by the DoCloseView override.
|
// Properties will be saved by the DoCloseView override.
|
||||||
Properties.Settings.Default.SuppressItemCommentInteraction = false;
|
UserSettings.Default.SuppressItemCommentInteraction = false;
|
||||||
CloseViewCommand.Execute(null);
|
CloseViewCommand.Execute(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoSelectTypistsMode()
|
void DoSelectTypistsMode()
|
||||||
{
|
{
|
||||||
// Properties will be saved by the DoCloseView override.
|
// Properties will be saved by the DoCloseView override.
|
||||||
Properties.Settings.Default.SuppressItemCommentInteraction = true;
|
UserSettings.Default.SuppressItemCommentInteraction = true;
|
||||||
CloseViewCommand.Execute(null);
|
CloseViewCommand.Execute(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Overrides
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Sets the FirstRunWizardShown property of the assembly properties
|
|
||||||
/// to true and calls the base function to close the associated view.
|
|
||||||
/// </summary>
|
|
||||||
protected override void DoCloseView()
|
|
||||||
{
|
|
||||||
Properties.Settings.Default.FirstRunWizardShown = true;
|
|
||||||
Properties.Settings.Default.Save();
|
|
||||||
base.DoCloseView();
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Implementation of ViewModelBase
|
#region Implementation of ViewModelBase
|
||||||
|
|
||||||
public override object RevealModelObject()
|
public override object RevealModelObject()
|
||||||
|
@ -29,25 +29,47 @@ namespace zaaReloaded2.ViewModels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class PreferencesViewModel : ViewModelBase
|
public class PreferencesViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
#region Singleton
|
#region Properties
|
||||||
|
|
||||||
public static PreferencesViewModel Default
|
public bool SuppressItemCommentInteraction
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return _instance;
|
return _suppressCommentInteraction;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != _suppressCommentInteraction)
|
||||||
|
{
|
||||||
|
_suppressCommentInteraction = value;
|
||||||
|
OnPropertyChanged("SuppressItemCommentInteraction");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static PreferencesViewModel() { }
|
public bool EnableLogging
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _enableLogging;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value != _enableLogging)
|
||||||
|
{
|
||||||
|
_enableLogging = value;
|
||||||
|
OnPropertyChanged("EnableLogging");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static readonly PreferencesViewModel _instance = new PreferencesViewModel();
|
public string LogFolder
|
||||||
|
{
|
||||||
#endregion
|
get
|
||||||
|
{
|
||||||
#region Properties
|
return LogFile.Default.LogFolder;
|
||||||
|
}
|
||||||
public bool SuppressItemCommentInteraction { get; set; }
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -67,13 +89,32 @@ namespace zaaReloaded2.ViewModels
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DelegatingCommand OpenLogFolderCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_openLogFolderCommand == null)
|
||||||
|
{
|
||||||
|
_openLogFolderCommand = new DelegatingCommand(
|
||||||
|
param => DoOpenLogFolder(),
|
||||||
|
param => CanOpenLogFolder());
|
||||||
|
}
|
||||||
|
return _openLogFolderCommand;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
|
|
||||||
public PreferencesViewModel()
|
public PreferencesViewModel()
|
||||||
{
|
{
|
||||||
SuppressItemCommentInteraction = Preferences.Default.SuppressItemCommentInteraction;
|
_suppressCommentInteraction = UserSettings.Default.SuppressItemCommentInteraction;
|
||||||
|
_enableLogging = UserSettings.Default.EnableLogging;
|
||||||
|
PropertyChanged += (sender, args) =>
|
||||||
|
{
|
||||||
|
_dirty = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -82,20 +123,45 @@ namespace zaaReloaded2.ViewModels
|
|||||||
|
|
||||||
void DoSave()
|
void DoSave()
|
||||||
{
|
{
|
||||||
Preferences.Default.SuppressItemCommentInteraction = SuppressItemCommentInteraction;
|
if (_dirty)
|
||||||
|
{
|
||||||
|
UserSettings.Default.SuppressItemCommentInteraction = SuppressItemCommentInteraction;
|
||||||
|
UserSettings.Default.EnableLogging = EnableLogging;
|
||||||
|
}
|
||||||
DoCloseView();
|
DoCloseView();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CanSave()
|
bool CanSave()
|
||||||
{
|
{
|
||||||
return true;
|
return _dirty;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DoOpenLogFolder()
|
||||||
|
{
|
||||||
|
if (CanOpenLogFolder())
|
||||||
|
{
|
||||||
|
System.Diagnostics.Process.Start(LogFolder);
|
||||||
|
if (!_dirty)
|
||||||
|
{
|
||||||
|
CloseViewCommand.Execute(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CanOpenLogFolder()
|
||||||
|
{
|
||||||
|
return !String.IsNullOrEmpty(LogFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Field
|
#region Fields
|
||||||
|
|
||||||
DelegatingCommand _saveCommand;
|
DelegatingCommand _saveCommand;
|
||||||
|
DelegatingCommand _openLogFolderCommand;
|
||||||
|
bool _dirty;
|
||||||
|
bool _enableLogging;
|
||||||
|
bool _suppressCommentInteraction;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -103,7 +169,7 @@ namespace zaaReloaded2.ViewModels
|
|||||||
|
|
||||||
public override object RevealModelObject()
|
public override object RevealModelObject()
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
return UserSettings.Default;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -445,8 +445,7 @@ namespace zaaReloaded2.ViewModels
|
|||||||
{
|
{
|
||||||
if (message.Confirmed)
|
if (message.Confirmed)
|
||||||
{
|
{
|
||||||
Properties.Settings.Default.ImportExportPath = message.Value;
|
UserSettings.Default.ImportExportPath = message.Value;
|
||||||
Properties.Settings.Default.Save();
|
|
||||||
Settings settings = LastSelected.RevealModelObject() as Settings;
|
Settings settings = LastSelected.RevealModelObject() as Settings;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -477,8 +476,7 @@ namespace zaaReloaded2.ViewModels
|
|||||||
{
|
{
|
||||||
if (message.Confirmed)
|
if (message.Confirmed)
|
||||||
{
|
{
|
||||||
Properties.Settings.Default.ImportExportPath = message.Value;
|
UserSettings.Default.ImportExportPath = message.Value;
|
||||||
Properties.Settings.Default.Save();
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Settings settings = Settings.LoadFromFile(message.Value);
|
Settings settings = Settings.LoadFromFile(message.Value);
|
||||||
@ -495,7 +493,7 @@ namespace zaaReloaded2.ViewModels
|
|||||||
|
|
||||||
string SuggestImportExportPath()
|
string SuggestImportExportPath()
|
||||||
{
|
{
|
||||||
string path = Properties.Settings.Default.ImportExportPath;
|
string path = UserSettings.Default.ImportExportPath;
|
||||||
if (String.IsNullOrEmpty(path))
|
if (String.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
return Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
|
||||||
|
@ -23,22 +23,36 @@
|
|||||||
xmlns:b="clr-namespace:Bovender.Mvvm.Views.Settings;assembly=Bovender"
|
xmlns:b="clr-namespace:Bovender.Mvvm.Views.Settings;assembly=Bovender"
|
||||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||||
xmlns:action="clr-namespace:Bovender.Mvvm.Actions;assembly=Bovender"
|
xmlns:action="clr-namespace:Bovender.Mvvm.Actions;assembly=Bovender"
|
||||||
SizeToContent="WidthAndHeight" ResizeMode="NoResize" ShowInTaskbar="False"
|
SizeToContent="WidthAndHeight" ResizeMode="NoResize"
|
||||||
|
ShowInTaskbar="False" Topmost="True"
|
||||||
b:WindowState.CenterScreen="True" b:WindowState.Save="True"
|
b:WindowState.CenterScreen="True" b:WindowState.Save="True"
|
||||||
Title="Einstellungen"
|
Title="Einstellungen"
|
||||||
>
|
>
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<ResourceDictionary Source="/Bovender;component/Style.xaml" />
|
<ResourceDictionary Source="/Bovender;component/Style.xaml" />
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<DockPanel Margin="10">
|
<DockPanel Margin="20">
|
||||||
<UniformGrid DockPanel.Dock="Bottom" Columns="2" Rows="1"
|
<UniformGrid DockPanel.Dock="Bottom" Columns="2" Rows="1"
|
||||||
HorizontalAlignment="Right" Margin="0 10 0 0">
|
HorizontalAlignment="Right" Margin="0 20 0 0">
|
||||||
<Button Command="{Binding SaveCommand}" Content="OK" IsDefault="True" Margin="0 0 5 0" />
|
<Button Command="{Binding SaveCommand}" Content="OK" IsDefault="True" Margin="0 0 5 0" />
|
||||||
<Button Command="{Binding CloseViewCommand}" Content="Abbrechen" IsCancel="True" Margin="5 0 0 0" />
|
<Button Command="{Binding CloseViewCommand}" Content="Abbrechen" IsCancel="True" Margin="5 0 0 0" />
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
<GroupBox Header="Sekretariatsmodus" Padding="10">
|
<StackPanel>
|
||||||
<CheckBox IsChecked="{Binding SuppressItemCommentInteraction}" Content="Keine Interaktion für _Kommentare">
|
<GroupBox Header="Sekretariatsmodus" Margin="0 0 0 5" Padding="10">
|
||||||
</CheckBox>
|
<StackPanel>
|
||||||
|
<CheckBox IsChecked="{Binding SuppressItemCommentInteraction}" Content="Keine Interaktion für _Kommentare" />
|
||||||
|
</StackPanel>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
<GroupBox Header="Debugging" Margin="0 5 0 0" Padding="10">
|
||||||
|
<StackPanel>
|
||||||
|
<CheckBox IsChecked="{Binding EnableLogging}" Content="_Logfile aktivieren" />
|
||||||
|
<TextBlock Margin="0 10 0 0">
|
||||||
|
<Hyperlink Command="{Binding OpenLogFolderCommand}">
|
||||||
|
<TextBlock Text="{Binding LogFolder}" />
|
||||||
|
</Hyperlink>
|
||||||
|
</TextBlock>
|
||||||
|
</StackPanel>
|
||||||
|
</GroupBox>
|
||||||
|
</StackPanel>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Window>
|
</Window>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
app.config
|
app.config
|
||||||
@ -20,12 +20,9 @@
|
|||||||
-->
|
-->
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<section name="zaaReloaded2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="zaaReloaded2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</sectionGroup>
|
</sectionGroup>
|
||||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
|
||||||
<section name="zaaReloaded2.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
|
||||||
</sectionGroup>
|
|
||||||
</configSections>
|
</configSections>
|
||||||
<applicationSettings>
|
<applicationSettings>
|
||||||
<zaaReloaded2.Properties.Settings>
|
<zaaReloaded2.Properties.Settings>
|
||||||
@ -59,9 +56,6 @@
|
|||||||
<setting name="StyleParagraph" serializeAs="String">
|
<setting name="StyleParagraph" serializeAs="String">
|
||||||
<value>zaaReloaded2-Laborwerte</value>
|
<value>zaaReloaded2-Laborwerte</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="ReferenceStyle" serializeAs="String">
|
|
||||||
<value>IfSpecialOrAbnormal</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="FormatElementLabel" serializeAs="String">
|
<setting name="FormatElementLabel" serializeAs="String">
|
||||||
<value>Ausgabe-Elemente</value>
|
<value>Ausgabe-Elemente</value>
|
||||||
</setting>
|
</setting>
|
||||||
@ -77,9 +71,6 @@
|
|||||||
<setting name="StyleAbnormal" serializeAs="String">
|
<setting name="StyleAbnormal" serializeAs="String">
|
||||||
<value>zaaReloaded2-Pathologisch</value>
|
<value>zaaReloaded2-Pathologisch</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="AbnormalStyle" serializeAs="String">
|
|
||||||
<value>None</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="ManualCommentPrompt" serializeAs="String">
|
<setting name="ManualCommentPrompt" serializeAs="String">
|
||||||
<value>BITTE_ERGÄNZEN</value>
|
<value>BITTE_ERGÄNZEN</value>
|
||||||
</setting>
|
</setting>
|
||||||
@ -89,31 +80,23 @@
|
|||||||
<setting name="DrugsParagraph" serializeAs="String">
|
<setting name="DrugsParagraph" serializeAs="String">
|
||||||
<value>zaaReloaded2-Medikamente</value>
|
<value>zaaReloaded2-Medikamente</value>
|
||||||
</setting>
|
</setting>
|
||||||
|
<setting name="UserFolder" serializeAs="String">
|
||||||
|
<value>user</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="AppDataFolder" serializeAs="String">
|
||||||
|
<value>zaaReloaded2</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="UserSettingsFile" serializeAs="String">
|
||||||
|
<value>settings.yml</value>
|
||||||
|
</setting>
|
||||||
</zaaReloaded2.Properties.Settings>
|
</zaaReloaded2.Properties.Settings>
|
||||||
</applicationSettings>
|
</applicationSettings>
|
||||||
<userSettings>
|
<runtime>
|
||||||
<zaaReloaded2.Properties.Settings>
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<setting name="SettingsRepository" serializeAs="String">
|
<dependentAssembly>
|
||||||
<value />
|
<assemblyIdentity name="YamlDotNet" publicKeyToken="ec19458f3c15af5e" culture="neutral" />
|
||||||
</setting>
|
<bindingRedirect oldVersion="0.0.0.0-3.9.0.0" newVersion="3.9.0.0" />
|
||||||
<setting name="LastUpdateCheck" serializeAs="String">
|
</dependentAssembly>
|
||||||
<value />
|
</assemblyBinding>
|
||||||
</setting>
|
</runtime>
|
||||||
<setting name="LastSettings" serializeAs="String">
|
|
||||||
<value>00000000-0000-0000-0000-000000000000</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="ImportExportPath" serializeAs="String">
|
|
||||||
<value />
|
|
||||||
</setting>
|
|
||||||
<setting name="SuppressItemCommentInteraction" serializeAs="String">
|
|
||||||
<value>False</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="FirstRunWizardShown" serializeAs="String">
|
|
||||||
<value>False</value>
|
|
||||||
</setting>
|
|
||||||
<setting name="NeedUpgrade" serializeAs="String">
|
|
||||||
<value>True</value>
|
|
||||||
</setting>
|
|
||||||
</zaaReloaded2.Properties.Settings>
|
|
||||||
</userSettings>
|
|
||||||
</configuration>
|
</configuration>
|
@ -19,8 +19,8 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<packages>
|
<packages>
|
||||||
<package id="Bovender" version="0.14.1.0" targetFramework="net40" />
|
<package id="Bovender" version="0.14.4.0" targetFramework="net40" />
|
||||||
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net40" />
|
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net40" />
|
||||||
<package id="NLog" version="4.3.7" targetFramework="net40" />
|
<package id="NLog" version="4.3.7" targetFramework="net40" />
|
||||||
<package id="YamlDotNet" version="3.9.0" targetFramework="net40" />
|
<package id="YamlDotNet.Signed" version="3.9.0" targetFramework="net40" />
|
||||||
</packages>
|
</packages>
|
@ -134,8 +134,8 @@
|
|||||||
-->
|
-->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Accessibility" />
|
<Reference Include="Accessibility" />
|
||||||
<Reference Include="Bovender, Version=0.14.1.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
|
<Reference Include="Bovender, Version=0.14.4.0, Culture=neutral, PublicKeyToken=df1c15557d8b6df8, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Bovender.0.14.1.0\lib\net40\Bovender.dll</HintPath>
|
<HintPath>..\packages\Bovender.0.14.4.0\lib\net40\Bovender.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||||
@ -146,6 +146,7 @@
|
|||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.configuration" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
|
<Reference Include="System.Runtime.Serialization.Formatters.Soap" />
|
||||||
@ -160,8 +161,8 @@
|
|||||||
<Reference Include="System.Data.DataSetExtensions" />
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="YamlDotNet, Version=3.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="YamlDotNet, Version=3.9.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\YamlDotNet.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
|
<HintPath>..\packages\YamlDotNet.Signed.3.9.0\lib\net35\YamlDotNet.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -230,10 +231,10 @@
|
|||||||
<Compile Include="Formatter\DanielsStyle.cs" />
|
<Compile Include="Formatter\DanielsStyle.cs" />
|
||||||
<Compile Include="Formatter\DocumentWriter.cs" />
|
<Compile Include="Formatter\DocumentWriter.cs" />
|
||||||
<Compile Include="Formatter\NoLaboratoryDataException.cs" />
|
<Compile Include="Formatter\NoLaboratoryDataException.cs" />
|
||||||
|
<Compile Include="LogFile.cs" />
|
||||||
<Compile Include="Medication\Formatter.cs" />
|
<Compile Include="Medication\Formatter.cs" />
|
||||||
<Compile Include="Medication\Importer.cs" />
|
<Compile Include="Medication\Importer.cs" />
|
||||||
<Compile Include="Medication\Prescription.cs" />
|
<Compile Include="Medication\Prescription.cs" />
|
||||||
<Compile Include="Preferences.cs" />
|
|
||||||
<Compile Include="Ribbon.cs" />
|
<Compile Include="Ribbon.cs" />
|
||||||
<Compile Include="Thesaurus\ThesaurusBase.cs" />
|
<Compile Include="Thesaurus\ThesaurusBase.cs" />
|
||||||
<Compile Include="Formatter\IItemFormatterDictionary.cs" />
|
<Compile Include="Formatter\IItemFormatterDictionary.cs" />
|
||||||
|
Loading…
Reference in New Issue
Block a user