diff --git a/ENI-2/ENI2/ENI2/App.config b/ENI-2/ENI2/ENI2/App.config
index e175721e..7b435d1f 100644
--- a/ENI-2/ENI2/ENI2/App.config
+++ b/ENI-2/ENI2/ENI2/App.config
@@ -1,6 +1,6 @@
@@ -35,7 +35,15 @@ Sample license text.
-
-
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ENI-2/ENI2/ENI2/App.xaml.cs b/ENI-2/ENI2/ENI2/App.xaml.cs
index ed258f01..63f11d5e 100644
--- a/ENI-2/ENI2/ENI2/App.xaml.cs
+++ b/ENI-2/ENI2/ENI2/App.xaml.cs
@@ -10,6 +10,8 @@ using System.Windows.Controls;
using System.Windows.Input;
using System;
using System.Net;
+using ENI2.LockingServiceReference;
+using System.Threading;
namespace ENI2
{
@@ -17,7 +19,15 @@ namespace ENI2
/// Interaction logic for App.xaml
///
public partial class App : Application
- {
+ {
+ // "global" statics, da gibt es sicher noch einen eleganteren Weg..
+ private static ServiceClient _lockingServiceClient = null;
+ private static Guid? _userId = null;
+
+ // Splash screen
+ private static SplashScreenWindow _splashScreenWindow;
+ private ManualResetEvent ResetSplashCreated;
+ private Thread _splashThread;
public App() : base()
{
@@ -27,8 +37,23 @@ namespace ENI2
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
}
+ public static ServiceClient LockingServiceClient { get { return _lockingServiceClient; } }
+
+ public static SplashScreenWindow SplashScreen { get { return _splashScreenWindow; } }
+
+ public static Guid? UserId { get { return _userId; } }
+
protected override void OnStartup(StartupEventArgs e)
{
+ this.ResetSplashCreated = new ManualResetEvent(false);
+ this._splashThread = new Thread(ShowSplash);
+ _splashThread.SetApartmentState(ApartmentState.STA);
+ _splashThread.IsBackground = true;
+ _splashThread.Name = "Splash Screen";
+ _splashThread.Start();
+
+ ResetSplashCreated.WaitOne();
+
base.OnStartup(e);
// initialize static / localized lookups from sqlite database
@@ -44,8 +69,18 @@ namespace ENI2
// perform logon
// TODO: Benutzerverwaltung
-
-
+
+ // Connect to locking service (if enabled)
+
+ try
+ {
+ if (ENI2.Properties.Settings.Default.UseLocking)
+ App._lockingServiceClient = new ServiceClient("BasicHttpBinding_IService", ENI2.Properties.Settings.Default.LockingServerAddress);
+ }
+ catch (Exception ex)
+ {
+ System.Diagnostics.Trace.WriteLine("Exception creating locking service client: {0}", ex.ToString());
+ }
}
@@ -83,5 +118,14 @@ namespace ENI2
}
}
+ private void ShowSplash()
+ {
+ _splashScreenWindow = new SplashScreenWindow();
+ _splashScreenWindow.Show();
+
+ ResetSplashCreated.Set();
+ System.Windows.Threading.Dispatcher.Run();
+ }
+
}
}
diff --git a/ENI-2/ENI2/ENI2/DetailBaseControl.cs b/ENI-2/ENI2/ENI2/DetailBaseControl.cs
index a1512418..4426c79e 100644
--- a/ENI-2/ENI2/ENI2/DetailBaseControl.cs
+++ b/ENI-2/ENI2/ENI2/DetailBaseControl.cs
@@ -8,14 +8,30 @@ using System.Windows.Controls;
using bsmd.database;
using System.Windows.Media.Imaging;
+using System.ComponentModel;
namespace ENI2
{
public class DetailBaseControl : UserControl
{
+ #region Fields
+
protected bool _initialized = false;
+ private DependencyPropertyDescriptor _dpTextBox;
+ private DependencyPropertyDescriptor _dpDatePicker;
+ private DependencyPropertyDescriptor _dpLocode;
+ private DependencyPropertyDescriptor _dpCheckbox;
+ private DependencyPropertyDescriptor _dpComboboxIndex;
+ private DependencyPropertyDescriptor _dpComboboxValue;
+ private DependencyPropertyDescriptor _dpNumericUpdown;
+ private Dictionary