initial oogynize check in _ this actually used to work!
19
Client Services/ButtonWPForm/ButtonForm.xaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="Foo.ClientServices.ButtonWPForm.ButtonForm"
|
||||
Title="ButtonForm" Closed="Window_Closed" Height="419" Width="538" WindowStyle="None" AllowsTransparency="True" Background="Transparent" ShowInTaskbar="False" Loaded="OnLoad" ResizeMode="NoResize" ShowActivated="False" mc:Ignorable="d">
|
||||
<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 x:Name="frmButtonForm" Margin="0,40,0,0" VerticalAlignment="Top" Height="371" />
|
||||
</Grid>
|
||||
</Window>
|
||||
211
Client Services/ButtonWPForm/ButtonForm.xaml.cs
Normal file
@@ -0,0 +1,211 @@
|
||||
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.Runtime.InteropServices;
|
||||
using System.Drawing;
|
||||
using System.Reflection;
|
||||
using SnapshotImage = System.Drawing.Image;
|
||||
|
||||
// Ooganizer namespaces
|
||||
using Foo.ClientServices.ButtonWPForm.ButtonFormPages;
|
||||
using Foo.Platform;
|
||||
using Foo.Platform.Win32;
|
||||
using Foo.Platform.ErrorReporting;
|
||||
using Foo.Platform.Interacters;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ButtonWindow Form
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
public partial class ButtonForm : Window
|
||||
{
|
||||
////
|
||||
// Public Properties
|
||||
////
|
||||
public IntPtr HookedWindow { get { return _hHookedWnd; } set { _hHookedWnd = value; } } // Passed in by FormMgr
|
||||
public System.Drawing.Image SnapShot { get { return _SnapShot; } set { _SnapShot = value; } } // Passed in by FormMgr
|
||||
//public Artifact Artifact { get { return _Artifact; } }
|
||||
//public string ArtifactTitle { get { return _ArtifactTitle; } }
|
||||
//public string ArtifactLocation { get { return _ArtifactLocation; } }
|
||||
//public string CurrentWorkspaceName { get { return _CurrentWorkspaceName; } }
|
||||
|
||||
////
|
||||
// Private Member Variables
|
||||
////
|
||||
private IntPtr _hHookedWnd = IntPtr.Zero;
|
||||
private System.Drawing.Image _SnapShot = null;
|
||||
private bool _PerformanceCache = false;
|
||||
private static ButtonForm s_PerfCacheButtonFormObj = null;
|
||||
private bool _PerfCacheLoadedHidden = false;
|
||||
//private Artifact _Artifact;
|
||||
//private string _ArtifactTitle;
|
||||
//private string _ArtifactLocation;
|
||||
//private string _CurrentWorkspaceName;
|
||||
|
||||
////
|
||||
// ButtonFormPages
|
||||
////
|
||||
IButtonFormPage[] m_ButtonFormPages = new IButtonFormPage[1];
|
||||
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Construct WPF ButtonForm :)
|
||||
/// </summary>
|
||||
public ButtonForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct WPF ButtonForm (Performance Cache)
|
||||
/// </summary>
|
||||
public ButtonForm(bool bPerformanceCache)
|
||||
{
|
||||
if (bPerformanceCache && (s_PerfCacheButtonFormObj == null))
|
||||
{
|
||||
_PerformanceCache = bPerformanceCache;
|
||||
s_PerfCacheButtonFormObj = this;
|
||||
}
|
||||
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// As part of Performance Caching (load one instance of this form
|
||||
/// hidden and not visible to the user (called by FormMgr) ~also
|
||||
/// allows to hide and existing one
|
||||
/// ~Should only be called by FormMgr when creating the first object
|
||||
/// </summary>
|
||||
public void LoadHideButtonFormPerfCache()
|
||||
{
|
||||
if (!_PerfCacheLoadedHidden && _PerformanceCache && (s_PerfCacheButtonFormObj != null))
|
||||
{
|
||||
s_PerfCacheButtonFormObj.Opacity = 0;
|
||||
s_PerfCacheButtonFormObj.WindowState = WindowState.Minimized;
|
||||
s_PerfCacheButtonFormObj.ShowInTaskbar = false;
|
||||
s_PerfCacheButtonFormObj.Show();
|
||||
s_PerfCacheButtonFormObj.Hide();
|
||||
_PerfCacheLoadedHidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Window Load Event. We want all object loading to happen in the Load Event,
|
||||
/// because we construct the WPFForm and show it right away, so this is called right at
|
||||
/// start up, so put all the object loading in here to be cleaner and simplify FormObject Creator
|
||||
/// </summary>
|
||||
private void OnLoad(object sender, RoutedEventArgs args)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (_PerformanceCache && (this == s_PerfCacheButtonFormObj)) // Preload child pages
|
||||
{
|
||||
PreloadAllChildPages();
|
||||
|
||||
// Add Message Hook for performance WPForm * To make sure it is always invisible *
|
||||
HwndSource source = HwndSource.FromHwnd(new WindowInteropHelper(this).Handle);
|
||||
source.AddHook(new HwndSourceHook(MessageHook));
|
||||
}
|
||||
else if (!_PerformanceCache && (HookedWindow != IntPtr.Zero) && (this != s_PerfCacheButtonFormObj))
|
||||
{
|
||||
////
|
||||
// Resolve the Window and set the properties accordingly,
|
||||
// our child pages depend on this information
|
||||
////
|
||||
//ResolverDispatch resolver = new ResolverDispatch();
|
||||
//ArtifactGroup artifacts = resolver.GetArtifacts(HookedWindow);
|
||||
|
||||
//if (artifacts.Length > 0)
|
||||
//{
|
||||
// _Artifact = artifacts.GetPrimary;
|
||||
// _ArtifactTitle = _Artifact.Name;
|
||||
// _ArtifactLocation = _Artifact.Location;
|
||||
|
||||
// // Workspace
|
||||
// _CurrentWorkspaceName = SrvrCommon.GetCurrentWorkspaceName();
|
||||
|
||||
// // Now Load the Page
|
||||
// LoadPageAccordingToState();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// // Somemething went wrong Resolving
|
||||
// UserError.Show("Document not Found", "Failed to accurately find the document for the Window");
|
||||
// Close(); //~imp, we must close this Form
|
||||
//}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - A fatal error occured loading ButtonForm", MethodBase.GetCurrentMethod().Name), e);
|
||||
Close(); //~imp, we must close this Form
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This Message Hook is for the Hidden WPForm that we use for better performance,
|
||||
/// We want to make sure that it is never displayed *It can occur that explore can show it, without this*
|
||||
/// </summary>
|
||||
private IntPtr MessageHook(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
||||
{
|
||||
// force opacity at all times
|
||||
if (Opacity == 1.0)
|
||||
Opacity = 0.0;
|
||||
|
||||
// force minimized at all times
|
||||
if (WindowState != WindowState.Minimized)
|
||||
WindowState = WindowState.Minimized;
|
||||
|
||||
// force Not to be seen in taskbar
|
||||
if (ShowInTaskbar == true)
|
||||
ShowInTaskbar = false;
|
||||
|
||||
return System.IntPtr.Zero;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For Performance, we need to preload all Child Pages
|
||||
/// </summary>
|
||||
private void PreloadAllChildPages()
|
||||
{
|
||||
m_ButtonFormPages[0] = (IButtonFormPage) new Page_AddEdit();
|
||||
m_ButtonFormPages[0].ParentWPFContainer = this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show different pages depending on the state we are in. (Currently only 1 state)
|
||||
/// </summary>
|
||||
private void LoadPageAccordingToState()
|
||||
{
|
||||
m_ButtonFormPages[0] = (IButtonFormPage) new Page_AddEdit();
|
||||
m_ButtonFormPages[0].ParentWPFContainer = this;
|
||||
|
||||
if (!frmButtonForm.Navigate((Page) m_ButtonFormPages[0]))
|
||||
Log.Info(string.Format("{0}() - ButtonForm could not navigate to Page_AddEdit", MethodBase.GetCurrentMethod().Name));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When this window closes position the Hooked Window back to it's original position
|
||||
/// </summary>
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
// GUICommon.PositionWindowBackToWhereItWas(HookedWindow, true);
|
||||
BHInteracter.SetAsActiveWindow(HookedWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
324
Client Services/ButtonWPForm/ButtonFormMgr.cs
Normal file
@@ -0,0 +1,324 @@
|
||||
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;
|
||||
|
||||
// Ooganizer Namespaces
|
||||
using Foo.Platform;
|
||||
using Foo.Platform.Win32;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
/// <summary>
|
||||
/// This class manages the creation/deletion and actions of (1 - n) ButtonForms
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
internal class ButtonFormMgr
|
||||
{
|
||||
private const int INITIAL_OBJECT_CAPACITY = 30;
|
||||
private Hashtable m_ObjectList = null;
|
||||
private Dispatcher m_Dispatcher = null;
|
||||
|
||||
// we have one btnForm loaded (hidden) always, as a performance cache
|
||||
private ButtonForm m_btnForm = null;
|
||||
private bool m_IsBtnFormCached = false;
|
||||
|
||||
// Imp! - allows external caller to run any action on a ButtonForm
|
||||
public delegate void _Action(ButtonForm btnForm);
|
||||
|
||||
//custom private delegates
|
||||
private delegate void delegate_Create(int hParentWND, Image snapshot);
|
||||
private delegate void delegate_Delete(int hParentWND);
|
||||
private delegate int delegate_CreateWindow(int hParentWND);
|
||||
private delegate void delegate_Action(int hParentWND, _Action action);
|
||||
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public ButtonFormMgr(Dispatcher disp)
|
||||
{
|
||||
m_ObjectList = new Hashtable();
|
||||
m_Dispatcher = disp;
|
||||
|
||||
if (!m_IsBtnFormCached)
|
||||
BetterPerformance();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Create_ButtonForm via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
public void Create_ButtonFormDISP(int hParentWND, Image snapshot)
|
||||
{
|
||||
if (hParentWND != 0)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
Create_ButtonForm(hParentWND, snapshot);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { hParentWND, snapshot };
|
||||
m_Dispatcher.Invoke((delegate_Create)Create_ButtonFormDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Create_ButtonFormWindow via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
public int Create_ButtonFormWindowDISP(int hParentWND)
|
||||
{
|
||||
if (hParentWND != 0)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
return Create_ButtonFormWindow(hParentWND);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { hParentWND };
|
||||
return (int)m_Dispatcher.Invoke((delegate_CreateWindow)Create_ButtonFormWindowDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Delete_ButtonForm via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
public void Delete_ButtonFormDISP(int hParentWND)
|
||||
{
|
||||
if (hParentWND != 0)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
Delete_ButtonForm(hParentWND);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { hParentWND };
|
||||
m_Dispatcher.Invoke((delegate_Delete)Delete_ButtonFormDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this Dispatching Action Function to run any _Action on the ButtonForm
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
public void RunAction_ButtonFormDISP(int hParentWND, _Action action)
|
||||
{
|
||||
if (hParentWND != 0)
|
||||
{
|
||||
if (m_Dispatcher.Thread == Thread.CurrentThread)
|
||||
{
|
||||
RunAction_ButtonForm(hParentWND, action);
|
||||
}
|
||||
else
|
||||
{
|
||||
object[] parameters = new object[] { hParentWND, action };
|
||||
m_Dispatcher.Invoke((delegate_Action)RunAction_ButtonFormDISP, System.Windows.Threading.DispatcherPriority.Normal, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls Terminate via Dispatcher if neccessary
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
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 ButtonForm object into the ObjectList
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
private void Create_ButtonForm(int hParentWND, Image snapshot)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!m_IsBtnFormCached)
|
||||
BetterPerformance();
|
||||
|
||||
m_ObjectList[hParentWND] = new ButtonForm();
|
||||
ButtonForm btnForm = (ButtonForm)m_ObjectList[hParentWND];
|
||||
|
||||
if (btnForm != null)
|
||||
{
|
||||
// We use the InteropHelper to set the Owner Property
|
||||
WindowInteropHelper InteropHelper = new WindowInteropHelper(btnForm);
|
||||
InteropHelper.Owner = (IntPtr)hParentWND;
|
||||
|
||||
// Set the important Fields into the Button Form
|
||||
btnForm.HookedWindow = (IntPtr)hParentWND; // give it the handle to the hooked window
|
||||
btnForm.SnapShot = snapshot; // give it the snapshot of the window
|
||||
|
||||
RECT ParentWndRect = new RECT();
|
||||
Win32Functions.GetWindowRect((IntPtr)hParentWND, out ParentWndRect);
|
||||
|
||||
// Get Initial Location for the form
|
||||
btnForm.Top = ParentWndRect.top;
|
||||
btnForm.Left = ParentWndRect.left;
|
||||
|
||||
// Get Initial Height and Width of the form
|
||||
btnForm.Height = (ParentWndRect.bottom - ParentWndRect.top);
|
||||
btnForm.Width = (ParentWndRect.right - ParentWndRect.left);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this function to delete the ButtonForm Object
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
private void Delete_ButtonForm(int hParentWND)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_ObjectList.ContainsKey(hParentWND))
|
||||
{
|
||||
ButtonForm btnForm = (ButtonForm)m_ObjectList[hParentWND];
|
||||
if (btnForm != null)
|
||||
{
|
||||
m_ObjectList.Remove(hParentWND);
|
||||
btnForm.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this to run void() function actions on the specified buttonform
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
/// <param name="action">a pointer to a delegate (action function) to run</param>
|
||||
private void RunAction_ButtonForm(int hParentWND, _Action action)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_ObjectList.ContainsKey(hParentWND))
|
||||
{
|
||||
ButtonForm btnForm = (ButtonForm)m_ObjectList[hParentWND];
|
||||
if (btnForm != null)
|
||||
action(btnForm);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this to actually create the Window, call this after calling Create_ButtonForm
|
||||
/// This will create the window by calling Show(), this will also show the window
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">handle to Parent/Owner Window</param>
|
||||
/// <returns>the Handle to the newly created window object</returns>
|
||||
private int Create_ButtonFormWindow(int hParentWND)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (m_ObjectList.ContainsKey(hParentWND))
|
||||
{
|
||||
ButtonForm btnForm = (ButtonForm)m_ObjectList[hParentWND];
|
||||
|
||||
// We use the InteropHelper to see if this WPFForm has been created previously
|
||||
WindowInteropHelper InteropHelper = new WindowInteropHelper(btnForm);
|
||||
if (InteropHelper.Handle == IntPtr.Zero)
|
||||
{
|
||||
btnForm.Show();
|
||||
}
|
||||
return (int)InteropHelper.Handle;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Kills all ButtonForm Instances (STOPS ALL)
|
||||
/// </summary>
|
||||
private void Terminate()
|
||||
{
|
||||
try
|
||||
{
|
||||
foreach (object o in m_ObjectList)
|
||||
{
|
||||
if ((o != null) && (o is ButtonForm))
|
||||
{
|
||||
ButtonForm btnForm = (ButtonForm)o;
|
||||
btnForm.Close();
|
||||
}
|
||||
}
|
||||
m_ObjectList.Clear();
|
||||
|
||||
if (m_IsBtnFormCached)
|
||||
{
|
||||
m_btnForm.Close();
|
||||
m_IsBtnFormCached = false;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// In order to improve first WPForm performance we have one
|
||||
/// WPForm ButtonForm 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_IsBtnFormCached)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Performance Cache (keeps a window loaded always)
|
||||
m_btnForm = new ButtonForm(true);
|
||||
m_btnForm.LoadHideButtonFormPerfCache();
|
||||
m_IsBtnFormCached = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<Page
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="Foo.ClientServices.ButtonWPForm.ButtonFormPages.Page_AddEdit"
|
||||
Title="Page_AddEdit" Loaded="Page_Loaded" mc:Ignorable="d" Height="255" Width="550">
|
||||
<Grid d:LayoutOverrides="VerticalMargin">
|
||||
<Border CornerRadius="6" Background="Gray" Opacity="0.325" HorizontalAlignment="Left" Width="550"/>
|
||||
<TextBox Margin="90,33,39,0" x:Name="txtTitle" Height="22" VerticalAlignment="Top" />
|
||||
<Label Height="28" HorizontalAlignment="Left" Margin="48,30.667,0,0" x:Name="lblTitle" VerticalAlignment="Top" Width="36" Foreground="White" Content="Title" RenderTransformOrigin="-1.028,1.036"/>
|
||||
<TextBox TextAlignment="Left" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Margin="90,0,39,77.671" x:Name="txtLocation" Background="Transparent" Foreground="White" BorderBrush="{x:Null}" Focusable="False" IsTabStop="False" VerticalAlignment="Bottom" Height="40" />
|
||||
<ComboBox Margin="90,85,39,0" x:Name="comboWorkspaces" Height="24" VerticalAlignment="Top" d:LayoutOverrides="VerticalAlignment" />
|
||||
<Label HorizontalAlignment="Left" Margin="12,83.334,0,0" x:Name="label1" Width="74" Foreground="White" Height="27" VerticalAlignment="Top" Content="Workspace" d:LayoutOverrides="VerticalAlignment"/>
|
||||
<Label Height="24" HorizontalAlignment="Right" Margin="0,55,29,0" x:Name="lblRequired" VerticalAlignment="Top" Width="54" Foreground="White" FontSize="10" FontStyle="Italic" Content="Required" RenderTransformOrigin="1.963,0.542"/>
|
||||
<Label FontSize="10" FontStyle="Italic" Foreground="White" Height="24" HorizontalAlignment="Right" Margin="0,108.331,29,0" x:Name="lblRequired3" VerticalAlignment="Top" Width="54" Content="Required"/>
|
||||
<Button HorizontalAlignment="Left" Margin="90,201.649,0,0" x:Name="btnCancel" Width="75" Click="btnCancel_Click" Content="Cancel" VerticalAlignment="Top" Height="23"/>
|
||||
<Button HorizontalAlignment="Right" Margin="0,201.649,39,0" x:Name="btnAdd" Width="75" Click="btnAdd_Click" Content="Add" VerticalAlignment="Top" Height="23"/>
|
||||
</Grid>
|
||||
</Page>
|
||||
@@ -0,0 +1,81 @@
|
||||
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.Reflection;
|
||||
|
||||
// Ooganizer Namespaces
|
||||
using Foo.Platform;
|
||||
using Foo.Platform.Interacters;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm.ButtonFormPages
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ButtonFormPage_AddEdit.xaml
|
||||
/// </summary>
|
||||
public partial class Page_AddEdit : Page, IButtonFormPage
|
||||
{
|
||||
#region IButtonFormPage
|
||||
public ButtonForm ParentWPFContainer { get { return _ButtonForm; } set { _ButtonForm = value; } }
|
||||
private ButtonForm _ButtonForm = null;
|
||||
#endregion
|
||||
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public Page_AddEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Page_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (ParentWPFContainer == null)
|
||||
{
|
||||
Log.Debug(string.Format("{0}() - ParentWPFContainer is null this should never happen", MethodBase.GetCurrentMethod().Name));
|
||||
return;
|
||||
}
|
||||
|
||||
// Set the Artifact Properties
|
||||
//txtTitle.Text = ParentWPFContainer.ArtifactTitle;
|
||||
|
||||
// se
|
||||
//txtLocation.Text = ParentWPFContainer.ArtifactLocation;
|
||||
//txtLocation.ScrollToEnd();
|
||||
|
||||
// Add all workspaces to the combo selection
|
||||
//foreach (Ooganizer.API.Workspace wspace in SrvrCommon.Workspaces)
|
||||
// comboWorkspaces.Items.Add(wspace.Name);
|
||||
|
||||
////
|
||||
// Default to the current Workspace or 0 if none are loaded
|
||||
////
|
||||
//if (ParentWPFContainer.CurrentWorkspaceName == "")
|
||||
// comboWorkspaces.SelectedIndex = 0;
|
||||
//else
|
||||
// comboWorkspaces.SelectedValue = ParentWPFContainer.CurrentWorkspaceName;
|
||||
}
|
||||
|
||||
private void btnCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
BHInteracter.SetW32ButtonToNewState(ParentWPFContainer.HookedWindow, BHInteracter.BUTTON_HOOK_STATE.BUTTON_ADD);
|
||||
ParentWPFContainer.Close();
|
||||
}
|
||||
|
||||
private void btnAdd_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
//SrvrCommon.AddArtifactToWorkspace(txtTitle.Text, txtLocation.Text, ParentWPFContainer.SnapShot, ParentWPFContainer.CurrentWorkspaceName);
|
||||
//BHInteracter.SetW32ButtonToNewState(ParentWPFContainer.HookedWindow, BHInteracter.BUTTON_HOOK_STATE.BUTTON_DELETE);
|
||||
ParentWPFContainer.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
156
Client Services/ButtonWPForm/ButtonWPForm.csproj
Normal file
@@ -0,0 +1,156 @@
|
||||
<?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>{E179DF39-539A-407F-94DE-C21F690E02C4}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Foo.ClientServices.ButtonWPForm</RootNamespace>
|
||||
<AssemblyName>ButtonWPForm</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="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Components\log4net.dll</HintPath>
|
||||
</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>
|
||||
<Reference Include="PresentationCore">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="PresentationFramework">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="ButtonForm.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ButtonFormPages\Page_AddEdit.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Compile Include="ButtonForm.xaml.cs">
|
||||
<DependentUpon>ButtonForm.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ButtonFormMgr.cs" />
|
||||
<Compile Include="ButtonFormPages\Page_AddEdit.xaml.cs">
|
||||
<DependentUpon>Page_AddEdit.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ButtonWPFormCCW.cs" />
|
||||
<Compile Include="CaptionButtonStarter.cs" />
|
||||
<Compile Include="IButtonFormPage.cs" />
|
||||
<Compile Include="IClientEvents.cs" />
|
||||
<Compile Include="ComponentState.cs" />
|
||||
<Compile Include="DispatcherThread.cs" />
|
||||
<Compile Include="IButtonForm.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<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>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="MyKeyFile.SNK" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</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>
|
||||
</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>
|
||||
249
Client Services/ButtonWPForm/ButtonWPFormCCW.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
|
||||
// For GUIDebugStepExe Debugging Only - Uncomment this #define
|
||||
#define GUIDEBUGSTEPEXE
|
||||
|
||||
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;
|
||||
|
||||
// Ooganizer Namespaces
|
||||
using Foo.GUILib;
|
||||
using Foo.Platform;
|
||||
using Foo.Platform.Win32;
|
||||
using Foo.Platform.Interacters;
|
||||
using Foo.Platform.ErrorReporting;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// ButtonWPFormCCW - 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("6F108F0B-9CEB-4d3d-B1D9-7685F9F39E50")]
|
||||
[ClassInterface(ClassInterfaceType.None)]
|
||||
[ProgId("Foo.ClientServices.ButtonWPFormCCW")]
|
||||
[ComVisible(true)]
|
||||
[ObjectPooling(Enabled = true, MinPoolSize = 1, MaxPoolSize = 2500, CreationTimeout = 5000)]
|
||||
#if GUIDEBUGSTEPEXE
|
||||
public class ButtonWPFormCCW : IButtonForm, IClientEvents
|
||||
#else
|
||||
public class ButtonWPFormCCW : ServicedComponent, IButtonForm, IClientEvents, IProcessInitializer
|
||||
#endif
|
||||
{
|
||||
|
||||
////
|
||||
// Member Variables
|
||||
////
|
||||
private IntPtr m_hWnd = IntPtr.Zero;
|
||||
private IntPtr m_hWndParent = IntPtr.Zero;
|
||||
private IntPtr m_hWndButton = IntPtr.Zero;
|
||||
|
||||
BHInteracter.BUTTON_HOOK_STATE m_ButtonState = BHInteracter.BUTTON_HOOK_STATE.BUTTON_NONE;
|
||||
|
||||
// Declare the Log4net Variable
|
||||
private static log4net.ILog Log = Logger.GetLog4NetInterface(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
#region Construction / Destruction
|
||||
public ButtonWPFormCCW() {}
|
||||
~ButtonWPFormCCW() {}
|
||||
#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 ButtonHook Activation/Deactivation
|
||||
/// <summary>
|
||||
/// This is called first time when the buttonhook is attaching into a Window. It passes us
|
||||
/// important handle information that we need or may need to communicate back state information.
|
||||
/// </summary>
|
||||
/// <param name="hParentWND">the handle to the window the buttonhook is hooked into</param>
|
||||
/// <param name="hButtonWND">the handle to the button Window (we need it if we want to communicat with it)</param>
|
||||
public void WPFThreadProc_ButtonWPForm_Activated(int hParentWND, int hButtonWND)
|
||||
{
|
||||
// Store the handle information for later use
|
||||
m_hWndParent = (IntPtr)hParentWND;
|
||||
m_hWndButton = (IntPtr)hButtonWND;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the buttonhook is unattaching itself from a Window.
|
||||
/// Here, we can do any cleanup that we may have to do.
|
||||
/// </summary>
|
||||
public void WPFThreadProc_ButtonWPForm_Deactivated()
|
||||
{
|
||||
try
|
||||
{
|
||||
if ((m_hWndParent != IntPtr.Zero) && (ComponentState.ButtonFormMgr != null))
|
||||
ComponentState.ButtonFormMgr.Delete_ButtonFormDISP((int)m_hWndParent);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Custom Events
|
||||
/// <summary>
|
||||
/// This function is called when the Win32 button is clicked. This function should
|
||||
/// handle the creation of the wpfform and display it over the window
|
||||
/// </summary>
|
||||
/// <returns>the window handle to the newly created wpfform to be stored by the caller</returns>
|
||||
public int W32BUTTONCLICKED()
|
||||
{
|
||||
try
|
||||
{
|
||||
// Let's Position the Window and snapshot it...
|
||||
Image snapshot = null;
|
||||
try
|
||||
{
|
||||
BHInteracter.SetW32ButtonToNewState(m_hWndParent, BHInteracter.BUTTON_HOOK_STATE.BUTTON_NONE);
|
||||
System.Threading.Thread.Sleep(100);
|
||||
snapshot = GUICommon.PositionWindowToGoldenPosAndTakeSnapshot(m_hWndParent, true);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
UserError.Show("Snapshot Failed", "Obtaining a Snaphot for the Window Failed.");
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (snapshot != null)
|
||||
{
|
||||
// Create the WpfForm object and then create the wpfform window and show it.
|
||||
ComponentState.ButtonFormMgr.Create_ButtonFormDISP((int)m_hWndParent, snapshot);
|
||||
m_hWnd = (IntPtr) ComponentState.ButtonFormMgr.Create_ButtonFormWindowDISP((int)m_hWndParent);
|
||||
return (int)m_hWnd;
|
||||
}
|
||||
else
|
||||
{
|
||||
UserError.Show("Snapshot Failed", "Obtaining a Snaphot for the Window Failed.");
|
||||
Log.Error(string.Format("{0}() - UserError.Show() - Obtaining a Snapshot Failed", MethodBase.GetCurrentMethod().Name));
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
UserError.Show("Snapshot Failed", "Obtaining a Snaphot for the Window Failed.");
|
||||
Log.Error(string.Format("{0}() - error thrown", MethodBase.GetCurrentMethod().Name), e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Window Events we can extend on
|
||||
public void WindowEvent_MaximizeOccured(int nHeight, int nWidth)
|
||||
{
|
||||
}
|
||||
|
||||
public void WindowEvent_MinimizeOccured()
|
||||
{
|
||||
}
|
||||
|
||||
public void WindowEvent_WindowActivated()
|
||||
{
|
||||
}
|
||||
|
||||
public void WindowEvent_WindowDeactivated()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Resolver Client Events
|
||||
public void ReResolve(int pid, IntPtr hWnd)
|
||||
{
|
||||
Log.Debug(string.Format("{0}() - Debug - ReResolve is called for {0} and {1}", pid, hWnd));
|
||||
}
|
||||
|
||||
public void hWndInitialActivate(int pid, IntPtr hWnd, string ProcessStartUpPrms)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
m_ButtonState = BHInteracter.SetW32ButtonToNewState(m_hWndParent, BHInteracter.BUTTON_HOOK_STATE.BUTTON_ADD);
|
||||
|
||||
Log.Debug(string.Format("{0}() - --- TEST --- ProcessStartUpPrms", ProcessStartUpPrms));
|
||||
|
||||
//// We need to resolve the window here
|
||||
//ResolverDispatch resolver = new Resolver.ResolverDispatch();
|
||||
//ArtifactGroup artifacts = resolver.GetArtifacts((IntPtr)hWnd);
|
||||
|
||||
//// If we can resolve this window then we want to be checking
|
||||
//if (artifacts.Length >= 1)
|
||||
//{
|
||||
// Artifact curArtifact = artifacts.GetPrimary;
|
||||
// bool bFound = SrvrCommon.IsArtifactInCurrentWorkspace(curArtifact);
|
||||
|
||||
// if (bFound)
|
||||
// m_ButtonState = BHInteracter.SetW32ButtonToNewState(m_hWndParent, BHInteracter.BUTTON_HOOK_STATE.BUTTON_DELETE);
|
||||
// else
|
||||
// m_ButtonState = BHInteracter.SetW32ButtonToNewState(m_hWndParent, BHInteracter.BUTTON_HOOK_STATE.BUTTON_ADD);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Log.Error(string.Format("{0}() - WPForm could not resolve this Window - disabling the Caption Button", MethodBase.GetCurrentMethod().Name));
|
||||
// m_ButtonState = BHInteracter.SetW32ButtonToNewState(m_hWndParent, BHInteracter.BUTTON_HOOK_STATE.BUTTON_NONE);
|
||||
//}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Error(string.Format("{0}() - WPForm could not resolve this Window - disabling the Caption Button", MethodBase.GetCurrentMethod().Name), e);
|
||||
}
|
||||
}
|
||||
|
||||
public void hWndLastDeactivate(int pid, IntPtr hWnd)
|
||||
{
|
||||
Log.Debug(string.Format("{0}() - Debug - hWndLastDeactivate is called for {0} and {1}", pid, hWnd));
|
||||
}
|
||||
|
||||
public void DragNDropOccured(int pid, IntPtr hWnd, int nFiles, string SemiColonSepFileNames)
|
||||
{
|
||||
Log.Debug(string.Format("{0}() - Debug - DragNDropOccured is called with {0} and {1} and {2}", pid, hWnd, nFiles, SemiColonSepFileNames));
|
||||
}
|
||||
|
||||
public void OpenOrSaveFileDialogOccured(int pid, IntPtr hWnd, string possibleLocAndFileName, string FileTypes)
|
||||
{
|
||||
Log.Debug(string.Format("{0}() - Debug - DragNDropOccured is called with {0} and {1} and {2}", pid, hWnd, possibleLocAndFileName, FileTypes));
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
131
Client Services/ButtonWPForm/CaptionButtonStarter.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 Foo.Platform.Interacters;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
/// <summary>
|
||||
/// This class manages the creation/deletion of a Oogy CaptionButton Instance Exe.
|
||||
/// A CaptionButton Instance hosts the ButtonHook.dll
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
internal class CaptionButtonStarter
|
||||
{
|
||||
|
||||
// CaptionButton (ButtonHook.dll) Startup Delay
|
||||
private const int CAPTIONBUTTON_STARTUP_DELAY_MILISECONDS = 4000;
|
||||
|
||||
// Member Variables
|
||||
private static Thread s_ButtonHookKeepAliveThread = null;
|
||||
private static bool s_ButtonHookKeepAliveThreadIsInitialized = false;
|
||||
|
||||
// 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 CaptionButtonStarter()
|
||||
{
|
||||
StartButtonHookKeepAliveThreadIfNeeded();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this property to set the CaptionButton to running / not running
|
||||
/// </summary>
|
||||
public static bool Run
|
||||
{
|
||||
get { return s_ButtonHookKeepAliveThreadIsInitialized; }
|
||||
set
|
||||
{
|
||||
if (!value)
|
||||
TerminateButtonHookKeepAliveThreadIfNeeded();
|
||||
|
||||
s_ButtonHookKeepAliveThreadIsInitialized = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ButtonHookKeepAliveThread Thread for ButtonHook.dll - handled internally
|
||||
/// </summary>
|
||||
private static void ButtonHookKeepAliveThreadProc()
|
||||
{
|
||||
Thread.Sleep(CAPTIONBUTTON_STARTUP_DELAY_MILISECONDS);
|
||||
while (true) // Make Sure ButtonHook stays alive (No User kills it for any reason)
|
||||
{
|
||||
if (!BHInteracter.IsCaptionButtonRunning())
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ButtonHookKeepAliveThread - About to call StartCaptionButton()", MethodBase.GetCurrentMethod().Name));
|
||||
|
||||
// Launch OogyCaptionButton Process EXE
|
||||
BHInteracter.StartCaptionButton();
|
||||
|
||||
// wait a little before checking again...
|
||||
Thread.Sleep(100);
|
||||
|
||||
if (BHInteracter.IsCaptionButtonRunning())
|
||||
Log.Info(string.Format("{0}() - StartCaptionButton() Succeeded", MethodBase.GetCurrentMethod().Name));
|
||||
else
|
||||
Log.Error(string.Format("{0}() - StartCaptionButton() Failed", MethodBase.GetCurrentMethod().Name));
|
||||
}
|
||||
|
||||
if (!s_ButtonHookKeepAliveThreadIsInitialized)
|
||||
{
|
||||
s_ButtonHookKeepAliveThreadIsInitialized = true;
|
||||
Log.Info(string.Format("{0}() - ButtonWPForm ButtonHookKeepAliveThread is initialized s_ButtonHookKeepAliveThreadIsInitialized is True", MethodBase.GetCurrentMethod().Name));
|
||||
}
|
||||
|
||||
// Checking every 30 seconds (quickly) should be more than enough
|
||||
Thread.Sleep(30000);
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 StartButtonHookKeepAliveThreadIfNeeded()
|
||||
{
|
||||
if (s_ButtonHookKeepAliveThread != null && s_ButtonHookKeepAliveThread.IsAlive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
s_ButtonHookKeepAliveThreadIsInitialized = false;
|
||||
|
||||
// Start a new Thread so it can become the Message Loop
|
||||
s_ButtonHookKeepAliveThread = new Thread(new ThreadStart(CaptionButtonStarter.ButtonHookKeepAliveThreadProc));
|
||||
|
||||
// GUI components require the thread to be STA; otherwise throws an error
|
||||
s_ButtonHookKeepAliveThread.SetApartmentState(ApartmentState.STA);
|
||||
s_ButtonHookKeepAliveThread.Start();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Terminate the ButtonHook.dll by killing the Process
|
||||
/// </summary>
|
||||
private static void TerminateButtonHookKeepAliveThreadIfNeeded()
|
||||
{
|
||||
if (s_ButtonHookKeepAliveThreadIsInitialized)
|
||||
{
|
||||
s_ButtonHookKeepAliveThread.Abort();
|
||||
s_ButtonHookKeepAliveThreadIsInitialized = false;
|
||||
Log.Info(string.Format("{0}() - ButtonWPForm is ButtonHookKeepAliveThread shutdown s_ButtonHookKeepAliveThreadIsInitialized is False", MethodBase.GetCurrentMethod().Name));
|
||||
|
||||
// Kill the OogyCaptionButton Process EXE
|
||||
BHInteracter.StopCaptionButton();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
90
Client Services/ButtonWPForm/ComponentState.cs
Normal file
@@ -0,0 +1,90 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
|
||||
// Ooganizer Namespaces
|
||||
using Foo.Platform;
|
||||
using Foo.DataAccessLayer;
|
||||
using Foo.DataAccessLayer.DataTypes;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
/// <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}() - ButtonWPFormCCW 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 Dispatcher Thread
|
||||
Log.Info(string.Format("{0}() - ButtonWPFormCCW ComponentState() called. Activating DispatcherThread", MethodBase.GetCurrentMethod().Name));
|
||||
DispatcherThread.Run = true;
|
||||
|
||||
// Start ButtonHookKeepAlive Thread
|
||||
if (!DebugSpec.SkipCaptionButtonStarter)
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ButtonWPFormCCW ComponentState() called. Calling CaptionButtonStarter", MethodBase.GetCurrentMethod().Name));
|
||||
CaptionButtonStarter.Run = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ButtonWPFormCCW ComponentState() called. Skipping CaptionButtonStarter due to DebugSpec Settings", MethodBase.GetCurrentMethod().Name));
|
||||
}
|
||||
}
|
||||
|
||||
/// <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;
|
||||
CaptionButtonStarter.Run = false;
|
||||
}
|
||||
|
||||
s_bApplicationIsRunning = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Use this to access the ButtonFormMgr Object in order to
|
||||
/// communicate to ButtonForms (Setter should only be called by
|
||||
/// DispatcherThread)
|
||||
/// </summary>
|
||||
public static ButtonFormMgr ButtonFormMgr
|
||||
{
|
||||
get { return DispatcherThread.s_ButtonFormMgr; }
|
||||
}
|
||||
}
|
||||
}
|
||||
131
Client Services/ButtonWPForm/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.ButtonWPForm
|
||||
{
|
||||
/// <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 ButtonFormMgr s_ButtonFormMgr = 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 ButtonForm
|
||||
/// </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 ButtonFormMgr via DispatcherThread", MethodBase.GetCurrentMethod().Name));
|
||||
s_ButtonFormMgr = new ButtonFormMgr(Dispatcher.CurrentDispatcher);
|
||||
|
||||
Log.Info(string.Format("{0}() - ButtonWPForm 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_ButtonFormMgr != null)
|
||||
{
|
||||
Log.Info(string.Format("{0}() - ButtonFormMgr Launched via DispatcherThread", MethodBase.GetCurrentMethod().Name));
|
||||
|
||||
//Enter Dispatcher Message Loop
|
||||
System.Windows.Threading.Dispatcher.Run();
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Error(string.Format("{0}() - ButtonFormMgr 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 ButtonFormMgr and all ButtonForms from this thread
|
||||
s_ButtonFormMgr.TerminateDISP();
|
||||
s_ButtonFormMgr = null;
|
||||
|
||||
s_DispatcherThread.Abort();
|
||||
s_DispatcherThreadIsInitialized = false;
|
||||
Log.Info(string.Format("{0}() - ButtonWPForm is DispatcherThread shutdown s_DispatcherThreadIsInitialized is False", MethodBase.GetCurrentMethod().Name));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
34
Client Services/ButtonWPForm/IButtonForm.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Button Hook uses the IButtonForm Interface to call into ButtonFormCCW.
|
||||
/// This allows ButtonHook to communicate to us the state ButtonFormCCW should take.
|
||||
/// ButtonForm will handle the methods/Events below and respond as needed.
|
||||
/// ~We use the hParentWND to track which ButtonForm Instance we are talking with
|
||||
/// (this is why all calls below have it in the method call ~it works better that way in COM+)
|
||||
/// </summary>
|
||||
[Guid("2CF9E641-57B7-436f-80E1-EF3127CB5C0A")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
[ComVisible(true)]
|
||||
public interface IButtonForm
|
||||
{
|
||||
// Custom Events
|
||||
int W32BUTTONCLICKED();
|
||||
|
||||
// Called when ButtonHook activates/deactivates the COM Object
|
||||
void WPFThreadProc_ButtonWPForm_Activated(int hParentWND, int hButtonWND);
|
||||
void WPFThreadProc_ButtonWPForm_Deactivated();
|
||||
|
||||
// Hooked Window Events
|
||||
void WindowEvent_MaximizeOccured(int nHeight, int nWidth);
|
||||
void WindowEvent_MinimizeOccured();
|
||||
void WindowEvent_WindowActivated();
|
||||
void WindowEvent_WindowDeactivated();
|
||||
}
|
||||
}
|
||||
18
Client Services/ButtonWPForm/IButtonFormPage.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
/// <summary>
|
||||
/// This interface defines the communication from ButtonForm to
|
||||
/// it's ButtonFormPage Client
|
||||
/// </summary>
|
||||
[ComVisible(false)]
|
||||
public interface IButtonFormPage
|
||||
{
|
||||
ButtonForm ParentWPFContainer { get; set; }
|
||||
}
|
||||
}
|
||||
31
Client Services/ButtonWPForm/IClientEvents.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Foo.ClientServices.ButtonWPForm
|
||||
{
|
||||
/// <summary>
|
||||
/// Button Hook uses the IClientEvents Interface to let us know of certain events
|
||||
/// which may require us to re-resolve the Window.
|
||||
/// ~This is an important feature we need to do be accurate with all our artifacts.
|
||||
/// We are piggy-backing on ButtonWPForm in order to have less components
|
||||
/// </summary>
|
||||
[Guid("F1AF5CAD-B9AB-4a20-80F1-EB68C577ABC4")]
|
||||
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
|
||||
[ComVisible(true)]
|
||||
public interface IClientEvents
|
||||
{
|
||||
// An Event occured that could potentially have made artifact changes
|
||||
void ReResolve(int pid, IntPtr hWnd);
|
||||
|
||||
// First and Last Activation Events
|
||||
void hWndInitialActivate(int pid, IntPtr hWnd, string ProcessStartUpPrms);
|
||||
void hWndLastDeactivate(int pid, IntPtr hWnd);
|
||||
|
||||
// User File Events
|
||||
void DragNDropOccured(int pid, IntPtr hWnd, int nFiles, string SemiColonSepFileNames);
|
||||
void OpenOrSaveFileDialogOccured(int pid, IntPtr hWnd, string possibleLocAndFileName, string FileTypes);
|
||||
}
|
||||
}
|
||||
BIN
Client Services/ButtonWPForm/MyKeyFile.SNK
Normal file
62
Client Services/ButtonWPForm/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
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("ButtonWPForm")]
|
||||
[assembly: AssemblyDescription("Performance Caching for ButtonWPForm")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ooganizer Corporation")]
|
||||
[assembly: AssemblyProduct("ButtonWPForm")]
|
||||
[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/ButtonWPForm/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.ButtonWPForm.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.ButtonWPForm.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Client Services/ButtonWPForm/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
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">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</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="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<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>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
Client Services/ButtonWPForm/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.ButtonWPForm.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
8
Client Services/GUIDebugStepExe/App.xaml
Normal file
@@ -0,0 +1,8 @@
|
||||
<Application x:Class="Foo.ClientServices.GUIDebugStepExe.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
StartupUri="GUIDebugStepTestForm.xaml">
|
||||
<Application.Resources>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
16
Client Services/GUIDebugStepExe/App.xaml.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
|
||||
namespace Foo.ClientServices.GUIDebugStepExe
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
}
|
||||
}
|
||||
112
Client Services/GUIDebugStepExe/GUIDebugStepExe.csproj
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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>{4C81A790-31CA-4A71-99AD-339D3837A5C6}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Foo.ClientServices.GUIDebugStepExe</RootNamespace>
|
||||
<AssemblyName>GUIDebugStepExe</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</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="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<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="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="GUIDebugStepTestForm.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="GUIDebugStepTestForm.xaml.cs">
|
||||
<DependentUpon>GUIDebugStepTestForm.xaml</DependentUpon>
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<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>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ButtonWPForm\ButtonWPForm.csproj">
|
||||
<Project>{E179DF39-539A-407F-94DE-C21F690E02C4}</Project>
|
||||
<Name>ButtonWPForm</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\GUIWPForms\GUIWPForms.csproj">
|
||||
<Project>{A02E052C-3C52-43DB-BB30-A47446B8165F}</Project>
|
||||
<Name>GUIWPForms</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
22
Client Services/GUIDebugStepExe/GUIDebugStepTestForm.xaml
Normal file
@@ -0,0 +1,22 @@
|
||||
<Window x:Class="Foo.ClientServices.GUIDebugStepExe.GUIDebugStepTestForm"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Loaded="wvGUIDebugStepTestForm_Loaded" Closed="wvGUIDebugStepTestForm_Closed"
|
||||
Title="GUIDebugStepTestForm" Height="382" Width="223" Name="wvGUIDebugStepTestForm" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow">
|
||||
<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="23" Margin="37,83,39,0" Name="btnLaunchArtifactWall" VerticalAlignment="Top" Click="btnLaunchArtifactWall_Click">ArtifactWall</Button>
|
||||
<Button Margin="37,124,39,0" Name="btnWorkspaceSelector" Height="23" VerticalAlignment="Top" Click="btnWorkspaceSelector_Click">WorkspaceSelector</Button>
|
||||
<Button Margin="37,165,39,0" Name="btnSettingsNMain" Height="23" VerticalAlignment="Top" Click="btnSettingsNMain_Click">MainNSettings</Button>
|
||||
<Label Height="55" Margin="12,12,12,0" Name="lblGuiRemote" VerticalAlignment="Top" Foreground="White" FontSize="14" Focusable="True" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" BorderThickness="1" BorderBrush="White">GUIDebugStep Remote</Label>
|
||||
<Button Margin="37,206,39,0" Name="btnButtonForm" Height="23" VerticalAlignment="Top" Click="btnButtonForm_Click">ButtonForm</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
77
Client Services/GUIDebugStepExe/GUIDebugStepTestForm.xaml.cs
Normal file
@@ -0,0 +1,77 @@
|
||||
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;
|
||||
|
||||
// Foo Namespaces
|
||||
using Foo.ClientServices.ButtonWPForm;
|
||||
using Foo.ClientServices.GUIWPForms;
|
||||
|
||||
namespace Foo.ClientServices.GUIDebugStepExe
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for Window1.xaml
|
||||
/// </summary>
|
||||
public partial class GUIDebugStepTestForm : Window
|
||||
{
|
||||
|
||||
// Private Members
|
||||
GUIWPForms.GUIWPForms m_Gui = null;
|
||||
ButtonWPForm.ButtonWPFormCCW m_ButtonForm = null;
|
||||
|
||||
public GUIDebugStepTestForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void btnLaunchArtifactWall_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m_Gui.LaunchArtifactWall(IntPtr.Zero);
|
||||
}
|
||||
|
||||
private void btnWorkspaceSelector_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m_Gui.LaunchWorkspaceSelector(IntPtr.Zero);
|
||||
}
|
||||
|
||||
private void btnSettingsNMain_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
m_Gui.LaunchSettingsNAboutUs(IntPtr.Zero);
|
||||
}
|
||||
|
||||
private void btnButtonForm_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void wvGUIDebugStepTestForm_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// Instantiate the objects
|
||||
m_Gui = new GUIWPForms.GUIWPForms();
|
||||
//m_ButtonForm = new ButtonWPForm.ButtonWPFormCCW();
|
||||
|
||||
// instantiate any dependent threads, etc
|
||||
m_Gui.Start();
|
||||
//m_ButtonForm.Start();
|
||||
}
|
||||
|
||||
private void wvGUIDebugStepTestForm_Closed(object sender, EventArgs e)
|
||||
{
|
||||
// close any dependent threads
|
||||
m_Gui.Stop();
|
||||
//m_ButtonForm.Stop();
|
||||
|
||||
// delete objects
|
||||
m_Gui = null;
|
||||
//m_ButtonForm = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
55
Client Services/GUIDebugStepExe/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// 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("GUIDebugStepExe")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("GUIDebugStepExe")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2010")]
|
||||
[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(false)]
|
||||
|
||||
//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/GUIDebugStepExe/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.GUIDebugStepExe.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.GUIDebugStepExe.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
117
Client Services/GUIDebugStepExe/Properties/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
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">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</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="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<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>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
26
Client Services/GUIDebugStepExe/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.GUIDebugStepExe.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
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
|
||||