initial oogynize check in _ this actually used to work!
77
Client Services/GUIWPForms/ComponentState.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Reflection;
|
||||
|
||||
// Ooganizer Namespaces
|
||||
using Foo.Platform;
|
||||
using Foo.DataAccessLayer;
|
||||
using Foo.DataAccessLayer.DataTypes;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// This class is responsible for launch all secondary threads required for this application as
|
||||
/// well as hold any variables that are needed by all classes
|
||||
/// created.
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
internal class ComponentState
|
||||
{
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// This class manages the state / main variables of the COM+ that maybe needed by multiple classes.
|
||||
/// It is responsible for starting and stopping any secondary threads.
|
||||
/// </summary>
|
||||
static ComponentState()
|
||||
{
|
||||
// We must subscribe to assembly resolver
|
||||
Log.Info(string.Format("{0}() - GUIWPForms ComponentState() called. Application is starting...", MethodBase.GetCurrentMethod().Name));
|
||||
|
||||
// Let's Preload the Database *Right here, right now* that should be good for all of us
|
||||
Data.Artifacts.DoesArtifactExistInSystem(DataTypeHelpers.CreateLocationOnlyArtifact("C:\\Dummy.file"));
|
||||
|
||||
// Start GUI Dispatcher Thread
|
||||
Log.Info(string.Format("{0}() - GUIWPForms ComponentState() called. Activating DispatcherThread", MethodBase.GetCurrentMethod().Name));
|
||||
DispatcherThread.Run = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Private Variables
|
||||
/// </summary>
|
||||
private static bool s_bApplicationIsRunning = false;
|
||||
|
||||
/// <summary>
|
||||
/// Use this to enable/disable all threads and variables for
|
||||
/// the component states
|
||||
/// </summary>
|
||||
public static bool ApplicationIsRunning
|
||||
{
|
||||
get { return s_bApplicationIsRunning; }
|
||||
set
|
||||
{
|
||||
if (!value)
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ComponentState() sApplicationRunning set to False", MethodBase.GetCurrentMethod().Name));
|
||||
DispatcherThread.Run = false;
|
||||
}
|
||||
|
||||
s_bApplicationIsRunning = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this to access the GUIFormsMgr Object in order to
|
||||
/// communicate to wpfForms (Setter should only be called by
|
||||
/// DispatcherThread)
|
||||
/// </summary>
|
||||
public static GUIFormsMgr GUIFormsMgr
|
||||
{
|
||||
get { return DispatcherThread.s_GUIFormsMgr; }
|
||||
}
|
||||
}
|
||||
}
|
||||
131
Client Services/GUIWPForms/DispatcherThread.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
|
||||
// Ooganizer Namespaces
|
||||
using Foo.Platform;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// This class is responsible for creation and deltion of ButtonFormMgr.cs on a
|
||||
/// Dispatcher Thread. ~The Dispatcher is responsible for all the messages being passed
|
||||
/// for the Form Objects, it must be running at all times and created before any forms get
|
||||
/// created.
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
class DispatcherThread
|
||||
{
|
||||
|
||||
// Member Variables
|
||||
private static Thread s_DispatcherThread = null;
|
||||
private static bool s_DispatcherThreadIsInitialized = false;
|
||||
internal static GUIFormsMgr s_GUIFormsMgr = null;
|
||||
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Constructor by default will launch the thread if needed
|
||||
/// </summary>
|
||||
static DispatcherThread()
|
||||
{
|
||||
Log.Info(string.Format("{0}() - DispatcherThread() called", MethodBase.GetCurrentMethod().Name));
|
||||
StartDispatcherThreadIfNeeded();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this property to set the Dispatcher to running / not running
|
||||
/// </summary>
|
||||
public static bool Run
|
||||
{
|
||||
get { return s_DispatcherThreadIsInitialized; }
|
||||
set
|
||||
{
|
||||
if (!value)
|
||||
TerminateDispatcherThreadIfNeeded();
|
||||
|
||||
s_DispatcherThreadIsInitialized = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Message Loop Thread for wpfGUIForms
|
||||
/// </summary>
|
||||
private static void DispatcherThreadProc()
|
||||
{
|
||||
// Create ButtonFormMgr Object on this thread *Allow global access to the object*
|
||||
Log.Info(string.Format("{0}() - About to new GUIFormsMgr via DispatcherThread", MethodBase.GetCurrentMethod().Name));
|
||||
s_GUIFormsMgr = new GUIFormsMgr(Dispatcher.CurrentDispatcher);
|
||||
|
||||
Log.Info(string.Format("{0}() - GUIFormsMgr DispatcherThread is initialized s_DispatcherThreadIsInitialized is True", MethodBase.GetCurrentMethod().Name));
|
||||
s_DispatcherThreadIsInitialized = true; // always set to true to allow caller to exit out
|
||||
|
||||
if (s_GUIFormsMgr != null)
|
||||
{
|
||||
Log.Info(string.Format("{0}() - GUIFormsMgr Launched via DispatcherThread", MethodBase.GetCurrentMethod().Name));
|
||||
|
||||
//Enter Dispatcher Message Loop
|
||||
System.Windows.Threading.Dispatcher.Run();
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error(string.Format("{0}() - GUIFormsMgr Launch Failed! Exiting Thread - Major Error must have occured", MethodBase.GetCurrentMethod().Name));
|
||||
// exit thread - no need to stay here
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this function to start ThreadProc(above) if needed. COM+ can shutdown the thread anytime,
|
||||
/// we need to make sure that the thread is alive BEFORE calling ButtonForms
|
||||
/// </summary>
|
||||
private static void StartDispatcherThreadIfNeeded()
|
||||
{
|
||||
if (s_DispatcherThread != null && s_DispatcherThread.IsAlive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
s_DispatcherThreadIsInitialized = false;
|
||||
|
||||
// Start a new Thread so it can become the Message Loop
|
||||
s_DispatcherThread = new Thread(new ThreadStart(DispatcherThread.DispatcherThreadProc));
|
||||
|
||||
// GUI components require the thread to be STA; otherwise throws an error
|
||||
s_DispatcherThread.SetApartmentState(ApartmentState.STA);
|
||||
Log.Info(string.Format("{0}() - Starting DispatcherThread...", MethodBase.GetCurrentMethod().Name));
|
||||
s_DispatcherThread.Start();
|
||||
Log.Info(string.Format("{0}() - DispatcherThread Started.", MethodBase.GetCurrentMethod().Name));
|
||||
|
||||
// Make sure the Application Object is running
|
||||
// (COM will eventually just time out otherwise)
|
||||
//while (!s_DispatcherThreadIsInitialized)
|
||||
// System.Threading.Thread.Sleep(20); // Syncronous call
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Terminates all ButtonForm Objects and the Message Dispatcher Thread *do this only on shutdown*
|
||||
/// </summary>
|
||||
private static void TerminateDispatcherThreadIfNeeded()
|
||||
{
|
||||
if (s_DispatcherThreadIsInitialized)
|
||||
{
|
||||
// Delete s_GUIFormsMgr and all wpfForms from this thread
|
||||
s_GUIFormsMgr.TerminateDISP();
|
||||
s_GUIFormsMgr = null;
|
||||
|
||||
s_DispatcherThread.Abort();
|
||||
s_DispatcherThreadIsInitialized = false;
|
||||
Log.Info(string.Format("{0}() - GUIFormsMgr is DispatcherThread shutdown s_DispatcherThreadIsInitialized is False", MethodBase.GetCurrentMethod().Name));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
381
Client Services/GUIWPForms/GUIFormsMgr.cs
Normal file
@@ -0,0 +1,381 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Windows.Interop;
|
||||
using System.EnterpriseServices;
|
||||
using System.Windows;
|
||||
using System.IO;
|
||||
using System.Windows.Threading;
|
||||
using System.Collections;
|
||||
using System.Reflection;
|
||||
|
||||
using Foo.Platform;
|
||||
using Foo.GUILib;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
internal enum WPForms
|
||||
{
|
||||
ArtifactWall,
|
||||
WorkspaceSelector,
|
||||
SettingsNAboutUs,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Object Factory Creator for WPForms above
|
||||
/// </summary>
|
||||
internal class GUIWPFormsObjectFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Object Form Factory for all our GUI Forms
|
||||
/// </summary>
|
||||
/// <param name="form">a WPF form object to create</param>
|
||||
/// <param name="bPerformanceCache">true if to create a performanceCache window, should be false all other times</param>
|
||||
/// <returns></returns>
|
||||
public static Window CreateWPFormWindow(WPForms form, bool bPerformanceCache)
|
||||
{
|
||||
Window wpfForm = null;
|
||||
switch (form)
|
||||
{
|
||||
case WPForms.ArtifactWall:
|
||||
wpfForm = new ArtifactWall(bPerformanceCache);
|
||||
break;
|
||||
|
||||
case WPForms.WorkspaceSelector:
|
||||
wpfForm = new WorkspaceSelector(bPerformanceCache);
|
||||
break;
|
||||
|
||||
case WPForms.SettingsNAboutUs:
|
||||
wpfForm = new SettingsNAboutUs(bPerformanceCache);
|
||||
break;
|
||||
}
|
||||
|
||||
// Imp! - if this is being loaded for performance we must handle it
|
||||
WPFHiddenWindow.ExecuteShowOnAHiddenWindow(wpfForm, bPerformanceCache);
|
||||
|
||||
return wpfForm;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class manages the creation/deletion and actions of (1 - n) ButtonForms
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
internal class GUIFormsMgr
|
||||
{
|
||||
|
||||
private const int INITIAL_OBJECT_CAPACITY = 30;
|
||||
private Hashtable m_ObjectList = null;
|
||||
private Dispatcher m_Dispatcher = null;
|
||||
|
||||
// load one instance of all wpforms (hidden) cached always, as a performance cache
|
||||
private Window[] m_wpfCachedForms = null;
|
||||
private bool m_AreWpfFormsCached = false;
|
||||
|
||||
// Imp! - allows external caller to run any action on a Window
|
||||
public delegate void _Action(Window wpfForm);
|
||||
|
||||
//custom private delegates
|
||||
private delegate bool delegate_Create(WPForms wpfFormType);
|
||||
private delegate bool delegate_Show(WPForms wpfFormType);
|
||||
private delegate bool delegate_Delete(WPForms wpfFormType);
|
||||
private delegate bool delegate_Action(WPForms wpfFormType, _Action action);
|
||||
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// GUIFormsMgr - Responsible for managing the GUI Window Messaging Threads
|
||||
/// </summary>
|
||||
/// <param name="disp">Dispatcher Thread Context</param>
|
||||
public GUIFormsMgr(Dispatcher disp)
|
||||
{
|
||||
m_ObjectList = new Hashtable();
|
||||
m_Dispatcher = disp;
|
||||
|
||||
if (!m_AreWpfFormsCached)
|
||||
BetterPerformance();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Create_WpfForm via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to create</param>
|
||||
public bool Create_WpfFormDISP(WPForms wpfFormType)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
return Create_WpfForm(wpfFormType);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { wpfFormType };
|
||||
return (bool) m_Dispatcher.Invoke((delegate_Create)Create_WpfFormDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Show_WpfForm via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to create</param>
|
||||
public bool Show_WpfFormDISP(WPForms wpfFormType)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
return Show_WpfForm(wpfFormType);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { wpfFormType };
|
||||
return (bool) m_Dispatcher.Invoke((delegate_Create)Show_WpfFormDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Delete_WpfForm via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to delete</param>
|
||||
public bool Delete_WpfFormDISP(WPForms wpfFormType)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
return Delete_WpfForm(wpfFormType);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { wpfFormType };
|
||||
return (bool)m_Dispatcher.Invoke((delegate_Delete)Delete_WpfFormDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this Dispatching Action Function to run any _Action on the WpfForm
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to run action on</param>
|
||||
public bool RunAction_WpfFormDISP(WPForms wpfFormType, _Action action)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
return RunAction_WpfForm(wpfFormType, action);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { wpfFormType, action };
|
||||
return (bool) m_Dispatcher.Invoke((delegate_Action)RunAction_WpfFormDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Terminate via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
public void TerminateDISP()
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
Terminate();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Dispatcher.Invoke((Action)TerminateDISP, System.Windows.Threading.DispatcherPriority.Normal, null);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new WpfForm object into the ObjectList
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to run action on</param>
|
||||
private bool Create_WpfForm(WPForms wpfFormType)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!m_AreWpfFormsCached)
|
||||
BetterPerformance();
|
||||
|
||||
// we only allow one object * so delete the previous one if exists *
|
||||
if (m_ObjectList[wpfFormType] != null)
|
||||
Delete_WpfForm(wpfFormType);
|
||||
|
||||
m_ObjectList[wpfFormType] = GUIWPFormsObjectFactory.CreateWPFormWindow(wpfFormType, false);
|
||||
Window wpfForm = (Window) m_ObjectList[wpfFormType];
|
||||
|
||||
if (wpfForm == null)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Some Type of Error Occured. wpfForm is null", MethodBase.GetCurrentMethod().Name));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show a WpfForm object in the ObjectList
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to run action on</param>
|
||||
private bool Show_WpfForm(WPForms wpfFormType)
|
||||
{
|
||||
try
|
||||
{
|
||||
Window wpfForm = (Window)m_ObjectList[wpfFormType];
|
||||
|
||||
if (wpfForm == null)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Some Type of Error Occured. wpfForm is null", MethodBase.GetCurrentMethod().Name));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We use the InteropHelper to see if this WPFForm has been created previously
|
||||
WindowInteropHelper InteropHelper = new WindowInteropHelper(wpfForm);
|
||||
if (InteropHelper.Handle == IntPtr.Zero)
|
||||
{
|
||||
wpfForm.Show();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this function to delete the WpfForm Object
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to run action on</param>
|
||||
private bool Delete_WpfForm(WPForms wpfFormType)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_ObjectList.ContainsKey(wpfFormType))
|
||||
{
|
||||
Window wpfForm = (Window)m_ObjectList[wpfFormType];
|
||||
if (wpfForm != null)
|
||||
{
|
||||
m_ObjectList.Remove(wpfFormType);
|
||||
wpfForm.Close();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this to run void() function actions on the specified wpfForm
|
||||
/// </summary>
|
||||
/// <param name="wpfFormType">Object type to run action on</param>
|
||||
/// <param name="action">a pointer to a delegate (action function) to run</param>
|
||||
private bool RunAction_WpfForm(WPForms wpfFormType, _Action action)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_ObjectList.ContainsKey(wpfFormType))
|
||||
{
|
||||
Window wpfForm = (Window)m_ObjectList[wpfFormType];
|
||||
if (wpfForm != null && action != null)
|
||||
{
|
||||
action(wpfForm);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Kills all ButtonForm Instances (STOPS ALL)
|
||||
/// </summary>
|
||||
private void Terminate()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (object o in m_ObjectList)
|
||||
{
|
||||
if ((o != null) && (o is Window))
|
||||
{
|
||||
Window WpfForm = (Window)o;
|
||||
WpfForm.Close();
|
||||
}
|
||||
}
|
||||
m_ObjectList.Clear();
|
||||
|
||||
if (m_AreWpfFormsCached)
|
||||
{
|
||||
foreach (Window window in m_wpfCachedForms)
|
||||
{
|
||||
if (window != null)
|
||||
window.Close();
|
||||
}
|
||||
|
||||
// Caching is incomplete
|
||||
m_AreWpfFormsCached = false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// In order to improve WPForm performance we have one set of forms
|
||||
/// loaded at all times. (opacity set to 0).
|
||||
/// ~it has no parent setting so it is just a form of the desktop
|
||||
/// </summary>
|
||||
private void BetterPerformance()
|
||||
{
|
||||
if (!m_AreWpfFormsCached && (m_wpfCachedForms == null))
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (this)
|
||||
{
|
||||
int nForms = Enum.GetValues(typeof(WPForms)).Length;
|
||||
if (nForms > 0)
|
||||
{
|
||||
// Allocate the cached forms array
|
||||
m_wpfCachedForms = new Window[nForms];
|
||||
|
||||
// Iterate thru enums and create the corresponding objects in the Cache
|
||||
for (int i = 0; i < nForms; ++i)
|
||||
{
|
||||
WPForms form = (WPForms)Enum.ToObject(typeof(WPForms), i);
|
||||
m_wpfCachedForms[i] = GUIWPFormsObjectFactory.CreateWPFormWindow(form, true);
|
||||
}
|
||||
|
||||
// Caching is complete
|
||||
m_AreWpfFormsCached = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
55
Client Services/GUIWPForms/GUIState.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
// Foo Namespaces
|
||||
using Foo.DataAccessLayer;
|
||||
using Foo.DataAccessLayer.DataTypes;
|
||||
using System.Windows;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Used to save GUI State Information for all of GUIWPForms,
|
||||
/// such as last selected SortOrder etc. ~very useful for having multiple forms
|
||||
/// communicate with each other * C# Singleton #
|
||||
/// </summary>
|
||||
public static class GUIState
|
||||
{
|
||||
// WorkspaceSelector_StandardPage comboBox Workspace SortOrder
|
||||
public static SortOrderForWorkspaces LastSelectedSotOrderWorkspaces { get; set; }
|
||||
public static int LastSelectedSotOrderWorkspacesIndex { get; set; }
|
||||
|
||||
// WorkspaceSelector_StandardPage dataGrid Selected WorkspaceName
|
||||
public static string LastSelectedWorkspaceName { get; set; }
|
||||
|
||||
// ArtifactWall
|
||||
public static SortOrderForArtifacts LastSelectedSotOrderArtifacts { get; set; }
|
||||
public static int LastSelectedSotOrderArtifactsIndex { get; set; }
|
||||
|
||||
// Keeping track of launched WPF GUI's
|
||||
public static Window CurrentlyShowingWPFWindow { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Defaults
|
||||
/// </summary>
|
||||
static GUIState()
|
||||
{
|
||||
// Defaults for comboBox Workspace SortOrder
|
||||
LastSelectedSotOrderWorkspaces = SortOrderForWorkspaces.Ascending;
|
||||
LastSelectedSotOrderWorkspacesIndex = 0;
|
||||
|
||||
// Defaults for Selected WorkspaceName
|
||||
LastSelectedWorkspaceName = String.Empty;
|
||||
|
||||
// Artifact Wall
|
||||
LastSelectedSotOrderArtifacts = SortOrderForArtifacts.Ascending;
|
||||
LastSelectedSotOrderArtifactsIndex = 0;
|
||||
|
||||
// Keeping track of launched WPF GUI's
|
||||
CurrentlyShowingWPFWindow = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 48 KiB |
BIN
Client Services/GUIWPForms/GUIWPFPages/PageImages/Close.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
Client Services/GUIWPForms/GUIWPFPages/PageImages/CloseAll.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 50 KiB |
|
After Width: | Height: | Size: 49 KiB |
BIN
Client Services/GUIWPForms/GUIWPFPages/PageImages/Hide.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
Client Services/GUIWPForms/GUIWPFPages/PageImages/House.png
Normal file
|
After Width: | Height: | Size: 943 B |
BIN
Client Services/GUIWPForms/GUIWPFPages/PageImages/Launch.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
@@ -0,0 +1,20 @@
|
||||
<Page x:Class="Foo.ClientServices.GUIWPForms.WorkspaceSelector_DeleteWorkspacePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="WorkspaceSelector_DeleteWorkspacePage" Height="312" Width="250" Loaded="Page_Loaded">
|
||||
<Grid>
|
||||
<Rectangle x:Name="recGradiant" Stroke="Black" RadiusY="1" RadiusX="1" Grid.ColumnSpan="2">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="1.0">
|
||||
<GradientStop Color="#FF000000" Offset="0.238"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.778"/>
|
||||
<GradientStop Color="#FE202020" Offset="0.613"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.87"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Button Height="23" Margin="32,0,0,51" Name="btnNo" VerticalAlignment="Bottom" IsCancel="True" HorizontalAlignment="Left" Width="75" Click="btnNo_Click">_No</Button>
|
||||
<Button HorizontalAlignment="Right" Margin="0,0,26,52" Name="btnYes" Width="75" Height="22" IsDefault="True" VerticalAlignment="Bottom" Click="btnYes_Click">_Yes</Button>
|
||||
<TextBlock Margin="32,38,26,91" Name="txtAreYouSure" Foreground="White" TextWrapping="Wrap" TextAlignment="Left" />
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,158 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using Foo.DataAccessLayer;
|
||||
using Foo.DataAccessLayer.DataTypes;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for WorkspaceSelector_DeleteWorkspacePage.xaml
|
||||
/// </summary>
|
||||
public partial class WorkspaceSelector_DeleteWorkspacePage : Page
|
||||
{
|
||||
// passed to us by parent
|
||||
private WorkspaceSelector m_WorkspaceSelectorObj = null;
|
||||
private bool m_bPerformanceCache = false;
|
||||
|
||||
// private state variables
|
||||
private string m_strWorkspaceName;
|
||||
|
||||
public WorkspaceSelector_DeleteWorkspacePage(bool bPerformanceCache)
|
||||
{
|
||||
m_strWorkspaceName = String.Empty;
|
||||
m_bPerformanceCache = bPerformanceCache;
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when page gets loaded
|
||||
/// </summary>
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
// Make sure that the Selector Frame is big enough to hold this page
|
||||
m_WorkspaceSelectorObj = (WorkspaceSelector)this.Tag;
|
||||
|
||||
// Make sure that we have a workspace Name to work with otherwise Navigate Back
|
||||
if (String.IsNullOrEmpty(GUIState.LastSelectedWorkspaceName))
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
else
|
||||
m_strWorkspaceName = GUIState.LastSelectedWorkspaceName;
|
||||
|
||||
// Set Height and Width
|
||||
m_WorkspaceSelectorObj.Height = this.Height + m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
m_WorkspaceSelectorObj.Width = this.Width;
|
||||
|
||||
// Set the Warning Label for this Particular Workspace
|
||||
ConstructAreYouSureMessage();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a thorough Warning Message to be displayed to the user in the label
|
||||
/// Iterates and warns the user of exactly the number of changes that will occur in the system
|
||||
/// </summary>
|
||||
private void ConstructAreYouSureMessage()
|
||||
{
|
||||
int nArtifactsCount = Data.Artifacts.GetArtifactLinkCountForWorkspace(m_strWorkspaceName);
|
||||
int nUniqueArtifactsCount = Data.Artifacts.GetUniqureArtifactsCountForWorkspace(m_strWorkspaceName);
|
||||
if (nArtifactsCount >= 0 && nUniqueArtifactsCount >= 0)
|
||||
{
|
||||
StringBuilder sr = new StringBuilder();
|
||||
sr.Append(String.Format("Are you Sure you want to Delete Workspace '{0}'? \n\n", m_strWorkspaceName));
|
||||
sr.Append(String.Format("This Workspace contains {0} Artifact Links ", (nArtifactsCount - nUniqueArtifactsCount)));
|
||||
sr.Append(String.Format("and {0} Artifacts. ", nUniqueArtifactsCount));
|
||||
sr.Append(String.Format("\n\n In Total: {0} Items will be deleted. There is no way to undo this operation.", nArtifactsCount));
|
||||
txtAreYouSure.Text = sr.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
// an error occured
|
||||
Foo.Platform.ErrorReporting.UserError.Show("An Error Occurred", "Navigating you back to the WorkspaceSelector");
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Button Yes Event Handler - Go ahead and delete the workspace
|
||||
/// </summary>
|
||||
private void btnYes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (Data.Workspace.DeleteWorkspace(GUIState.LastSelectedWorkspaceName))
|
||||
{
|
||||
|
||||
// Show Confirm Delete Message and Go Back
|
||||
StringBuilder sr = new StringBuilder();
|
||||
sr.Append(String.Format("The Workspace '{0}' was deleted successfully. \n\n", m_strWorkspaceName));
|
||||
sr.Append("You will no longer be able to access this Workspace and any Artifacts that were exclusive to it.");
|
||||
ShowMessageAndNavigateBack(sr.ToString());
|
||||
|
||||
// Set GUI State
|
||||
GUIState.LastSelectedWorkspaceName = String.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
// an error occured
|
||||
Foo.Platform.ErrorReporting.UserError.Show("An Error Occurred", String.Format("An Error occured while deleting the Workspace {0}. Navigating you back to the WorkspaceSelector", m_strWorkspaceName));
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the passed in message in the text box and then navigates back to the main page
|
||||
/// </summary>
|
||||
/// <param name="strMessage"></param>
|
||||
private void ShowMessageAndNavigateBack(string strMessage)
|
||||
{
|
||||
// Hide the buttons
|
||||
btnYes.Visibility = Visibility.Hidden;
|
||||
btnNo.Visibility = Visibility.Hidden;
|
||||
|
||||
// Show Message
|
||||
txtAreYouSure.Text = strMessage;
|
||||
|
||||
// Pause for 2 second and Navigate Back
|
||||
DispatcherTimer dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1, 500);
|
||||
dispatcherTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Timer set specifically to allow the message to be seen for a little bit before navigating back
|
||||
/// </summary>
|
||||
void dispatcherTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
DispatcherTimer dispatcherTimer = (DispatcherTimer) sender;
|
||||
dispatcherTimer.Stop();
|
||||
|
||||
// Navigate Back
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Button No Event Handler - Go back to parent
|
||||
/// </summary>
|
||||
private void btnNo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<Page x:Class="Foo.ClientServices.GUIWPForms.WorkspaceSelector_NewWorkspacePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="WorkspaceSelector_NewWorkspacePage" Height="312" Width="250" Loaded="Page_Loaded">
|
||||
<Grid>
|
||||
<Rectangle x:Name="recGradiant" Stroke="Black" RadiusY="1" RadiusX="1" Grid.ColumnSpan="2">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="1.0">
|
||||
<GradientStop Color="#FF000000" Offset="0.238"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.778"/>
|
||||
<GradientStop Color="#FE202020" Offset="0.613"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.87"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Button IsCancel="True" Height="23" Margin="32,0,0,51" Name="btnNo" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="75" Click="btnNo_Click">_Cancel</Button>
|
||||
<Button IsDefault="True" HorizontalAlignment="Right" Margin="0,0,26,52" Name="btnYes" Width="75" Height="22" VerticalAlignment="Bottom" Click="btnYes_Click">C_reate</Button>
|
||||
<Label Margin="32,20,26,0" Name="lblCreateWorkspaceTitle" Foreground="White" VerticalContentAlignment="Top" Height="68" VerticalAlignment="Top" HorizontalContentAlignment="Center">
|
||||
<TextBlock Margin="0,0,0,0" Name="txtCreateWorkspaceTitle" TextWrapping="Wrap" Text="" TextAlignment="Center" />
|
||||
</Label>
|
||||
<Label Height="31" Margin="37,86,26,0" Name="lblEnterNewName" VerticalAlignment="Top" Foreground="White" HorizontalContentAlignment="Center">Enter New Name:</Label>
|
||||
<TextBox Margin="37,115,26,0" Name="txtNewName" Height="23" VerticalAlignment="Top" TextChanged="txtNewName_TextChanged" />
|
||||
<Label Margin="38,136,26,148" Name="lblWarningMessage" HorizontalContentAlignment="Right" Foreground="OrangeRed" FontSize="11" FontStyle="Italic">Label</Label>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,201 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for WorkspaceSelector_NewWorkspacePage.xaml
|
||||
/// </summary>
|
||||
public partial class WorkspaceSelector_NewWorkspacePage : Page
|
||||
{
|
||||
// passed to us by parent
|
||||
private WorkspaceSelector m_WorkspaceSelectorObj = null;
|
||||
private bool m_bPerformanceCache = false;
|
||||
|
||||
// private state variables
|
||||
private bool m_bIsValidName;
|
||||
|
||||
public WorkspaceSelector_NewWorkspacePage(bool bPerformanceCache)
|
||||
{
|
||||
m_bPerformanceCache = bPerformanceCache;
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
// Make sure that the Selector Frame is big enough to hold this page
|
||||
m_WorkspaceSelectorObj = (WorkspaceSelector)this.Tag;
|
||||
m_WorkspaceSelectorObj.Height = this.Height + m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
m_WorkspaceSelectorObj.Width = this.Width;
|
||||
|
||||
// Set the Warning Label for this Particular Workspace
|
||||
ConstructAreYouSureMessage();
|
||||
|
||||
// Set intial Error Message
|
||||
SetWarningMessage("Enter Characters");
|
||||
m_bIsValidName = false;
|
||||
|
||||
// Set intial focus
|
||||
txtNewName.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a renaming Message to be displayed to the user
|
||||
/// </summary>
|
||||
private void ConstructAreYouSureMessage()
|
||||
{
|
||||
StringBuilder sr = new StringBuilder();
|
||||
sr.Append("Create New Workspace \n");
|
||||
txtCreateWorkspaceTitle.Text = sr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the validator label to a warning message
|
||||
/// </summary>
|
||||
/// <param name="strMessage"></param>
|
||||
private void SetWarningMessage(string strMessage)
|
||||
{
|
||||
lblWarningMessage.Foreground = new SolidColorBrush(Colors.OrangeRed);
|
||||
lblWarningMessage.Content = strMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the validator label to a success message
|
||||
/// </summary>
|
||||
/// <param name="strMessage"></param>
|
||||
private void SetSuccessMessage(string strMessage)
|
||||
{
|
||||
lblWarningMessage.Foreground = new SolidColorBrush(Colors.RoyalBlue);
|
||||
lblWarningMessage.Content = strMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Button Yes Event Handler - Go ahead and Create the new WorkspaceName
|
||||
/// </summary>
|
||||
private void btnYes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (m_bIsValidName)
|
||||
{
|
||||
if (!DataAccessLayer.Data.Workspace.InsertWorkspaceName(txtNewName.Text))
|
||||
{
|
||||
// an error occured
|
||||
Foo.Platform.ErrorReporting.UserError.Show("An Error Occurred", "Creating the Workspace Failed! Navigating you back to the WorkspaceSelector");
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set GUI State
|
||||
GUIState.LastSelectedWorkspaceName = txtNewName.Text;
|
||||
|
||||
// Show Success Message
|
||||
ShowMessageAndNavigateBack(String.Format("Workspace '{0}' has been successfully created", txtNewName.Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the passed in message in the text box and then navigates back to the main page
|
||||
/// </summary>
|
||||
/// <param name="strMessage"></param>
|
||||
private void ShowMessageAndNavigateBack(string strMessage)
|
||||
{
|
||||
// Hide the buttons
|
||||
btnYes.Visibility = Visibility.Hidden;
|
||||
btnNo.Visibility = Visibility.Hidden;
|
||||
|
||||
// Hide the textbox and Labels
|
||||
lblEnterNewName.Visibility = Visibility.Hidden;
|
||||
txtNewName.Visibility = Visibility.Hidden;
|
||||
lblWarningMessage.Visibility = Visibility.Hidden;
|
||||
|
||||
// Show Message
|
||||
txtCreateWorkspaceTitle.Text = strMessage;
|
||||
|
||||
// Dynamically calculate the height of the textbox * No need to do this in this case *
|
||||
// System.Drawing.Size sz = new System.Drawing.Size((int)this.Width, int.MaxValue);
|
||||
// Font font = new Font(txtRenameWorkspaceTitle.FontFamily.ToString(), (float)txtRenameWorkspaceTitle.FontSize);
|
||||
// sz = TextRenderer.MeasureText(txtRenameWorkspaceTitle.Text, font, sz, TextFormatFlags.WordBreak);
|
||||
// Change Height as needed
|
||||
// lblRenameWorkspaceTitle.Height = sz.Height;
|
||||
// txtRenameWorkspaceTitle.Height = sz.Height;
|
||||
|
||||
// default to change height to Max available space
|
||||
lblCreateWorkspaceTitle.Height = this.Height - m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
txtCreateWorkspaceTitle.Height = this.Height - m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
|
||||
// Pause for 1.5 second and Navigate Back
|
||||
DispatcherTimer dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1, 500);
|
||||
dispatcherTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Timer set specifically to allow the message to be seen for a little bit before navigating back
|
||||
/// </summary>
|
||||
void dispatcherTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
DispatcherTimer dispatcherTimer = (DispatcherTimer)sender;
|
||||
dispatcherTimer.Stop();
|
||||
|
||||
// Navigate Back
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Button No Event Handler - Go back to parent
|
||||
/// </summary>
|
||||
private void btnNo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform NewWorkspaceName TextBox Validation
|
||||
/// </summary>
|
||||
private void txtNewName_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
System.Windows.Controls.TextBox textBox = (System.Windows.Controls.TextBox)sender;
|
||||
if (String.IsNullOrEmpty(textBox.Text))
|
||||
{
|
||||
SetWarningMessage("Enter Characters");
|
||||
m_bIsValidName = false;
|
||||
}
|
||||
else if (!DataAccessLayer.DataTypes.DataTypeValidation.IsValidWorkspaceName(textBox.Text))
|
||||
{
|
||||
SetWarningMessage("Invalid Workspace Name");
|
||||
m_bIsValidName = false;
|
||||
}
|
||||
else if (DataAccessLayer.Data.Workspace.DoesWorkspaceNameExist(textBox.Text))
|
||||
{
|
||||
SetWarningMessage("Workspace Name Already Exists");
|
||||
m_bIsValidName = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSuccessMessage("Valid Workspace Name");
|
||||
m_bIsValidName = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<Page x:Class="Foo.ClientServices.GUIWPForms.WorkspaceSelector_RenameWorkspacePage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="WorkspaceSelector_RenameWorkspacePage" Height="312" Width="250" Loaded="Page_Loaded">
|
||||
<Grid>
|
||||
<Rectangle x:Name="recGradiant" Stroke="Black" RadiusY="1" RadiusX="1" Grid.ColumnSpan="2">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="1.0">
|
||||
<GradientStop Color="#FF000000" Offset="0.238"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.778"/>
|
||||
<GradientStop Color="#FE202020" Offset="0.613"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.87"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Button Height="23" Margin="32,0,0,51" Name="btnNo" VerticalAlignment="Bottom" IsCancel="True" HorizontalAlignment="Left" Width="75" Click="btnNo_Click">_Cancel</Button>
|
||||
<Button HorizontalAlignment="Right" Margin="0,0,26,52" Name="btnYes" IsDefault="True" Width="75" Height="22" VerticalAlignment="Bottom" Click="btnYes_Click">_Rename</Button>
|
||||
<Label Margin="32,20,26,0" Name="lblRenameWorkspaceTitle" Foreground="White" VerticalContentAlignment="Top" Height="68" VerticalAlignment="Top" HorizontalContentAlignment="Center">
|
||||
<TextBlock Margin="0,0,0,0" Name="txtRenameWorkspaceTitle" TextWrapping="Wrap" Text="" TextAlignment="Center" />
|
||||
</Label>
|
||||
<Label Height="31" Margin="37,86,26,0" Name="lblEnterNewName" VerticalAlignment="Top" Foreground="White" HorizontalContentAlignment="Center">Enter New Name:</Label>
|
||||
<TextBox Margin="37,115,26,0" Name="txtNewName" Height="23" VerticalAlignment="Top" TextChanged="txtNewName_TextChanged" />
|
||||
<Label Margin="38,136,26,148" Name="lblWarningMessage" HorizontalContentAlignment="Right" Foreground="OrangeRed" FontSize="11" FontStyle="Italic">Label</Label>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,210 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Threading;
|
||||
using System.Windows.Forms;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for WorkspaceSelector_RenameWorkspacePage.xaml
|
||||
/// </summary>
|
||||
public partial class WorkspaceSelector_RenameWorkspacePage : Page
|
||||
{
|
||||
// passed to us by parent
|
||||
private WorkspaceSelector m_WorkspaceSelectorObj = null;
|
||||
private bool m_bPerformanceCache = false;
|
||||
|
||||
// private state variables
|
||||
private string m_strWorkspaceName;
|
||||
private bool m_bIsValidName;
|
||||
|
||||
public WorkspaceSelector_RenameWorkspacePage(bool bPerformanceCache)
|
||||
{
|
||||
m_bPerformanceCache = bPerformanceCache;
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
// Make sure that the Selector Frame is big enough to hold this page
|
||||
m_WorkspaceSelectorObj = (WorkspaceSelector)this.Tag;
|
||||
|
||||
// Make sure that we have a workspace Name to work with otherwise Navigate Back
|
||||
if (String.IsNullOrEmpty(GUIState.LastSelectedWorkspaceName))
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
else
|
||||
m_strWorkspaceName = GUIState.LastSelectedWorkspaceName;
|
||||
|
||||
// Set Height and Width
|
||||
m_WorkspaceSelectorObj.Height = this.Height + m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
m_WorkspaceSelectorObj.Width = this.Width;
|
||||
|
||||
// Set the Warning Label for this Particular Workspace
|
||||
ConstructAreYouSureMessage();
|
||||
|
||||
// Set intial Error Message
|
||||
SetWarningMessage("Enter Characters");
|
||||
m_bIsValidName = false;
|
||||
|
||||
// Set intial focus
|
||||
txtNewName.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a renaming Message to be displayed to the user
|
||||
/// </summary>
|
||||
private void ConstructAreYouSureMessage()
|
||||
{
|
||||
StringBuilder sr = new StringBuilder();
|
||||
sr.Append(String.Format("Rename Workspace '{0}'\n", m_strWorkspaceName));
|
||||
txtRenameWorkspaceTitle.Text = sr.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the validator label to a warning message
|
||||
/// </summary>
|
||||
/// <param name="strMessage"></param>
|
||||
private void SetWarningMessage(string strMessage)
|
||||
{
|
||||
lblWarningMessage.Foreground = new SolidColorBrush(Colors.OrangeRed);
|
||||
lblWarningMessage.Content = strMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the validator label to a success message
|
||||
/// </summary>
|
||||
/// <param name="strMessage"></param>
|
||||
private void SetSuccessMessage(string strMessage)
|
||||
{
|
||||
lblWarningMessage.Foreground = new SolidColorBrush(Colors.RoyalBlue);
|
||||
lblWarningMessage.Content = strMessage;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Button Yes Event Handler - Go ahead and Rename the WorkspaceName
|
||||
/// </summary>
|
||||
private void btnYes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (m_bIsValidName)
|
||||
{
|
||||
if (!DataAccessLayer.Data.Workspace.RenameWorkspace(m_strWorkspaceName, txtNewName.Text))
|
||||
{
|
||||
// an error occured
|
||||
Foo.Platform.ErrorReporting.UserError.Show("An Error Occurred", "Renaming the Workspace Failed! Navigating you back to the WorkspaceSelector");
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set GUI State
|
||||
GUIState.LastSelectedWorkspaceName = txtNewName.Text;
|
||||
|
||||
// Show Success Message
|
||||
ShowMessageAndNavigateBack(String.Format("'{0}' has been successfully renamed to '{1}'", m_strWorkspaceName, txtNewName.Text));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shows the passed in message in the text box and then navigates back to the main page
|
||||
/// </summary>
|
||||
/// <param name="strMessage"></param>
|
||||
private void ShowMessageAndNavigateBack(string strMessage)
|
||||
{
|
||||
// Hide the buttons
|
||||
btnYes.Visibility = Visibility.Hidden;
|
||||
btnNo.Visibility = Visibility.Hidden;
|
||||
|
||||
// Hide the textbox and Labels
|
||||
lblEnterNewName.Visibility = Visibility.Hidden;
|
||||
txtNewName.Visibility = Visibility.Hidden;
|
||||
lblWarningMessage.Visibility = Visibility.Hidden;
|
||||
|
||||
// Show Message
|
||||
txtRenameWorkspaceTitle.Text = strMessage;
|
||||
|
||||
// Dynamically calculate the height of the textbox * No need to do this in this case *
|
||||
// System.Drawing.Size sz = new System.Drawing.Size((int)this.Width, int.MaxValue);
|
||||
// Font font = new Font(txtRenameWorkspaceTitle.FontFamily.ToString(),(float) txtRenameWorkspaceTitle.FontSize);
|
||||
// sz = TextRenderer.MeasureText(txtRenameWorkspaceTitle.Text, font, sz, TextFormatFlags.WordBreak);
|
||||
// Change Height as needed
|
||||
// lblRenameWorkspaceTitle.Height = sz.Height;
|
||||
// txtRenameWorkspaceTitle.Height = sz.Height;
|
||||
|
||||
// default to change height to Max available space
|
||||
lblRenameWorkspaceTitle.Height = this.Height - m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
txtRenameWorkspaceTitle.Height = this.Height - m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
|
||||
// Pause for 1.5 second and Navigate Back
|
||||
DispatcherTimer dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1, 500);
|
||||
dispatcherTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Timer set specifically to allow the message to be seen for a little bit before navigating back
|
||||
/// </summary>
|
||||
void dispatcherTimer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
DispatcherTimer dispatcherTimer = (DispatcherTimer)sender;
|
||||
dispatcherTimer.Stop();
|
||||
|
||||
// Navigate Back
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Button No Event Handler - Go back to parent
|
||||
/// </summary>
|
||||
private void btnNo_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform NewWorkspaceName TextBox Validation
|
||||
/// </summary>
|
||||
private void txtNewName_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
System.Windows.Controls.TextBox textBox = (System.Windows.Controls.TextBox)sender;
|
||||
if (String.IsNullOrEmpty(textBox.Text))
|
||||
{
|
||||
SetWarningMessage("Enter Characters");
|
||||
m_bIsValidName = false;
|
||||
}
|
||||
else if (!DataAccessLayer.DataTypes.DataTypeValidation.IsValidWorkspaceName(textBox.Text))
|
||||
{
|
||||
SetWarningMessage("Invalid Workspace Name");
|
||||
m_bIsValidName = false;
|
||||
}
|
||||
else if (DataAccessLayer.Data.Workspace.DoesWorkspaceNameExist(textBox.Text))
|
||||
{
|
||||
SetWarningMessage("Workspace Name Already Exists");
|
||||
m_bIsValidName = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSuccessMessage("Valid Workspace Name");
|
||||
m_bIsValidName = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
<Page x:Class="Foo.ClientServices.GUIWPForms.WorkspaceSelector_StandardPage"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:Custom="http://schemas.microsoft.com/wpf/2008/toolkit"
|
||||
Title="WorkspaceSelector_StandardPage" Height="312" Loaded="Page_Loaded" Width="250" Foreground="Black">
|
||||
<Page.Resources>
|
||||
<Style x:Key="DataGridCellStyle" TargetType="{x:Type Custom:DataGridCell}">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Custom:DataGridCell}">
|
||||
<Border Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="0"
|
||||
SnapsToDevicePixels="True">
|
||||
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Custom Brushes -->
|
||||
<LinearGradientBrush x:Key="RowBackgroundSelectedBrush" StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="#4F8CC7" Offset="0" />
|
||||
<GradientStop Color="#1C4B7C" Offset="0.7" />
|
||||
<GradientStop Color="#042D5B" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
<SolidColorBrush x:Key="RowBackgroundAlternationIndex2Brush" Color="#44FF0000" />
|
||||
<SolidColorBrush x:Key="RowBackgroundAlternationIndex3Brush" Color="#44CCCCCC" />
|
||||
|
||||
<Style x:Key="DataGridDemoRowStyle" TargetType="{x:Type Custom:DataGridRow}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="AlternationIndex" Value="2" >
|
||||
<Setter Property="Background" Value="{StaticResource RowBackgroundAlternationIndex2Brush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="AlternationIndex" Value="3">
|
||||
<Setter Property="Background" Value="{StaticResource RowBackgroundAlternationIndex3Brush}" />
|
||||
</Trigger>
|
||||
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="Background" Value="{StaticResource RowBackgroundSelectedBrush}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Page.Resources>
|
||||
<Grid>
|
||||
<Rectangle x:Name="recGradiant" Stroke="Black" RadiusY="1" RadiusX="1" Grid.ColumnSpan="2">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="1.0">
|
||||
<GradientStop Color="#FF000000" Offset="0.238"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.778"/>
|
||||
<GradientStop Color="#FE202020" Offset="0.613"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.87"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<my:DataGrid ItemsSource="{Binding ElementName=This, Path=WorkspacesDT.DefaultView}"
|
||||
AutoGenerateColumns="False" Margin="12,54,12,33" Name="dataGridWorkspaces"
|
||||
HorizontalScrollBarVisibility="Disabled" HeadersVisibility="None"
|
||||
VerticalScrollBarVisibility="Auto" TabIndex="1"
|
||||
GridLinesVisibility="Horizontal"
|
||||
CellStyle="{StaticResource DataGridCellStyle}"
|
||||
RowStyle="{StaticResource DataGridDemoRowStyle}"
|
||||
RowHeaderWidth="3" ColumnHeaderHeight="15"
|
||||
SelectionMode="Single" SelectionUnit="FullRow"
|
||||
CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
|
||||
CanUserResizeColumns="False" CanUserResizeRows="False" CanUserSortColumns="False"
|
||||
MouseRightButtonDown="dataGridWorkspaces_MouseRightButtonDown"
|
||||
MouseDoubleClick="dataGridWorkspaces_MouseDoubleClick"
|
||||
SelectedCellsChanged="dataGridWorkspaces_SelectedCellsChanged"
|
||||
xmlns:my="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit" Background="White" BorderBrush="Transparent" BorderThickness="0" IsTabStop="False">
|
||||
|
||||
<my:DataGrid.Columns>
|
||||
<!--<my:DataGridTextColumn Binding="{Binding WorkspaceName}" />-->
|
||||
|
||||
<my:DataGridTemplateColumn KeyboardNavigation.TabIndex="1" Header="WorkspaceName" Width="188" IsReadOnly="True">
|
||||
<my:DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock TextWrapping="NoWrap" Text="{Binding WorkspaceName}">
|
||||
<TextBlock.ToolTip>
|
||||
<TextBlock TextWrapping="Wrap" Width="188" Text="{Binding WorkspaceName}"/>
|
||||
</TextBlock.ToolTip>
|
||||
</TextBlock>
|
||||
</DataTemplate>
|
||||
</my:DataGridTemplateColumn.CellTemplate>
|
||||
</my:DataGridTemplateColumn>
|
||||
|
||||
<my:DataGridTemplateColumn KeyboardNavigation.TabIndex="1" Header="Date" Width="20" IsReadOnly="True">
|
||||
<my:DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<!--<TextBlock Text="{Binding Date, StringFormat=d}" />-->
|
||||
<!--<Button Visibility="{Binding ButtonIsVisible}" Background="Transparent" Height="16" Width="16" Margin="0,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Click="ButtonGrid_Click">
|
||||
<Button.Content>-->
|
||||
<!--<Image Source="PageImages/Launch.png"></Image>-->
|
||||
<Image Source="{Binding ButtonResUri}" Height="16" Width="16">
|
||||
<Image.ToolTip>
|
||||
<TextBlock TextWrapping="Wrap" Width="100" Text="{Binding ButtonToolTipText}"/>
|
||||
</Image.ToolTip>
|
||||
</Image>
|
||||
<!--<TextBlock Text="{Binding Word, StringFormat=d}" />-->
|
||||
<!--</Button.Content>
|
||||
</Button>-->
|
||||
</DataTemplate>
|
||||
</my:DataGridTemplateColumn.CellTemplate>
|
||||
</my:DataGridTemplateColumn>
|
||||
</my:DataGrid.Columns>
|
||||
|
||||
<!--<my:DataGrid.ContextMenu>
|
||||
<ContextMenu >
|
||||
<MenuItem x:Name="menuItemLaunch" Header="Launch">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="Images/cut.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</my:DataGrid.ContextMenu>-->
|
||||
|
||||
</my:DataGrid>
|
||||
<Label Height="28" Margin="16,-2,12,0" Name="lblCurrentWorkspace" VerticalAlignment="Top"
|
||||
Foreground="White" HorizontalContentAlignment="Center">Workspaces</Label>
|
||||
<ComboBox Height="23" Margin="33,23,32,0" Name="comboBoxSortBy" VerticalAlignment="Top" TabIndex="0" SelectionChanged="comboBoxSortBy_SelectionChanged" />
|
||||
<Button Background="Transparent" BorderThickness="0" BorderBrush="Transparent" Height="24" Width="24" HorizontalAlignment="Left" Margin="12,0,0,5" Name="btnNew" VerticalAlignment="Bottom" Click="btnNew_Click" TabIndex="2">
|
||||
<Button.Content>
|
||||
<Image Source="PageImages/AddWorkspace.png"></Image>
|
||||
</Button.Content>
|
||||
<!--<Button.ToolTip>
|
||||
<ToolTip>
|
||||
<TextBlock TextWrapping="Wrap" Width="150">Doris Loves to play with her piano. Piano is alot of fun and she likes to play with it</TextBlock>
|
||||
</ToolTip>
|
||||
</Button.ToolTip>-->
|
||||
</Button>
|
||||
<Button Background="Transparent" BorderThickness="0" BorderBrush="Transparent" Height="24" Width="24" Margin="42,0,0,5" Name="btnEdit" VerticalAlignment="Bottom" HorizontalAlignment="Left" Click="btnEdit_Click" TabIndex="3">
|
||||
<Button.Content>
|
||||
<Image Source="PageImages/EditWorkspace.png"></Image>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Background="Transparent" BorderThickness="0" BorderBrush="Transparent" Height="24" Width="24" Margin="72,0,0,5" Name="btnDelete" VerticalAlignment="Bottom" HorizontalAlignment="Left" Click="btnDelete_Click" TabIndex="4">
|
||||
<Button.Content>
|
||||
<Image Source="PageImages/DeleteWorkspace.png"></Image>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button Background="Transparent" BorderThickness="0" BorderBrush="Transparent" Height="24" Width="24" HorizontalAlignment="Right" Margin="0,0,12,5" Name="btnCloseAll" VerticalAlignment="Bottom" Click="btnCloseAll_Click" TabIndex="5">
|
||||
<Button.Content>
|
||||
<Image Source="PageImages/CloseAll.png"></Image>
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,418 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Collections.ObjectModel;
|
||||
using Microsoft.Windows.Controls;
|
||||
using System.Data;
|
||||
using System.ComponentModel;
|
||||
|
||||
// Foo Namespace
|
||||
using Foo.WorkspaceMgr;
|
||||
using Foo.DataAccessLayer;
|
||||
using Foo.DataAccessLayer.DataTypes;
|
||||
using Foo.GUILib;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for WorkspaceSelector_StandardPage.xaml
|
||||
/// </summary>
|
||||
public partial class WorkspaceSelector_StandardPage : Page
|
||||
{
|
||||
// passed to us by parent
|
||||
private WorkspaceSelector m_WorkspaceSelectorObj = null;
|
||||
private bool m_bPerformanceCache = false;
|
||||
|
||||
// WorkspaceMgr - Imp
|
||||
private WorkspaceMgr.WorkspaceMgr m_WorkspaceMgr = null;
|
||||
|
||||
// private DT holds all information needed for the DataGrid
|
||||
public DataTable WorkspacesDT { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="bPerformanceCache"></param>
|
||||
public WorkspaceSelector_StandardPage(bool bPerformanceCache)
|
||||
{
|
||||
// We preload & require the WorkspaceMgr in this class
|
||||
m_WorkspaceMgr = new WorkspaceMgr.WorkspaceMgr();
|
||||
|
||||
// Preload Database call - to make sure it is fast when the user sees it
|
||||
String[] workspaceNames = Data.Workspace.GetAllWorkspaceNames(SortOrderForWorkspaces.Ascending);
|
||||
|
||||
m_bPerformanceCache = bPerformanceCache;
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
}
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when we want to Update the DataGrid with new DataTable Items
|
||||
/// ~Responsible for reloading the WorkspacesDT
|
||||
/// </summary>
|
||||
private void UpdateWorkspaceGridItems(SortOrderForWorkspaces sortOrder)
|
||||
{
|
||||
// First Step - Clear the Grid
|
||||
WorkspacesDT.Rows.Clear();
|
||||
|
||||
// Second Step - Fill the Grid with the WorkspaceNames
|
||||
String[] workspaceNames = Data.Workspace.GetAllWorkspaceNames(sortOrder);
|
||||
|
||||
int i = 0;
|
||||
int selectedIndex = -1;
|
||||
foreach (string workspaceName in workspaceNames)
|
||||
{
|
||||
var row = WorkspacesDT.NewRow();
|
||||
WorkspacesDT.Rows.Add(row);
|
||||
row["WorkspaceName"] = workspaceName;
|
||||
row["ButtonResUri"] = "PageImages/Launch.png";//"PageImages/Launch.png";
|
||||
row["ButtonToolTipText"] = "Launch This Workspace";
|
||||
|
||||
// Let's Determine which index is supposed to be selected
|
||||
if (!String.IsNullOrEmpty(GUIState.LastSelectedWorkspaceName) &&
|
||||
(workspaceName == GUIState.LastSelectedWorkspaceName))
|
||||
selectedIndex = i;
|
||||
|
||||
i = i + 1; // incr.
|
||||
}
|
||||
|
||||
// Third Step - Refresh The DataGrid
|
||||
dataGridWorkspaces.ItemsSource = WorkspacesDT.DefaultView;
|
||||
// Other ways to refresh * appears to not be needed here * could be useful later
|
||||
//dataGridWorkspaces.ItemsSource = (WorkspacesDT as IListSource).GetList();
|
||||
//dataGridWorkspaces.Items.Refresh();
|
||||
|
||||
// Fourth Step - Reset the ColumnWidth of the WorkspaceName if no Scrollbar is visible
|
||||
if (workspaceNames.Length <= 13)
|
||||
{
|
||||
// scrollbar not visible
|
||||
DataGridLength gridbuffer = new DataGridLength(188 + 18);
|
||||
dataGridWorkspaces.Columns[0].Width = gridbuffer;
|
||||
}
|
||||
else
|
||||
{
|
||||
// scrollbar visible
|
||||
DataGridLength gridbuffer = new DataGridLength(188);
|
||||
dataGridWorkspaces.Columns[0].Width = gridbuffer;
|
||||
}
|
||||
|
||||
// Fifth Step - Set the Selected Index of the DataGrid to the last set
|
||||
// Workspace Or 0 if not found
|
||||
if (selectedIndex >= 0)
|
||||
dataGridWorkspaces.SelectedIndex = selectedIndex;
|
||||
else
|
||||
dataGridWorkspaces.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
#region Page Events
|
||||
|
||||
/// <summary>
|
||||
/// Called when the Page is loaded
|
||||
/// </summary>
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!m_bPerformanceCache)
|
||||
{
|
||||
// Make sure that the Selector Frame is big enough to hold this page
|
||||
m_WorkspaceSelectorObj = (WorkspaceSelector)this.Tag;
|
||||
m_WorkspaceSelectorObj.Height = this.Height + m_WorkspaceSelectorObj.MarginTopBottom;
|
||||
m_WorkspaceSelectorObj.Width = this.Width;
|
||||
|
||||
// InitializeWorkspaceDT
|
||||
WorkspacesDT = new DataTable("WorkspaceData");
|
||||
WorkspacesDT.Columns.Add(new DataColumn("WorkspaceName", typeof(string)));
|
||||
WorkspacesDT.Columns.Add(new DataColumn("ButtonResUri", typeof(string)));
|
||||
WorkspacesDT.Columns.Add(new DataColumn("ButtonToolTipText", typeof(string)));
|
||||
|
||||
// Set Workspaces Label
|
||||
lblCurrentWorkspace.Content = "Workspaces";
|
||||
|
||||
// Load ComboBox Sort Orders
|
||||
comboBoxSortBy.Items.Add(WPFHelper.CreateAComboBoxItem("Sort By Last Accessed", SortOrderForWorkspaces.LastAccessedDescending));
|
||||
comboBoxSortBy.Items.Add(WPFHelper.CreateAComboBoxItem("Sort By Most Frequently Used", SortOrderForWorkspaces.MostFrequentlyAccessedDescending));
|
||||
comboBoxSortBy.Items.Add(WPFHelper.CreateAComboBoxItem("Sort By Name", SortOrderForWorkspaces.Ascending));
|
||||
|
||||
// Load GUI State (or Default Index)
|
||||
comboBoxSortBy.SelectedIndex = GUIState.LastSelectedSotOrderWorkspacesIndex;
|
||||
|
||||
// Assign ToolTips for the Buttons
|
||||
btnNew.ToolTip = WPFHelper.CreateNewStringToolTip("New Workspace", 0, 120);
|
||||
btnEdit.ToolTip = WPFHelper.CreateNewStringToolTip("Rename Workspace", 0, 120);
|
||||
btnDelete.ToolTip = WPFHelper.CreateNewStringToolTip("Delete Workspace", 0, 120);
|
||||
btnCloseAll.ToolTip = WPFHelper.CreateNewStringToolTip("Close All Workspaces", 0, 120);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ComboBox Events
|
||||
|
||||
/// <summary>
|
||||
/// Combo Box - SortBy - Selection Change Event * Deal with repopulating the Workspace Datagrid
|
||||
/// </summary>
|
||||
private void comboBoxSortBy_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
ComboBox combobox = sender as ComboBox;
|
||||
if (combobox != null)
|
||||
{
|
||||
ComboBoxItem item = (ComboBoxItem)combobox.SelectedItem;
|
||||
string Content = item.Content.ToString();
|
||||
SortOrderForWorkspaces sortOrder = (SortOrderForWorkspaces)item.Tag;
|
||||
|
||||
// Save the State Information * Last SortOrder and Last SortOrder Index *
|
||||
GUIState.LastSelectedSotOrderWorkspaces = sortOrder;
|
||||
GUIState.LastSelectedSotOrderWorkspacesIndex = combobox.SelectedIndex;
|
||||
|
||||
// Update The Grid
|
||||
UpdateWorkspaceGridItems(sortOrder);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region DataGrid Events
|
||||
|
||||
/// <summary>
|
||||
/// Upon double-click we should be launching the Workspace (unload any previously loaded ones)
|
||||
/// </summary>
|
||||
private void dataGridWorkspaces_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
string strWorkspaceName = dataGrid_GetSelectedWorkspaceIfThereIsOne();
|
||||
if (!String.IsNullOrEmpty(strWorkspaceName))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Selection changed - Keep track of last selected workspace in GUIState
|
||||
/// </summary>
|
||||
private void dataGridWorkspaces_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
|
||||
{
|
||||
string strWorkspaceName = dataGrid_GetSelectedWorkspaceIfThereIsOne();
|
||||
if (!String.IsNullOrEmpty(strWorkspaceName))
|
||||
GUIState.LastSelectedWorkspaceName = strWorkspaceName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Whatever Workspace the User currently has selected in the Grid
|
||||
/// </summary>
|
||||
/// <returns>Selected Workpsace Or Empty String if there is none</returns>
|
||||
private string dataGrid_GetSelectedWorkspaceIfThereIsOne()
|
||||
{
|
||||
String strWorkspaceName = String.Empty;
|
||||
|
||||
// We only allow single selection
|
||||
IList<DataGridCellInfo> cells = dataGridWorkspaces.SelectedCells;
|
||||
if (cells.Count > 0)
|
||||
{
|
||||
DataGridCellInfo cell = cells[0];
|
||||
DataRowView row = (DataRowView)cell.Item;
|
||||
strWorkspaceName = row["WorkspaceName"].ToString();
|
||||
}
|
||||
return strWorkspaceName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the DataGrid Context Menu according to the Selected Workspace State
|
||||
/// </summary>
|
||||
/// <returns>valid Context Menu or Null</returns>
|
||||
private ContextMenu dataGrid_CreateDataGridContextMenu()
|
||||
{
|
||||
string strWorkspaceName = dataGrid_GetSelectedWorkspaceIfThereIsOne();
|
||||
if (!String.IsNullOrEmpty(strWorkspaceName))
|
||||
{
|
||||
// We also want to load the state of the workspace here
|
||||
ContextMenu menu = new ContextMenu();
|
||||
menu.PlacementTarget = this;
|
||||
|
||||
// Load all the MenuItems
|
||||
MenuItem m1 = new MenuItem();
|
||||
m1.Header = "Launch";
|
||||
m1.Click += new RoutedEventHandler(ContextMenu_Item_Click);
|
||||
m1.FontWeight = FontWeights.Bold;
|
||||
m1.Icon = WPFHelper.CreateWPFImageFromRelativeResourceUri("PageImages/Launch.png", 16, 16);
|
||||
menu.Items.Add(m1);
|
||||
|
||||
MenuItem m2 = new MenuItem();
|
||||
m2.Header = "Show";
|
||||
m2.Click += new RoutedEventHandler(ContextMenu_Item_Click);
|
||||
m2.Icon = WPFHelper.CreateWPFImageFromRelativeResourceUri("PageImages/Hide.png", 16, 16);
|
||||
menu.Items.Add(m2);
|
||||
|
||||
MenuItem m3 = new MenuItem();
|
||||
m3.Header = "Hide";
|
||||
m3.Click += new RoutedEventHandler(ContextMenu_Item_Click);
|
||||
m3.Icon = WPFHelper.CreateWPFImageFromRelativeResourceUri("PageImages/Hide.png", 16, 16);
|
||||
menu.Items.Add(m3);
|
||||
|
||||
MenuItem m4 = new MenuItem();
|
||||
m4.Header = "Close";
|
||||
m4.Click += new RoutedEventHandler(ContextMenu_Item_Click);
|
||||
m4.Icon = WPFHelper.CreateWPFImageFromRelativeResourceUri("PageImages/Close.png", 16, 16);
|
||||
menu.Items.Add(m4);
|
||||
|
||||
// Load all the Events
|
||||
menu.Closed += new RoutedEventHandler(ContextMenu_Closed);
|
||||
menu.MouseLeave += new MouseEventHandler(ContextMenu_MouseLeave);
|
||||
return menu;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// We need to manually implement the context menu upon right click and not use wpf,
|
||||
/// because of the mouse leave event
|
||||
/// </summary>
|
||||
private void dataGridWorkspaces_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
ContextMenu menu = dataGrid_CreateDataGridContextMenu();
|
||||
if (menu != null)
|
||||
{
|
||||
// Make sure that leave doesn't work
|
||||
m_WorkspaceSelectorObj.DontCloseOnMouseLeave = true;
|
||||
|
||||
// Show the Context Menu
|
||||
menu.IsOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ContextMenu Events
|
||||
|
||||
/// <summary>
|
||||
/// Context Menu - Closed Event
|
||||
/// </summary>
|
||||
void ContextMenu_Closed(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Make sure that navigator leave works again
|
||||
m_WorkspaceSelectorObj.DontCloseOnMouseLeave = false;
|
||||
|
||||
// Close the Navigation Form *if the mouse is NOT over it*
|
||||
if (!WPFHelper.IsMouseCursorOverWPFormWindow(m_WorkspaceSelectorObj))
|
||||
m_WorkspaceSelectorObj.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context Menu - Mouse Leave Event
|
||||
/// </summary>
|
||||
void ContextMenu_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
// On Leave just close the Menu
|
||||
ContextMenu menu = (ContextMenu)sender;
|
||||
menu.IsOpen = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Context Menu - Menu Item Clicked Event
|
||||
/// </summary>
|
||||
void ContextMenu_Item_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MenuItem m = (MenuItem)sender;
|
||||
|
||||
string strWorkspaceName = dataGrid_GetSelectedWorkspaceIfThereIsOne();
|
||||
if (!String.IsNullOrEmpty(strWorkspaceName))
|
||||
{
|
||||
bool bSuccess = false;
|
||||
switch (m.Header.ToString())
|
||||
{
|
||||
case "Launch":
|
||||
{
|
||||
bSuccess = m_WorkspaceMgr.LaunchWorkspace(strWorkspaceName);
|
||||
}
|
||||
break;
|
||||
|
||||
case "Show":
|
||||
{
|
||||
bSuccess = m_WorkspaceMgr.HideShowWorkspace(strWorkspaceName, true);
|
||||
}
|
||||
break;
|
||||
|
||||
case "Hide":
|
||||
{
|
||||
bSuccess = m_WorkspaceMgr.HideShowWorkspace(strWorkspaceName, false);
|
||||
}
|
||||
break;
|
||||
|
||||
case "Close":
|
||||
{
|
||||
bSuccess = m_WorkspaceMgr.CloseWorkspace(strWorkspaceName);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Button Click Events
|
||||
|
||||
/// <summary>
|
||||
/// New Button - Event Handler
|
||||
/// </summary>
|
||||
private void btnNew_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_NewWorkspacePage);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edit Button - Event Handler
|
||||
/// </summary>
|
||||
private void btnEdit_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string strWorkspaceName = dataGrid_GetSelectedWorkspaceIfThereIsOne();
|
||||
if (!String.IsNullOrEmpty(strWorkspaceName))
|
||||
{
|
||||
GUIState.LastSelectedWorkspaceName = strWorkspaceName;
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_RenameWorkspacePage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete Button - Event Handler
|
||||
/// </summary>
|
||||
private void btnDelete_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string strWorkspaceName = dataGrid_GetSelectedWorkspaceIfThereIsOne();
|
||||
if (!String.IsNullOrEmpty(strWorkspaceName))
|
||||
{
|
||||
GUIState.LastSelectedWorkspaceName = strWorkspaceName;
|
||||
m_WorkspaceSelectorObj.NavigateToChildPage(ChildPages.WorkspaceSelector_DeleteWorkspacePage);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// CloseAll Button - Event Handler
|
||||
/// </summary>
|
||||
private void btnCloseAll_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("Does Nothing");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Button on the Grid is being clicked - Event Handler
|
||||
/// </summary>
|
||||
private void ButtonGrid_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string strWorkspaceName = dataGrid_GetSelectedWorkspaceIfThereIsOne();
|
||||
if (String.IsNullOrEmpty(strWorkspaceName))
|
||||
return;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
237
Client Services/GUIWPForms/GUIWPForms.cs
Normal file
@@ -0,0 +1,237 @@
|
||||
// For GUIDebugStepExe Debugging Only - Uncomment this #define
|
||||
#define GUIDEBUGSTEPEXE
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Interop;
|
||||
using System.EnterpriseServices;
|
||||
using System.Reflection;
|
||||
|
||||
using Foo.Platform;
|
||||
using Foo.Platform.Win32;
|
||||
using System.Windows;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// GUIWPForms - Com Callable Wrapper Class exposed to ButtonHook.
|
||||
/// This class is responsible for creating the ButtonWPForm (a form created in response to a ButtonHook W32 Click)
|
||||
/// </summary>
|
||||
[Guid("481C24F8-D619-460b-955A-22055571430C")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[ProgId("Foo.ClientServices.GUIWPForms")]
|
||||
[ComVisible(true)]
|
||||
[ObjectPooling(Enabled = true, MinPoolSize = 1, MaxPoolSize = 2500, CreationTimeout = 5000)]
|
||||
#if GUIDEBUGSTEPEXE
|
||||
public class GUIWPForms : IGUIPWPForms
|
||||
#else
|
||||
public class GUIWPForms : ServicedComponent, IProcessInitializer, IGUIPWPForms
|
||||
#endif
|
||||
{
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
#region Construction / Destruction
|
||||
public GUIWPForms() {}
|
||||
~GUIWPForms() { }
|
||||
#endregion
|
||||
|
||||
#if GUIDEBUGSTEPEXE
|
||||
#region GuiDebugStepCustomStarterStopers
|
||||
public void Start()
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ComponentState Application Is being started", MethodBase.GetCurrentMethod().Name));
|
||||
ComponentState.ApplicationIsRunning = true;
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ComponentState Application Is being stopped", MethodBase.GetCurrentMethod().Name));
|
||||
ComponentState.ApplicationIsRunning = false;
|
||||
}
|
||||
#endregion
|
||||
#else
|
||||
#region IProcessInitializer Members
|
||||
public void Startup(object punkProcessControl)
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ComponentState Application Is being started", MethodBase.GetCurrentMethod().Name));
|
||||
ComponentState.ApplicationIsRunning = true;
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ComponentState Application Is being stopped", MethodBase.GetCurrentMethod().Name));
|
||||
ComponentState.ApplicationIsRunning = false;
|
||||
}
|
||||
#endregion
|
||||
#endif
|
||||
|
||||
#region IGUIPWPForms Members
|
||||
|
||||
/// <summary>
|
||||
/// Launches the ArtifactWall WPForm (if one already exists, relaunches)
|
||||
/// </summary>
|
||||
/// <param name="hDeskbandButtonWnd">handle to the Button on the Deskband (used for positioning)</param>
|
||||
/// <returns>true if successful, false otherwise</returns>
|
||||
public bool LaunchArtifactWall(IntPtr hDeskbandButtonWnd)
|
||||
{
|
||||
try
|
||||
{
|
||||
RECT rect;
|
||||
bool bFillRect = false;
|
||||
if (hDeskbandButtonWnd != IntPtr.Zero)
|
||||
bFillRect = Win32Functions.GetWindowRect(hDeskbandButtonWnd, out rect);
|
||||
|
||||
// First Step - Create the WpfForm
|
||||
ComponentState.GUIFormsMgr.Create_WpfFormDISP(WPForms.ArtifactWall);
|
||||
|
||||
// Second Step - If we have a Rect, set the location
|
||||
if (bFillRect)
|
||||
{
|
||||
//GUIFormsMgr._Action action = new GUIFormsMgr._Action(delegate(Window wpfForm)
|
||||
//{
|
||||
// wpfForm.Height = nHeight;
|
||||
// wpfForm.Width = nWidth;
|
||||
//});
|
||||
//ComponentState.GUIFormsMgr.RunAction_WpfFormDISP(WPForms.ArtifactWall, action);
|
||||
}
|
||||
|
||||
// Third Step - Show the WpfForm
|
||||
ComponentState.GUIFormsMgr.Show_WpfFormDISP(WPForms.ArtifactWall);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Error Occured", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the ArtifactWall if exists
|
||||
/// </summary>
|
||||
/// <returns>true if closed, false if not existent</returns>
|
||||
public bool CloseArtifactWall()
|
||||
{
|
||||
try
|
||||
{
|
||||
return ComponentState.GUIFormsMgr.Delete_WpfFormDISP(WPForms.ArtifactWall);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Error Occured", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Launches the WorkspaceSelector WPForm (if one already exists, relaunches)
|
||||
/// </summary>
|
||||
/// <param name="hDeskbandButtonWnd">handle to the Button on the Deskband (used for positioning)</param>
|
||||
/// <returns>true if successful, false otherwise</returns>
|
||||
public bool LaunchWorkspaceSelector(IntPtr hDeskbandButtonWnd)
|
||||
{
|
||||
try
|
||||
{
|
||||
RECT rect = new RECT();
|
||||
rect.top = 0;
|
||||
rect.left = 0;
|
||||
bool bSuccess = false;
|
||||
bool bFillRect = false;
|
||||
if (hDeskbandButtonWnd != IntPtr.Zero)
|
||||
bFillRect = Win32Functions.GetWindowRect(hDeskbandButtonWnd, out rect);
|
||||
|
||||
// First Step - Create the WpfForm
|
||||
bSuccess = ComponentState.GUIFormsMgr.Create_WpfFormDISP(WPForms.WorkspaceSelector);
|
||||
if (!bSuccess)
|
||||
return false;
|
||||
|
||||
// Second Step - If we have a Rect, set the location of the Workspace Selector
|
||||
if (bFillRect)
|
||||
{
|
||||
GUIFormsMgr._Action action = new GUIFormsMgr._Action(delegate(Window wpfForm)
|
||||
{
|
||||
wpfForm.Top = rect.top + rect.AsRectangle.Height + 2;
|
||||
wpfForm.Left = rect.left - 200;
|
||||
});
|
||||
bSuccess = ComponentState.GUIFormsMgr.RunAction_WpfFormDISP(WPForms.WorkspaceSelector, action);
|
||||
if (!bSuccess)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Third Step - Show the WpfForm
|
||||
bSuccess = ComponentState.GUIFormsMgr.Show_WpfFormDISP(WPForms.WorkspaceSelector);
|
||||
if (!bSuccess)
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Error Occured", MethodBase.GetCurrentMethod().Name), e);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the WorkspaceSelector if exists
|
||||
/// </summary>
|
||||
/// <param name="hDeskbandButtonWnd"></param>
|
||||
/// <returns>true if closed, false if not existent</returns>
|
||||
public bool CloseWorkspaceSelector()
|
||||
{
|
||||
try
|
||||
{
|
||||
return ComponentState.GUIFormsMgr.Delete_WpfFormDISP(WPForms.WorkspaceSelector);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Error Occured", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Launches the Settings and Abouts WPForm (if one already exists, relaunches)
|
||||
/// </summary>
|
||||
/// <param name="hDeskbandButtonWnd">handle to the Button on the Deskband (used for positioning)</param>
|
||||
/// <returns>true if successful, false otherwise</returns>
|
||||
public bool LaunchSettingsNAboutUs(IntPtr hDeskbandButtonWnd)
|
||||
{
|
||||
try
|
||||
{
|
||||
// First Step - Create the WpfForm
|
||||
ComponentState.GUIFormsMgr.Create_WpfFormDISP(WPForms.SettingsNAboutUs);
|
||||
|
||||
// Second Step - Show the WpfForm
|
||||
ComponentState.GUIFormsMgr.Show_WpfFormDISP(WPForms.SettingsNAboutUs);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Error Occured", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Closes the Settings And About us
|
||||
/// </summary>
|
||||
/// <returns>true if closed, false if not existent</returns>
|
||||
public bool CloseSettingsNAboutUs()
|
||||
{
|
||||
try
|
||||
{
|
||||
return ComponentState.GUIFormsMgr.Delete_WpfFormDISP(WPForms.WorkspaceSelector);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Error Occured", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
212
Client Services/GUIWPForms/GUIWPForms.csproj
Normal file
@@ -0,0 +1,212 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A02E052C-3C52-43DB-BB30-A47446B8165F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Foo.ClientServices.GUIWPForms</RootNamespace>
|
||||
<AssemblyName>GUIWPForms</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>MyKeyFile.SNK</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\Target\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\Target\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Infragistics3.Wpf.v8.2, Version=8.2.20082.1002, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL" />
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Components\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UIAutomationProvider">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WPFToolkit, Version=3.5.40128.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ComponentState.cs" />
|
||||
<Compile Include="DispatcherThread.cs" />
|
||||
<Compile Include="GUIFormsMgr.cs" />
|
||||
<Compile Include="GUIWPForms.cs" />
|
||||
<Compile Include="GUIWPForms\ArtifactWall.xaml.cs">
|
||||
<DependentUpon>ArtifactWall.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUIWPForms\SettingsNAboutUs.xaml.cs">
|
||||
<DependentUpon>SettingsNAboutUs.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUIWPForms\WorkspaceSelector.xaml.cs">
|
||||
<DependentUpon>WorkspaceSelector.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUIState.cs" />
|
||||
<Compile Include="GUIWPFPages\WorkspaceSelector_DeleteWorkspacePage.xaml.cs">
|
||||
<DependentUpon>WorkspaceSelector_DeleteWorkspacePage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUIWPFPages\WorkspaceSelector_NewWorkspacePage.xaml.cs">
|
||||
<DependentUpon>WorkspaceSelector_NewWorkspacePage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUIWPFPages\WorkspaceSelector_RenameWorkspacePage.xaml.cs">
|
||||
<DependentUpon>WorkspaceSelector_RenameWorkspacePage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="GUIWPFPages\WorkspaceSelector_StandardPage.xaml.cs">
|
||||
<DependentUpon>WorkspaceSelector_StandardPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="IGUIWPForms.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\DataAccessLayer\DataAccessLayer.csproj">
|
||||
<Project>{C7E4B4C1-64D4-45FF-AAFD-C4B9AE216618}</Project>
|
||||
<Name>DataAccessLayer</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\GUILib\GUILib.csproj">
|
||||
<Project>{C1282050-455B-44F4-8520-1C005E38EFB2}</Project>
|
||||
<Name>GUILib</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Platform\Platform.csproj">
|
||||
<Project>{F6929AFC-BF61-43A0-BABD-F807B65FFFA1}</Project>
|
||||
<Name>Platform</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\WorkspaceMgr\WorkspaceMgr.csproj">
|
||||
<Project>{09ED5DCC-9350-42E5-8E3A-4A3EA25BCD35}</Project>
|
||||
<Name>WorkspaceMgr</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="MyKeyFile.SNK" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="GUIWPForms\ArtifactWall.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="GUIWPForms\SettingsNAboutUs.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="GUIWPForms\WorkspaceSelector.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="GUIWPFPages\WorkspaceSelector_DeleteWorkspacePage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="GUIWPFPages\WorkspaceSelector_NewWorkspacePage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="GUIWPFPages\WorkspaceSelector_RenameWorkspacePage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="GUIWPFPages\WorkspaceSelector_StandardPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\licenses.licx" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="GUIWPFPages\PageImages\AddWorkspace.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="GUIWPFPages\PageImages\Close.png" />
|
||||
<Resource Include="GUIWPFPages\PageImages\CloseAll.png" />
|
||||
<Resource Include="GUIWPFPages\PageImages\DeleteWorkspace.png" />
|
||||
<Resource Include="GUIWPFPages\PageImages\EditWorkspace.png" />
|
||||
<Resource Include="GUIWPFPages\PageImages\Hide.png" />
|
||||
<Resource Include="GUIWPFPages\PageImages\Launch.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="GUIWPFPages\PageImages\House.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>$(FrameworkDir)\regasm.exe "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /unregister
|
||||
$(FrameworkDir)\regasm.exe "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /tlb:$(TargetName).tlb /codebase
|
||||
REM $(FrameworkDir)\regsvcs.exe /reconfig "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /appdir:"$(SolutionDir)target\$(ConfigurationName)"
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
129
Client Services/GUIWPForms/GUIWPForms.csproj.bak
Normal file
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{A02E052C-3C52-43DB-BB30-A47446B8165F}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Foo.ClientServices.GUIWPForms</RootNamespace>
|
||||
<AssemblyName>GUIWPForms</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SignAssembly>true</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>MyKeyFile.SNK</AssemblyOriginatorKeyFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Infragistics3.Wpf.v8.2, Version=8.2.20082.1002, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb, processorArchitecture=MSIL" />
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Components\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PresentationCore">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="UIAutomationProvider">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ComponentState.cs" />
|
||||
<Compile Include="DispatcherThread.cs" />
|
||||
<Compile Include="GUIFormsMgr.cs" />
|
||||
<Compile Include="GUIWPForms.cs" />
|
||||
<Compile Include="GUIWPForms\ArtifactWall.xaml.cs">
|
||||
<DependentUpon>ArtifactWall.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Platform\Platform.csproj">
|
||||
<Project>{F6929AFC-BF61-43A0-BABD-F807B65FFFA1}</Project>
|
||||
<Name>Platform</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="MyKeyFile.SNK" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="GUIWPForms\ArtifactWall.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy "$(TargetDir)$(TargetFileName)" "$(SolutionDir)target\$(ConfigurationName)" /Y
|
||||
copy "$(TargetDir)$(TargetName).pdb" "$(SolutionDir)target\$(ConfigurationName)" /Y
|
||||
$(FrameworkDir)\regasm.exe "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /unregister
|
||||
$(FrameworkDir)\regasm.exe "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /tlb:$(TargetName).tlb /codebase
|
||||
$(FrameworkDir)\regsvcs.exe /reconfig "$(SolutionDir)target\$(ConfigurationName)\$(TargetFileName)" /appdir:"$(SolutionDir)target\$(ConfigurationName)"
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
63
Client Services/GUIWPForms/GUIWPForms/ArtifactWall.xaml
Normal file
@@ -0,0 +1,63 @@
|
||||
<Window x:Class="Foo.ClientServices.GUIWPForms.ArtifactWall"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="Window_Loaded" Closing="Window_Closing"
|
||||
Background="Black" WindowStyle="None" ShowInTaskbar="False"
|
||||
Title="ArtifactWall" Height="569" Width="968" xmlns:igWindows="http://infragistics.com/Windows" Grid.IsSharedSizeScope="True">
|
||||
|
||||
<Window.Resources>
|
||||
<DataTemplate x:Key="ArtifactWallTemplate">
|
||||
<Border BorderBrush="{Binding BorderBrush}" BorderThickness="{Binding BorderThickness}">
|
||||
<StackPanel Height="{Binding StackPanelHeight}" Width="{Binding StackPanelWidth}" Background="{Binding StackPanelBackground}">
|
||||
<Image Source="{Binding ImagePath}" Height="{Binding ImageHeight}" Width="{Binding ImageWidth}" Stretch="Fill">
|
||||
<Image.ToolTip>
|
||||
<TextBlock TextWrapping="Wrap" Width="100" Text="{Binding Title}"/>
|
||||
</Image.ToolTip>
|
||||
</Image>
|
||||
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" Background="Black" Foreground="White" VerticalAlignment="Center" Width="{Binding StackPanelWidth}" Height="28" Text="{Binding Title}"/>
|
||||
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" Background="Black" Foreground="White" VerticalAlignment="Center" Width="{Binding StackPanelWidth}" Height="28" Text="{Binding LastLaunch}"/>
|
||||
<TextBlock TextWrapping="Wrap" HorizontalAlignment="Center" Background="Black" Foreground="White" VerticalAlignment="Center" Width="{Binding StackPanelWidth}" Height="28" Text="{Binding FreqLaunch}"/>
|
||||
|
||||
<!--<Label Content="{Binding Title}" Background="Black" Foreground="White"/>-->
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
<!--<Image Source="{Binding ImagePath}" Height="840" Width="400">
|
||||
</Image>-->
|
||||
<!--<StackPanel>
|
||||
<Image Source="{Binding ImagePath}" Height="640" Width="400">
|
||||
<Image.ToolTip>
|
||||
<TextBlock TextWrapping="Wrap" Width="100" Text="{Binding Title}"/>
|
||||
</Image.ToolTip>
|
||||
</Image>
|
||||
<Label Content="{Binding Title}" Background="Black" Foreground="White"/>
|
||||
<Label Content="{Binding Note}" Background="Black" Foreground="White"/>
|
||||
</StackPanel>-->
|
||||
<!--<ContentPresenter Content="{Binding XPath=Make}" />-->
|
||||
<!--<ContentPresenter Content="{Binding XPath=Model}" />-->
|
||||
</Window.Resources>
|
||||
|
||||
<Grid Name="grid1" ShowGridLines="False">
|
||||
|
||||
<Rectangle x:Name="recGradiant" Stroke="Black" RadiusY="1" RadiusX="1" Grid.ColumnSpan="2">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="1.0">
|
||||
<GradientStop Color="#FF000000" Offset="0.238"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.778"/>
|
||||
<GradientStop Color="#FE202020" Offset="0.613"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.87"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
|
||||
<igWindows:XamCarouselListBox Name="xamCarouselPanel1" Margin="21,59,82,21" ItemsSource="{Binding ElementName=This, Path=ArtifactsDT.DefaultView}" ItemTemplate="{StaticResource ArtifactWallTemplate}" BorderBrush="Transparent" Focusable="False" FlowDirection="LeftToRight" IsHitTestVisible="True" IsTabStop="False">
|
||||
</igWindows:XamCarouselListBox>
|
||||
|
||||
<Button Height="23" HorizontalAlignment="Right" Margin="0,12,5,0" Name="btnClose" VerticalAlignment="Top" Width="20" Click="btnClose_Click">X</Button>
|
||||
<TextBox Height="23" HorizontalAlignment="Left" Margin="21,23,0,0" Name="txtSearch" VerticalAlignment="Top" Width="201" />
|
||||
<Label Height="45" Margin="413,14,336,0" Name="lblTitle" VerticalAlignment="Top" Foreground="White" FontSize="24">Title</Label>
|
||||
<ComboBox Height="23" HorizontalAlignment="Right" Margin="0,23,82,0" Name="comboBox1" VerticalAlignment="Top" Width="93" />
|
||||
<Button Margin="0,167,15,0" Name="btnUp" Click="btnUp_Click" HorizontalAlignment="Right" Width="52" Height="58" VerticalAlignment="Top">Up</Button>
|
||||
<Button Height="58" HorizontalAlignment="Right" Margin="0,0,15,171" Name="btnDown" VerticalAlignment="Bottom" Width="52" Click="btnDown_Click">Down</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
269
Client Services/GUIWPForms/GUIWPForms/ArtifactWall.xaml.cs
Normal file
@@ -0,0 +1,269 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Threading;
|
||||
using System.Threading;
|
||||
|
||||
using Foo.Platform;
|
||||
using Foo.GUILib;
|
||||
using Foo.DataAccessLayer;
|
||||
using Foo.DataAccessLayer.DataTypes;
|
||||
using System.Data;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Window1.xaml
|
||||
/// </summary>
|
||||
public partial class ArtifactWall : Window
|
||||
{
|
||||
private bool m_bPerformanceCache = false;
|
||||
|
||||
// Height and Width Settings
|
||||
private int m_ItemHeight = 0;
|
||||
private int m_ItemWidth = 0;
|
||||
private int m_ImageHeight = 0;
|
||||
private int m_ImageWidth = 0;
|
||||
private int m_StackPanelHeight = 0;
|
||||
private int m_StackPanelWidth = 0;
|
||||
|
||||
// Hard-coded Settings
|
||||
private const int ITEM_BORDER_THICKNESS = 2;
|
||||
private const int SELECTION_BORDER_SIZE_MARGIN = 10;
|
||||
|
||||
|
||||
// private DT holds all information needed for the DataGrid
|
||||
public DataTable ArtifactsDT { get; private set; }
|
||||
|
||||
//object CreateImage(string Path)
|
||||
//{
|
||||
// Image myImage1 = new Image();
|
||||
// myImage1.Height = HEIGHT;
|
||||
// myImage1.Width = WIDTH;
|
||||
// BitmapImage myBitmapImage1 = new BitmapImage();
|
||||
// myBitmapImage1.BeginInit();
|
||||
// myBitmapImage1.UriSource = new Uri(Path);
|
||||
// myBitmapImage1.DecodePixelHeight = HEIGHT;
|
||||
// myBitmapImage1.DecodePixelWidth = WIDTH;
|
||||
// myBitmapImage1.EndInit();
|
||||
// myImage1.Source = myBitmapImage1;
|
||||
|
||||
// //myImage1.Margin = new Thickness(25);
|
||||
// return myImage1;
|
||||
//}
|
||||
|
||||
Path CreatePath()
|
||||
{
|
||||
LineGeometry myLineGeometry = new LineGeometry();
|
||||
myLineGeometry.StartPoint = new Point(10, 50);
|
||||
myLineGeometry.EndPoint = new Point(1600,50);
|
||||
|
||||
Path myPath = new Path();
|
||||
myPath.Stroke = Brushes.Black;
|
||||
myPath.StrokeThickness = 1;
|
||||
myPath.Data = myLineGeometry;
|
||||
return myPath;
|
||||
}
|
||||
|
||||
void AddWorkspaceArtifacts(string workspaceName)
|
||||
{
|
||||
//using (OoganizerState oogyState = new OoganizerState())
|
||||
//{
|
||||
// oogyState.SetCurrentWorkspace(workspaceName);
|
||||
|
||||
// using (OoganizerAPIProxy proxy = oogyState.GetAPIProxy())
|
||||
// {
|
||||
// Workspace workspace = proxy.API.GetWorkspace(workspaceName);
|
||||
|
||||
// foreach (OoganizerDAL.Artifact artifact in workspace.Artifacts)
|
||||
// {
|
||||
// xamCarouselPanel1.ChildElements.Add(CreateImage(artifact.Snapshot_Path));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
private void CalculateHeightAndWidthSettings()
|
||||
{
|
||||
|
||||
// Image Settings
|
||||
m_ImageHeight = 627;
|
||||
m_ImageWidth = 400;
|
||||
|
||||
// StackPanel Settings
|
||||
const int STACK_PANEL_ITEMS_HEIGHT = 84; // add together the other StackPanel items
|
||||
m_StackPanelHeight = m_ImageHeight + STACK_PANEL_ITEMS_HEIGHT;
|
||||
m_StackPanelWidth = m_ImageWidth;
|
||||
|
||||
// Item settings
|
||||
m_ItemHeight = m_StackPanelHeight + SELECTION_BORDER_SIZE_MARGIN;
|
||||
m_ItemWidth = m_StackPanelWidth + SELECTION_BORDER_SIZE_MARGIN;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
///
|
||||
/// </summary>
|
||||
private void UpdateArtifactsWall(SortOrderForWorkspaces sortOrder)
|
||||
{
|
||||
// First Step - Clear the DT
|
||||
ArtifactsDT.Rows.Clear();
|
||||
|
||||
// Second Step - Calculate Height/Width Settings
|
||||
CalculateHeightAndWidthSettings();
|
||||
|
||||
// Third Step - Fill the DT with Artifact Information
|
||||
ArtifactItem[] artifacts = Data.Artifacts.GetAllArtifactsInTheSystem(SortOrderForArtifacts.MostFrequentlyAccessedAscending);
|
||||
foreach (ArtifactItem artifact in artifacts)
|
||||
{
|
||||
var row = ArtifactsDT.NewRow();
|
||||
ArtifactsDT.Rows.Add(row);
|
||||
|
||||
// Border Settings
|
||||
row["BorderBrush"] = "Aqua";
|
||||
row["BorderThickness"] = ITEM_BORDER_THICKNESS;
|
||||
|
||||
// StackPanel Settings
|
||||
row["StackPanelHeight"] = m_StackPanelHeight;
|
||||
row["StackPanelWidth"] = m_StackPanelWidth;
|
||||
row["StackPanelBackground"] = "Transparent";
|
||||
|
||||
// Image Settings
|
||||
row["ImagePath"] = artifact.SnapshotFile;
|
||||
row["ImageHeight"] = m_ImageHeight;
|
||||
row["ImageWidth"] = m_ImageWidth;
|
||||
|
||||
// Artifact Information
|
||||
if(artifact.IsFile)
|
||||
row["Title"] = artifact.Name + " (" + artifact.FileName + ")";
|
||||
else if(artifact.IsUrl)
|
||||
row["Title"] = artifact.Name + " (" + artifact.Location + ")";
|
||||
|
||||
row["LastLaunch"] = "Last Accessed: " + artifact.LastAccessed.ToString();
|
||||
row["FreqLaunch"] = "No. Times Accessed: " + artifact.AccessCounter.ToString();
|
||||
row["Notes"] = artifact.Note;
|
||||
}
|
||||
|
||||
// Third Step - Set xmlCarousel's Item Size
|
||||
xamCarouselPanel1.ViewSettings.ItemSize = new Size(m_ItemWidth, m_ItemHeight);
|
||||
|
||||
// Fourth Step - Set the number of items * we could change this later*
|
||||
xamCarouselPanel1.ViewSettings.ItemsPerPage = 3;
|
||||
|
||||
// Fifth Step - Refresh The xmlCarousel
|
||||
xamCarouselPanel1.ItemsSource = ArtifactsDT.DefaultView;
|
||||
}
|
||||
|
||||
public ArtifactWall(bool bPerformanceCache)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowConstructor(this, bPerformanceCache))
|
||||
{
|
||||
m_bPerformanceCache = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set Window Position Here
|
||||
WindowState = WindowState.Maximized;
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
|
||||
xamCarouselPanel1.ViewSettings.ItemPath = CreatePath();
|
||||
xamCarouselPanel1.ViewSettings.ItemHorizontalScrollBarVisibility = ScrollBarVisibility.Hidden;
|
||||
xamCarouselPanel1.ViewSettings.ItemVerticalScrollBarVisibility = ScrollBarVisibility.Hidden;
|
||||
xamCarouselPanel1.ViewSettings.AutoScaleItemContentsToFit = true;
|
||||
xamCarouselPanel1.Focus();
|
||||
}
|
||||
|
||||
//WindowInteropHelper hInter = new WindowInteropHelper(this);
|
||||
//int width = System.Windows.Forms.Screen.FromHandle(hInter.Handle).Bounds.Width;
|
||||
//int height = System.Windows.Forms.Screen.FromHandle(hInter.Handle).Bounds.Height;
|
||||
}
|
||||
|
||||
#region Page Events
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowOnLoad(this, m_bPerformanceCache))
|
||||
{
|
||||
// Do anything you would like to load
|
||||
}
|
||||
else
|
||||
{
|
||||
// InitializeArtifactsDT
|
||||
ArtifactsDT = new DataTable("ArtifactsData");
|
||||
|
||||
// Border Related Settings
|
||||
ArtifactsDT.Columns.Add(new DataColumn("BorderBrush", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("BorderThickness", typeof(string)));
|
||||
|
||||
// Image related Settings
|
||||
ArtifactsDT.Columns.Add(new DataColumn("ImagePath", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("ImageHeight", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("ImageWidth", typeof(string)));
|
||||
|
||||
// StackPanel Settings
|
||||
ArtifactsDT.Columns.Add(new DataColumn("StackPanelHeight", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("StackPanelWidth", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("StackPanelBackground", typeof(string)));
|
||||
|
||||
// Artifact Settings
|
||||
ArtifactsDT.Columns.Add(new DataColumn("Title", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("LastLaunch", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("FreqLaunch", typeof(string)));
|
||||
ArtifactsDT.Columns.Add(new DataColumn("Notes", typeof(string)));
|
||||
|
||||
//
|
||||
UpdateArtifactsWall(SortOrderForWorkspaces.Ascending);
|
||||
}
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowClosing(this, m_bPerformanceCache))
|
||||
{
|
||||
// Do anything you would like to load
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
# region Button Click Events
|
||||
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
private void btnUp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void btnDown_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
42
Client Services/GUIWPForms/GUIWPForms/SettingsNAboutUs.xaml
Normal file
@@ -0,0 +1,42 @@
|
||||
<Window x:Class="Foo.ClientServices.GUIWPForms.SettingsNAboutUs"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Loaded="Window_Loaded" Closing="Window_Closing" Background="Transparent" AllowsTransparency="True"
|
||||
Title="SettingsNAboutUs" Height="461" Width="697" WindowStyle="None">
|
||||
<Grid>
|
||||
<Rectangle x:Name="recGradiant" Stroke="Black" RadiusY="7.5" RadiusX="7.5">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="1.0">
|
||||
<GradientStop Color="#FF000000" Offset="0.238"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.778"/>
|
||||
<GradientStop Color="#FE202020" Offset="0.613"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.87"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Button Height="18" HorizontalAlignment="Right" Margin="0,3,5,0" Name="btnClose" VerticalAlignment="Top" Width="17" Click="btnClose_Click" Foreground="White">X</Button>
|
||||
<TabControl Margin="12,27,12,12" Name="tabControl1" Background="Transparent">
|
||||
<TabItem Header="Settings" Name="tabSettings">
|
||||
<Grid>
|
||||
<GroupBox Header="Workspace Selector" Margin="6,6,335,167" Name="groupBoxWorkspaceSelector" Foreground="White" ForceCursor="False">
|
||||
<Grid>
|
||||
<CheckBox Height="37" Margin="6,15,6,0" Name="checkBox1" VerticalAlignment="Top" Foreground="White">
|
||||
Auto-Hide Workspaces
|
||||
</CheckBox>
|
||||
<CheckBox Foreground="White" Margin="6,47,0,72" Name="checkBox2">Auto-Save Office Documents</CheckBox>
|
||||
</Grid>
|
||||
</GroupBox>
|
||||
<GroupBox Header="Artifact Wall" Margin="348,6,6,167" Name="groupBoxArtifactWall" Foreground="White">
|
||||
<Grid />
|
||||
</GroupBox>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Help" Name="tabHelp">
|
||||
<Grid />
|
||||
</TabItem>
|
||||
<TabItem Header="About Us" Name="tabAboutUs">
|
||||
<Grid />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
</Window>
|
||||
101
Client Services/GUIWPForms/GUIWPForms/SettingsNAboutUs.xaml.cs
Normal file
@@ -0,0 +1,101 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
using Foo.GUILib;
|
||||
using Foo.Platform.Satellite;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for SettingsNAboutUs.xaml
|
||||
/// </summary>
|
||||
public partial class SettingsNAboutUs : Window
|
||||
{
|
||||
private bool m_bPerformanceCache = false;
|
||||
|
||||
public SettingsNAboutUs(bool bPerformanceCache)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowConstructor(this, bPerformanceCache))
|
||||
{
|
||||
m_bPerformanceCache = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set Window Position Here
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
}
|
||||
}
|
||||
|
||||
#region Internationalization
|
||||
|
||||
private void LoadAllTexts_Internationalization()
|
||||
{
|
||||
// Load Tab Headers
|
||||
tabSettings.Header = GUIResx.GetString("TAB_SETTINGSNABOUTUS_SETTINGS");
|
||||
tabHelp.Header = GUIResx.GetString("TAB_SETTINGSNABOUTUS_HELP");
|
||||
tabAboutUs.Header = GUIResx.GetString("TAB_SETTINGSNABOUTUS_ABOUTUS");
|
||||
|
||||
// Load Group Labels
|
||||
groupBoxWorkspaceSelector.Header = GUIResx.GetString("GROUPBOX_SETTINGABOUTUS_WORKSPACESELECTOR");
|
||||
groupBoxArtifactWall.Header = GUIResx.GetString("GROUPBOX_SETTINGABOUTUS_ARTIFACTWALL");
|
||||
|
||||
// Load Labels
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Window Events
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowOnLoad(this, m_bPerformanceCache))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Load Texts
|
||||
LoadAllTexts_Internationalization();
|
||||
}
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowClosing(this, m_bPerformanceCache))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void btnClose_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Client Services/GUIWPForms/GUIWPForms/WorkspaceSelector.xaml
Normal file
@@ -0,0 +1,20 @@
|
||||
<Window x:Class="Foo.ClientServices.GUIWPForms.WorkspaceSelector"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Closing="Window_Closing" MouseEnter="Window_MouseEnter"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="Window_Loaded" MouseLeave="Window_MouseLeave"
|
||||
BorderBrush="AliceBlue" ShowInTaskbar="False" ResizeMode="NoResize" Topmost="True"
|
||||
WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||
Title="WorkspaceSelector" Height="322" Width="250" Opacity="1" VerticalContentAlignment="Stretch">
|
||||
<Grid>
|
||||
<Rectangle x:Name="recGradiant" Stroke="Black" RadiusY="7.5" RadiusX="7.5">
|
||||
<Rectangle.Fill>
|
||||
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0" Opacity="1.0">
|
||||
<GradientStop Color="#FF000000" Offset="0.238"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.778"/>
|
||||
<GradientStop Color="#FE202020" Offset="0.613"/>
|
||||
<GradientStop Color="#FE333333" Offset="0.87"/>
|
||||
</LinearGradientBrush>
|
||||
</Rectangle.Fill>
|
||||
</Rectangle>
|
||||
<Frame Name="frmWorkspaceSelector" Margin="0,6.003" NavigationUIVisibility="Hidden" VerticalContentAlignment="Top" />
|
||||
</Grid>
|
||||
</Window>
|
||||
249
Client Services/GUIWPForms/GUIWPForms/WorkspaceSelector.xaml.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using System.Windows.Interop;
|
||||
using System.Reflection;
|
||||
using System.Windows.Threading;
|
||||
|
||||
using Foo.Platform;
|
||||
using Foo.GUILib;
|
||||
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
public enum ChildPages
|
||||
{
|
||||
WorkspaceSelector_StandardPage,
|
||||
WorkspaceSelector_NewWorkspacePage,
|
||||
WorkspaceSelector_RenameWorkspacePage,
|
||||
WorkspaceSelector_DeleteWorkspacePage,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interaction logic for WorkspaceSelector.xaml
|
||||
/// </summary>
|
||||
public partial class WorkspaceSelector : Window
|
||||
{
|
||||
private bool m_bPerformanceCache = false;
|
||||
private Page[] m_ChildPages = null;
|
||||
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
// Allow Childresn access to the Frame
|
||||
public Frame WorkspaceSelectorFrm { get { return frmWorkspaceSelector; } }
|
||||
|
||||
// Allow Children to overwrite MouseLeave Close Behavior
|
||||
public bool DontCloseOnMouseLeave { get; set; }
|
||||
|
||||
// Allow Children access to margin top/bottom
|
||||
public int MarginTopBottom { get; set; }
|
||||
|
||||
// internal flags
|
||||
private bool m_bMouseFirstTimeEnter = false;
|
||||
private bool m_bMouseHasEnteredBack = false;
|
||||
private bool m_bMouseLeaveTimerCreated = false;
|
||||
|
||||
/// <summary>
|
||||
/// Child Page Creation Factory * should only be called internally *
|
||||
/// </summary>
|
||||
/// <param name="page">the page to instantiate</param>
|
||||
/// <returns>a new page object or null</returns>
|
||||
private Page CreateChildPage(ChildPages page)
|
||||
{
|
||||
Page pageObj = null;
|
||||
switch (page)
|
||||
{
|
||||
case ChildPages.WorkspaceSelector_NewWorkspacePage:
|
||||
pageObj = new WorkspaceSelector_NewWorkspacePage(m_bPerformanceCache);
|
||||
break;
|
||||
|
||||
case ChildPages.WorkspaceSelector_RenameWorkspacePage:
|
||||
pageObj = new WorkspaceSelector_RenameWorkspacePage(m_bPerformanceCache);
|
||||
break;
|
||||
|
||||
case ChildPages.WorkspaceSelector_DeleteWorkspacePage:
|
||||
pageObj = new WorkspaceSelector_DeleteWorkspacePage(m_bPerformanceCache);
|
||||
break;
|
||||
|
||||
case ChildPages.WorkspaceSelector_StandardPage:
|
||||
pageObj = new WorkspaceSelector_StandardPage(m_bPerformanceCache);
|
||||
break;
|
||||
}
|
||||
return pageObj;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this to actually navigate to a child page object on the WorkspaceSelector
|
||||
/// </summary>
|
||||
/// <param name="page">a page to navigate to</param>
|
||||
public void NavigateToChildPage(ChildPages page)
|
||||
{
|
||||
try
|
||||
{
|
||||
Page pageObj = CreateChildPage(page);
|
||||
if (pageObj != null)
|
||||
{
|
||||
pageObj.Tag = this; // pass out this object
|
||||
if (!frmWorkspaceSelector.Navigate(pageObj))
|
||||
Log.Info(string.Format("{0}() - WorkspaceSelector could not navigate to ChildPage {1}", MethodBase.GetCurrentMethod().Name, (int)page));
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - Error Thrown", MethodBase.GetCurrentMethod().Name, e));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// WorkspaceSelector Constructor - set's default values for the object
|
||||
/// Instantiates all child pages when in Performance Mode
|
||||
/// </summary>
|
||||
/// <param name="bPerformanceCache">true if this is a cached form for performance, false every other time</param>
|
||||
public WorkspaceSelector(bool bPerformanceCache)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowConstructor(this, bPerformanceCache))
|
||||
{
|
||||
m_bPerformanceCache = true;
|
||||
|
||||
// Performance Load the Child Pages as well
|
||||
int n = Enum.GetValues(typeof(ChildPages)).Length;
|
||||
m_ChildPages = new Page[n];
|
||||
|
||||
// Iterate thru enums and create the corresponding objects in the Cache
|
||||
for (int i = 0; i < n; ++i)
|
||||
{
|
||||
ChildPages page = (ChildPages)Enum.ToObject(typeof(ChildPages), i);
|
||||
m_ChildPages[i] = CreateChildPage(page);
|
||||
}
|
||||
}
|
||||
|
||||
// By default allow mouse leave to close the form
|
||||
DontCloseOnMouseLeave = false;
|
||||
|
||||
// MarginTopBottom is the space up and below the frame 2 * 6 = 12 (but we want 2 pixels trimmed)
|
||||
MarginTopBottom = 10;
|
||||
}
|
||||
|
||||
#region Window Events
|
||||
|
||||
/// <summary>
|
||||
/// Window Load Event - Hook into MessageHook if in performance mode,
|
||||
/// otherwise load default child
|
||||
/// </summary>
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowOnLoad(this, m_bPerformanceCache))
|
||||
{
|
||||
// To Anything her you may want to do
|
||||
}
|
||||
else
|
||||
{
|
||||
// Navigate to the Default Page
|
||||
NavigateToChildPage(ChildPages.WorkspaceSelector_StandardPage);
|
||||
|
||||
// Set the GUI State to this object
|
||||
GUIState.CurrentlyShowingWPFWindow = this;
|
||||
|
||||
// Start the Load Mouse Enter Timer for 1.5 seconds
|
||||
DispatcherTimer dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Tick += new EventHandler(dispatcherTimerOnLoadMouseEnter_Tick);
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1, 500);
|
||||
dispatcherTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// keep track of window closed
|
||||
/// </summary>
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
// * For Performance Caching *
|
||||
if (WPFHiddenWindow.HiddenWindowClosing(this, m_bPerformanceCache))
|
||||
{
|
||||
// To Anything her you may want to do
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set the GUI State to this object
|
||||
GUIState.CurrentlyShowingWPFWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Keep track of mouse enter
|
||||
/// </summary>
|
||||
private void Window_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
m_bMouseFirstTimeEnter = true;
|
||||
m_bMouseHasEnteredBack = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// General Standard behavior - Close the form on Mouse Leave, except when
|
||||
/// children overwrite this behavior via DontCloseOnMouseLeave
|
||||
/// </summary>
|
||||
private void Window_MouseLeave(object sender, MouseEventArgs e)
|
||||
{
|
||||
m_bMouseHasEnteredBack = false;
|
||||
if (!m_bMouseLeaveTimerCreated)
|
||||
{
|
||||
// Start Mouse Leave Timer for 1.5 seconds
|
||||
DispatcherTimer dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Tick += new EventHandler(dispatcherTimerMouseLeave_Tick);
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 1, 500);
|
||||
dispatcherTimer.Start();
|
||||
|
||||
// Set flag
|
||||
m_bMouseLeaveTimerCreated = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Run One Time - after Mouse Leaves. Closes Form if Mouse has not entered
|
||||
/// </summary>
|
||||
void dispatcherTimerMouseLeave_Tick(object sender, EventArgs e)
|
||||
{
|
||||
// Turn off the timer
|
||||
DispatcherTimer dispatcherTimer = (DispatcherTimer)sender;
|
||||
dispatcherTimer.Stop();
|
||||
m_bMouseLeaveTimerCreated = false;
|
||||
|
||||
// Close this window, but only if the mouse has not entered back ||
|
||||
// we are told not to do it
|
||||
if (!m_bMouseHasEnteredBack && !DontCloseOnMouseLeave)
|
||||
this.Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Run One Time - Upon Load. Closes form if mouse has not entered
|
||||
/// </summary>
|
||||
void dispatcherTimerOnLoadMouseEnter_Tick(object sender, EventArgs e)
|
||||
{
|
||||
// We only want to run this timer Once * Always *
|
||||
DispatcherTimer dispatcherTimer = (DispatcherTimer)sender;
|
||||
dispatcherTimer.Stop();
|
||||
|
||||
// Close this window, but only if the mouse has not entered back
|
||||
// Close this Form *always*
|
||||
if (!m_bMouseFirstTimeEnter && !DontCloseOnMouseLeave)
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
32
Client Services/GUIWPForms/IGUIWPForms.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms
|
||||
{
|
||||
/// <summary>
|
||||
/// GUIPWPForms uses IGUIPWPForms Interface. It exposes functions to external
|
||||
/// callers regarding the type of GUIWPForms we can launch.
|
||||
/// ~Most functions require an hWnd which is the DeskbandButton to properly Position the form.
|
||||
/// ~However if hWnd is Zero and we are in Debug we just center it. * For Debugging Purpose *
|
||||
/// </summary>
|
||||
[Guid("652DDE0A-D3FA-4525-8272-1616127819D2")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
[ComVisible(true)]
|
||||
public interface IGUIPWPForms
|
||||
{
|
||||
// ArtifactWall
|
||||
bool LaunchArtifactWall(IntPtr hDeskbandButtonWnd);
|
||||
bool CloseArtifactWall();
|
||||
|
||||
// WorkspaceSelector
|
||||
bool LaunchWorkspaceSelector(IntPtr hDeskbandButtonWnd);
|
||||
bool CloseWorkspaceSelector();
|
||||
|
||||
// Settings N' About Us Page
|
||||
bool LaunchSettingsNAboutUs(IntPtr hDeskbandButtonWnd);
|
||||
bool CloseSettingsNAboutUs();
|
||||
}
|
||||
}
|
||||
BIN
Client Services/GUIWPForms/MyKeyFile.SNK
Normal file
58
Client Services/GUIWPForms/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.EnterpriseServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("GUIWPForms")]
|
||||
[assembly: AssemblyDescription("Performance Caching for GUIWPForms")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ooganizer Corporation")]
|
||||
[assembly: AssemblyProduct("GUIWPForms")]
|
||||
[assembly: AssemblyCopyright("Copyright © Ooganizer Corporation 2009")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(true)]
|
||||
[assembly: ApplicationID("E6A84616-5ED1-4679-B26D-64F80A5E41CD")]
|
||||
[assembly: ApplicationActivation(ActivationOption.Server)]
|
||||
[assembly: ApplicationAccessControl(Value = false, Authentication = AuthenticationOption.None)]
|
||||
[assembly: ApplicationName("Foo.ClientServices")]
|
||||
[assembly: Description("Provides Data Access and Performance Caching for Ooganizer Components")]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
63
Client Services/GUIWPForms/Properties/Resources.Designer.cs
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4200
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Foo.ClientServices.GUIWPForms.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
101
Client Services/GUIWPForms/Properties/Resources.resx
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 1.3
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">1.3</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1">this is my long string</data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
[base64 mime encoded serialized .NET Framework object]
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
[base64 mime encoded string representing a byte array form of the .NET Framework object]
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
Client Services/GUIWPForms/Properties/Settings.Designer.cs
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.4200
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Foo.ClientServices.GUIWPForms.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
Client Services/GUIWPForms/Properties/Settings.settings
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
</SettingsFile>
|
||||
1
Client Services/GUIWPForms/Properties/licenses.licx
Normal file
@@ -0,0 +1 @@
|
||||
Infragistics.Windows.Controls.XamCarouselListBox, Infragistics3.Wpf.v8.2, Version=8.2.20082.1002, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb
|
||||