Updates to DropDownPanel, Baseline, & Controls
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@@ -15,7 +14,7 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private IDropDownAware _dropDownControl = null;
|
private IDropDownAware _dropDownControl = null;
|
||||||
private DropDownWindowHelper _dropDownHelper = null;
|
private readonly DropDownWindowHelper _dropDownHelper = null;
|
||||||
private Form _owner = null;
|
private Form _owner = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
@@ -47,7 +46,7 @@ namespace AT.STO.UI.Win
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
protected override void OnHandleCreated(EventArgs e)
|
protected override void OnHandleCreated(EventArgs e)
|
||||||
{
|
{
|
||||||
_owner = this.FindForm();
|
_owner = FindForm();
|
||||||
_dropDownHelper.ReleaseHandle();
|
_dropDownHelper.ReleaseHandle();
|
||||||
|
|
||||||
if (_owner != null)
|
if (_owner != null)
|
||||||
@@ -66,8 +65,8 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
base.OnResize(e);
|
base.OnResize(e);
|
||||||
combo.Location = new Point(0, 0);
|
combo.Location = new Point(0, 0);
|
||||||
combo.Width = this.ClientRectangle.Width;
|
combo.Width = ClientRectangle.Width;
|
||||||
this.Height = combo.Height;
|
Height = combo.Height;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Handler
|
#region Event Handler
|
||||||
@@ -96,7 +95,7 @@ namespace AT.STO.UI.Win
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dropDownHelper.CloseDropDown();
|
_dropDownHelper.CloseDropDown();
|
||||||
this.Focus();
|
Focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +114,7 @@ namespace AT.STO.UI.Win
|
|||||||
|
|
||||||
private void DropDownHelper_DropDownCancel(object sender, DropDownCancelEventArgs e)
|
private void DropDownHelper_DropDownCancel(object sender, DropDownCancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.Bounds.Contains(Parent.PointToClient(e.CursorLocation)))
|
if (Bounds.Contains(Parent.PointToClient(e.CursorLocation)))
|
||||||
{
|
{
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
}
|
}
|
||||||
@@ -138,23 +137,14 @@ namespace AT.STO.UI.Win
|
|||||||
SetValue<long>(e.Value as ILookupItem<long>);
|
SetValue<long>(e.Value as ILookupItem<long>);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.FinishEditing != null)
|
FinishEditing?.Invoke(this, e);
|
||||||
{
|
|
||||||
this.FinishEditing(this, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
_dropDownControl.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing);
|
_dropDownControl.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing);
|
||||||
_dropDownControl.ValueChanged -= new DropDownValueChangedEventHandler(DropDown_ValueChanged);
|
_dropDownControl.ValueChanged -= new DropDownValueChangedEventHandler(DropDown_ValueChanged);
|
||||||
_dropDownHelper.CloseDropDown();
|
_dropDownHelper.CloseDropDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DropDown_ValueChanged(object sender, DropDownValueChangedEventArgs e)
|
private void DropDown_ValueChanged(object sender, DropDownValueChangedEventArgs e) => ValueChanged?.Invoke(this, e);
|
||||||
{
|
|
||||||
if (this.ValueChanged != null)
|
|
||||||
{
|
|
||||||
this.ValueChanged(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -169,15 +159,12 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
_dropDownControl = value;
|
_dropDownControl = value;
|
||||||
|
|
||||||
this.Controls.Add(_dropDownControl as Control);
|
Controls.Add(_dropDownControl as Control);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Methods
|
#region Public Methods
|
||||||
public override string ToString()
|
public override string ToString() => Name;
|
||||||
{
|
|
||||||
return this.Name;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -36,9 +36,8 @@ namespace AT.STO.UI.Win
|
|||||||
public class DropDownCancelEventArgs : EventArgs
|
public class DropDownCancelEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private bool _cancel = false;
|
|
||||||
private Point _cursorLocation;
|
private Point _cursorLocation;
|
||||||
private Form _dropDown = null;
|
private readonly Form _dropDown = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -51,34 +50,24 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
_dropDown = DropDown;
|
_dropDown = DropDown;
|
||||||
_cursorLocation = CursorLocation;
|
_cursorLocation = CursorLocation;
|
||||||
_cancel = false;
|
Cancel = false;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool Cancel
|
public bool Cancel { get; set; } = false;
|
||||||
{
|
|
||||||
get { return _cancel; }
|
|
||||||
set { _cancel = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Point CursorLocation
|
public Point CursorLocation => _cursorLocation;
|
||||||
{
|
|
||||||
get { return _cursorLocation; }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Form DropDown
|
public Form DropDown => _dropDown;
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,7 +80,7 @@ namespace AT.STO.UI.Win
|
|||||||
public class DropDownClosedEventArgs : EventArgs
|
public class DropDownClosedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private Form _dropDown = null;
|
private readonly Form _dropDown = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -99,19 +88,13 @@ namespace AT.STO.UI.Win
|
|||||||
/// popup form.
|
/// popup form.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="DropDown">DropDown Form which is being closed.</param>
|
/// <param name="DropDown">DropDown Form which is being closed.</param>
|
||||||
public DropDownClosedEventArgs(Form DropDown)
|
public DropDownClosedEventArgs(Form DropDown) => _dropDown = DropDown;
|
||||||
{
|
|
||||||
_dropDown = DropDown;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the dropdown form which is being closed.
|
/// Gets the dropdown form which is being closed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Form DropDown
|
public Form DropDown => _dropDown;
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +104,6 @@ namespace AT.STO.UI.Win
|
|||||||
public class DropDownValueChangedEventArgs : EventArgs
|
public class DropDownValueChangedEventArgs : EventArgs
|
||||||
{
|
{
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private object _value = null;
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -135,20 +117,13 @@ namespace AT.STO.UI.Win
|
|||||||
/// Initialization with the control's value.
|
/// Initialization with the control's value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Value"></param>
|
/// <param name="Value"></param>
|
||||||
public DropDownValueChangedEventArgs(object Value)
|
public DropDownValueChangedEventArgs(object Value) => this.Value = Value;
|
||||||
{
|
|
||||||
_value = Value;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the control's value.
|
/// Gets or sets the control's value.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public object Value
|
public object Value { get; set; } = null;
|
||||||
{
|
|
||||||
get { return _value; }
|
|
||||||
set { _value = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,16 +13,13 @@ namespace AT.STO.UI.Win
|
|||||||
internal partial class DropDownForm : Form, IDropDownAware
|
internal partial class DropDownForm : Form, IDropDownAware
|
||||||
{
|
{
|
||||||
#region Private Variable Declaration
|
#region Private Variable Declaration
|
||||||
private IDropDownAware _control = null;
|
private readonly IDropDownAware _control = null;
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructor / Destructor
|
#region Constructor / Destructor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default Constructor
|
/// Default Constructor
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public DropDownForm()
|
public DropDownForm() => InitializeComponent();
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor to initialize the for with the control to display.
|
/// Constructor to initialize the for with the control to display.
|
||||||
@@ -41,7 +38,7 @@ namespace AT.STO.UI.Win
|
|||||||
#region Form Events
|
#region Form Events
|
||||||
protected override void OnClosing(CancelEventArgs e)
|
protected override void OnClosing(CancelEventArgs e)
|
||||||
{
|
{
|
||||||
this.Controls.Remove(_control as Control);
|
Controls.Remove(_control as Control);
|
||||||
base.OnClosing(e);
|
base.OnClosing(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,22 +55,13 @@ namespace AT.STO.UI.Win
|
|||||||
#region Event Handler
|
#region Event Handler
|
||||||
private void Ctrl_FinishEditing(object sender, DropDownValueChangedEventArgs e)
|
private void Ctrl_FinishEditing(object sender, DropDownValueChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.FinishEditing != null)
|
FinishEditing?.Invoke(this, e);
|
||||||
{
|
|
||||||
this.FinishEditing(this, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
_control.FinishEditing -= new DropDownValueChangedEventHandler(Ctrl_FinishEditing);
|
_control.FinishEditing -= new DropDownValueChangedEventHandler(Ctrl_FinishEditing);
|
||||||
_control.ValueChanged -= new DropDownValueChangedEventHandler(Ctrl_ValueChanged);
|
_control.ValueChanged -= new DropDownValueChangedEventHandler(Ctrl_ValueChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Ctrl_ValueChanged(object sender, DropDownValueChangedEventArgs e)
|
private void Ctrl_ValueChanged(object sender, DropDownValueChangedEventArgs e) => ValueChanged?.Invoke(this, e);
|
||||||
{
|
|
||||||
if (this.ValueChanged != null)
|
|
||||||
{
|
|
||||||
this.ValueChanged(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region IDropDownAware Implementation
|
#region IDropDownAware Implementation
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -100,15 +88,15 @@ namespace AT.STO.UI.Win
|
|||||||
private void InitializeControl(Control Ctrl)
|
private void InitializeControl(Control Ctrl)
|
||||||
{
|
{
|
||||||
Size size = Ctrl.Size;
|
Size size = Ctrl.Size;
|
||||||
Size inner = this.ClientRectangle.Size;
|
Size inner = ClientRectangle.Size;
|
||||||
Size outer = this.Size;
|
Size outer = Size;
|
||||||
int gap = outer.Width - inner.Width;
|
int gap = outer.Width - inner.Width;
|
||||||
|
|
||||||
size.Width += gap;
|
size.Width += gap;
|
||||||
size.Height += gap;
|
size.Height += gap;
|
||||||
|
|
||||||
this.Size = size;
|
Size = size;
|
||||||
this.Controls.Add(Ctrl);
|
Controls.Add(Ctrl);
|
||||||
Ctrl.Location = new Point(0, 0);
|
Ctrl.Location = new Point(0, 0);
|
||||||
Ctrl.Visible = true;
|
Ctrl.Visible = true;
|
||||||
Ctrl.Invalidate();
|
Ctrl.Invalidate();
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
@@ -23,8 +22,7 @@ namespace AT.STO.UI.Win
|
|||||||
private const int WM_NCMBUTTONDOWN = 0x0A7;
|
private const int WM_NCMBUTTONDOWN = 0x0A7;
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Variable Declarations
|
#region Private Variable Declarations
|
||||||
private Form _dropDown = null;
|
private readonly DropDownWindowHelper _owner = null;
|
||||||
private DropDownWindowHelper _owner = null;
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Declarations
|
#region Event Declarations
|
||||||
public event DropDownCancelEventHandler DropDownCancel;
|
public event DropDownCancelEventHandler DropDownCancel;
|
||||||
@@ -36,44 +34,34 @@ namespace AT.STO.UI.Win
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="Owner">The <see cref="DropDownWindowHelper"/> object
|
/// <param name="Owner">The <see cref="DropDownWindowHelper"/> object
|
||||||
/// which owns this class.</param>
|
/// which owns this class.</param>
|
||||||
public DropDownMessageFilter(DropDownWindowHelper Owner)
|
public DropDownMessageFilter(DropDownWindowHelper Owner) => _owner = Owner;
|
||||||
{
|
|
||||||
_owner = Owner;
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Public Properties
|
#region Public Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets/sets the dropdown form which is being displayed.
|
/// Gets/sets the dropdown form which is being displayed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public Form DropDown
|
public Form DropDown { get; set; } = null;
|
||||||
{
|
|
||||||
get { return _dropDown; }
|
|
||||||
set { _dropDown = value; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Private Methods
|
#region Private Methods
|
||||||
private void OnMouseDown()
|
private void OnMouseDown()
|
||||||
{
|
{
|
||||||
Point cursorPos = Cursor.Position; // Get the cursor location
|
Point cursorPos = Cursor.Position; // Get the cursor location
|
||||||
|
|
||||||
if (!_dropDown.Bounds.Contains(cursorPos)) // Check if it is within the popup form
|
if (!DropDown.Bounds.Contains(cursorPos)) // Check if it is within the popup form
|
||||||
{
|
{
|
||||||
OnDropDownCancel(new DropDownCancelEventArgs(_dropDown, cursorPos)); // If not, then call to see if it should be closed
|
OnDropDownCancel(new DropDownCancelEventArgs(DropDown, cursorPos)); // If not, then call to see if it should be closed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region DropDownCancelEvent Implementation
|
#region DropDownCancelEvent Implementation
|
||||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DropDownCancel != null)
|
DropDownCancel?.Invoke(this, e);
|
||||||
{
|
|
||||||
this.DropDownCancel(this, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!e.Cancel)
|
if (!e.Cancel)
|
||||||
{
|
{
|
||||||
_owner.CloseDropDown();
|
_owner.CloseDropDown();
|
||||||
_dropDown = null; // Clear reference for GC
|
DropDown = null; // Clear reference for GC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -90,7 +78,7 @@ namespace AT.STO.UI.Win
|
|||||||
/// This implementation always returns <c>false</c>.</returns>
|
/// This implementation always returns <c>false</c>.</returns>
|
||||||
public bool PreFilterMessage(ref Message m)
|
public bool PreFilterMessage(ref Message m)
|
||||||
{
|
{
|
||||||
if (_dropDown != null)
|
if (DropDown != null)
|
||||||
{
|
{
|
||||||
switch (m.Msg)
|
switch (m.Msg)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace AT.STO.UI.Win
|
namespace AT.STO.UI.Win
|
||||||
@@ -22,7 +21,7 @@ namespace AT.STO.UI.Win
|
|||||||
|
|
||||||
private Form _dropDown = null;
|
private Form _dropDown = null;
|
||||||
private bool _dropDownShowing = false;
|
private bool _dropDownShowing = false;
|
||||||
private DropDownMessageFilter _filter = null;
|
private readonly DropDownMessageFilter _filter = null;
|
||||||
private Form _owner = null;
|
private Form _owner = null;
|
||||||
private bool _skipClose = false;
|
private bool _skipClose = false;
|
||||||
#endregion
|
#endregion
|
||||||
@@ -44,10 +43,7 @@ namespace AT.STO.UI.Win
|
|||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Handler
|
#region Event Handler
|
||||||
private void Popup_Cancel(object sender, DropDownCancelEventArgs e)
|
private void Popup_Cancel(object sender, DropDownCancelEventArgs e) => OnDropDownCancel(e);
|
||||||
{
|
|
||||||
OnDropDownCancel(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Responds to the <see cref="System.Windows.Forms.Form.Closed"/>
|
/// Responds to the <see cref="System.Windows.Forms.Form.Closed"/>
|
||||||
@@ -55,10 +51,7 @@ namespace AT.STO.UI.Win
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="sender">Popup form that has been closed.</param>
|
/// <param name="sender">Popup form that has been closed.</param>
|
||||||
/// <param name="e">Not used.</param>
|
/// <param name="e">Not used.</param>
|
||||||
private void Popup_Closed(object sender, EventArgs e)
|
private void Popup_Closed(object sender, EventArgs e) => CloseDropDown();
|
||||||
{
|
|
||||||
CloseDropDown();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Subclasses the owning form's existing Window Procedure to enables the
|
/// Subclasses the owning form's existing Window Procedure to enables the
|
||||||
@@ -76,7 +69,7 @@ namespace AT.STO.UI.Win
|
|||||||
{
|
{
|
||||||
if (((int)m.WParam) == 0) // Check if the title bar will made inactive:
|
if (((int)m.WParam) == 0) // Check if the title bar will made inactive:
|
||||||
{ // Note it's no good to try and consume this message; if you try to do that you'll end up with windows
|
{ // Note it's no good to try and consume this message; if you try to do that you'll end up with windows
|
||||||
UIApiCalls.SendMessage(this.Handle, UIApiCalls.WM_NCACTIVATE, 1, IntPtr.Zero); // If so reactivate it.
|
UIApiCalls.SendMessage(Handle, UIApiCalls.WM_NCACTIVATE, 1, IntPtr.Zero); // If so reactivate it.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m.Msg == UIApiCalls.WM_ACTIVATEAPP)
|
else if (m.Msg == UIApiCalls.WM_ACTIVATEAPP)
|
||||||
@@ -84,7 +77,7 @@ namespace AT.STO.UI.Win
|
|||||||
if ((int)m.WParam == 0) // Check if the application is being deactivated.
|
if ((int)m.WParam == 0) // Check if the application is being deactivated.
|
||||||
{
|
{
|
||||||
CloseDropDown(); // It is so cancel the popup:
|
CloseDropDown(); // It is so cancel the popup:
|
||||||
UIApiCalls.PostMessage(this.Handle, UIApiCalls.WM_NCACTIVATE, 0, IntPtr.Zero); // And put the title bar into the inactive state:
|
UIApiCalls.PostMessage(Handle, UIApiCalls.WM_NCACTIVATE, 0, IntPtr.Zero); // And put the title bar into the inactive state:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,17 +166,14 @@ namespace AT.STO.UI.Win
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Indicator weither the DropDown is showing.
|
/// Indicator weither the DropDown is showing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool DropDownShowing
|
public bool DropDownShowing => _dropDownShowing;
|
||||||
{
|
|
||||||
get { return _dropDownShowing; }
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Event Implementation
|
#region Event Implementation
|
||||||
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
protected virtual void OnDropDownCancel(DropDownCancelEventArgs e)
|
||||||
{
|
{
|
||||||
if (this.DropDownCancel != null)
|
if (DropDownCancel != null)
|
||||||
{
|
{
|
||||||
this.DropDownCancel(this, e);
|
DropDownCancel(this, e);
|
||||||
|
|
||||||
if (!e.Cancel)
|
if (!e.Cancel)
|
||||||
{
|
{
|
||||||
@@ -192,13 +182,7 @@ namespace AT.STO.UI.Win
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnPDropDownClosed(DropDownClosedEventArgs e)
|
protected virtual void OnPDropDownClosed(DropDownClosedEventArgs e) => DropDownClosed?.Invoke(this, e);
|
||||||
{
|
|
||||||
if (this.DropDownClosed != null)
|
|
||||||
{
|
|
||||||
this.DropDownClosed(this, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace AT.STO.UI.Win
|
namespace AT.STO.UI.Win
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
using System;
|
|
||||||
|
|
||||||
namespace AT.STO.UI.Win
|
namespace AT.STO.UI.Win
|
||||||
{
|
{
|
||||||
public interface ILookupItem<T> where T: struct
|
public interface ILookupItem<T> where T: struct
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public override void SetActive()
|
public override void SetActive()
|
||||||
{
|
{
|
||||||
this.BackColor = MyStepPanel.ActiveColor;
|
BackColor = MyStepPanel.ActiveColor;
|
||||||
}
|
}
|
||||||
public override void SetText()
|
public override void SetText()
|
||||||
{
|
{
|
||||||
@@ -231,7 +231,7 @@ namespace Volian.Controls.Library
|
|||||||
private int _origCfgHt = 0; // keep track if original size was stored in cfg
|
private int _origCfgHt = 0; // keep track if original size was stored in cfg
|
||||||
private int _origCfgWd = 0;
|
private int _origCfgWd = 0;
|
||||||
private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg)
|
private bool _pastedNew = false; // need this for flagging newly pasted image (may need to clear cfg)
|
||||||
private DisplayTags _displayTags = new DisplayTags();
|
private readonly DisplayTags _displayTags = new DisplayTags();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
#region Constructors
|
#region Constructors
|
||||||
@@ -281,8 +281,8 @@ namespace Volian.Controls.Library
|
|||||||
MyPictureBox.Width = wd;
|
MyPictureBox.Width = wd;
|
||||||
MyPictureBox.Height = ht;
|
MyPictureBox.Height = ht;
|
||||||
MyPictureBox.SizeMode = PictureBoxSizeMode.Zoom;
|
MyPictureBox.SizeMode = PictureBoxSizeMode.Zoom;
|
||||||
this.Width = MyPictureBox.Width + ImageMargin;
|
Width = MyPictureBox.Width + ImageMargin;
|
||||||
this.Height = MyPictureBox.Height + 10;
|
Height = MyPictureBox.Height + 10;
|
||||||
_newSizeWd = wd / (MyStepPanel.DPI / 72);
|
_newSizeWd = wd / (MyStepPanel.DPI / 72);
|
||||||
_newSizeHt = ht / (MyStepPanel.DPI / 72);
|
_newSizeHt = ht / (MyStepPanel.DPI / 72);
|
||||||
|
|
||||||
@@ -310,13 +310,10 @@ namespace Volian.Controls.Library
|
|||||||
MyPictureBox.Width = wd;
|
MyPictureBox.Width = wd;
|
||||||
MyPictureBox.Height = ht;
|
MyPictureBox.Height = ht;
|
||||||
MyPictureBox.SizeMode = PictureBoxSizeMode.Zoom; // as resize matches width/height.
|
MyPictureBox.SizeMode = PictureBoxSizeMode.Zoom; // as resize matches width/height.
|
||||||
this.Width = MyPictureBox.Width + ImageMargin;
|
Width = MyPictureBox.Width + ImageMargin;
|
||||||
this.Height = MyPictureBox.Height + 10;
|
Height = MyPictureBox.Height + 10;
|
||||||
if (_displayTags != null)
|
|
||||||
{
|
|
||||||
// Set the Height and Width on the step properties page for the new image
|
// Set the Height and Width on the step properties page for the new image
|
||||||
_displayTags.SetNewImageHeightAndWidth(ht, wd);
|
_displayTags?.SetNewImageHeightAndWidth(ht, wd);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -358,8 +355,8 @@ namespace Volian.Controls.Library
|
|||||||
InsType = insType;
|
InsType = insType;
|
||||||
FileName = null;
|
FileName = null;
|
||||||
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false);
|
SetupEditItem(itemInfo, myStepPanel, myParentEditItem, myChildRelation, expand, nextEditItem, false);
|
||||||
this.Width = 100 + ImageMargin;
|
Width = 100 + ImageMargin;
|
||||||
this.Height = 100;
|
Height = 100;
|
||||||
if (insType == ImageItem.E_ImageSource.File)
|
if (insType == ImageItem.E_ImageSource.File)
|
||||||
{
|
{
|
||||||
ImageFileDialog();
|
ImageFileDialog();
|
||||||
@@ -384,19 +381,20 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
AdjustTableWidthAndLocation();
|
AdjustTableWidthAndLocation();
|
||||||
this.Controls.Add(this._MyPictureBox);
|
Controls.Add(_MyPictureBox);
|
||||||
AddEventHandlers();
|
AddEventHandlers();
|
||||||
MyStepRTB.RemoveEventHandlers();
|
MyStepRTB.RemoveEventHandlers();
|
||||||
MyStepRTB.Visible = false;
|
MyStepRTB.Visible = false;
|
||||||
}
|
}
|
||||||
private void ImageFileDialog()
|
private void ImageFileDialog()
|
||||||
{
|
{
|
||||||
OpenFileDialog openFileDialog1 = new OpenFileDialog();
|
OpenFileDialog openFileDialog1 = new OpenFileDialog
|
||||||
|
{
|
||||||
openFileDialog1.InitialDirectory = "c:\\";
|
InitialDirectory = "c:\\",
|
||||||
openFileDialog1.Filter = "Image files (*.jpg;*.tif;*.bmp;*.png)|*.jpg;*.tif;*.bmp;*.png|All files (*.*)|*.*";
|
Filter = "Image files (*.jpg;*.tif;*.bmp;*.png)|*.jpg;*.tif;*.bmp;*.png|All files (*.*)|*.*",
|
||||||
openFileDialog1.FilterIndex = 0;
|
FilterIndex = 0,
|
||||||
openFileDialog1.RestoreDirectory = true;
|
RestoreDirectory = true
|
||||||
|
};
|
||||||
|
|
||||||
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
if (openFileDialog1.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
@@ -412,13 +410,14 @@ namespace Volian.Controls.Library
|
|||||||
_IsDirty = true;
|
_IsDirty = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
FlexibleMessageBox.Show("Could not create image, check file type.", "Error on Image File Selection");
|
FlexibleMessageBox.Show("Could not create image, check file type.", "Error on Image File Selection");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "Keeping img for potential future use")]
|
||||||
private static string GetImageFormatExtension(System.Drawing.Image img) => ("jpg"); // seems that this is the only one that works.
|
private static string GetImageFormatExtension(System.Drawing.Image img) => ("jpg"); // seems that this is the only one that works.
|
||||||
#endregion
|
#endregion
|
||||||
#region RO_Images
|
#region RO_Images
|
||||||
@@ -471,12 +470,10 @@ namespace Volian.Controls.Library
|
|||||||
if (val != null && val != "?")
|
if (val != null && val != "?")
|
||||||
{
|
{
|
||||||
string imgname = null;
|
string imgname = null;
|
||||||
int W = 0;
|
|
||||||
int H = 0;
|
|
||||||
string[] vals = val.Split("\n".ToCharArray());
|
string[] vals = val.Split("\n".ToCharArray());
|
||||||
W = (int)(Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) * MyItemInfo.FormatStepData.Font.CharsToTwips);
|
int W = (int)(Int32.Parse(vals[3], System.Globalization.NumberStyles.AllowHexSpecifier) * MyItemInfo.FormatStepData.Font.CharsToTwips);
|
||||||
int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier);
|
int lines = Int32.Parse(vals[2], System.Globalization.NumberStyles.AllowHexSpecifier);
|
||||||
H = lines * 12;
|
int H = lines * 12;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
imgname = vals[0];
|
imgname = vals[0];
|
||||||
@@ -492,9 +489,9 @@ namespace Volian.Controls.Library
|
|||||||
AddROImageToScreen(W, H, imageText);
|
AddROImageToScreen(W, H, imageText);
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
string msg = string.Format("Could not display image {0}.", imgname);
|
string msg = $"Could not display image {imgname}.";
|
||||||
FlexibleMessageBox.Show(msg);
|
FlexibleMessageBox.Show(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -511,8 +508,7 @@ namespace Volian.Controls.Library
|
|||||||
ProcedureInfo proc = MyItemInfo.MyProcedure;
|
ProcedureInfo proc = MyItemInfo.MyProcedure;
|
||||||
DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo;
|
DocVersionInfo dvi = proc.ActiveParent as DocVersionInfo;
|
||||||
ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst;
|
ROFstInfo rofst = dvi.DocVersionAssociations[0].MyROFst;
|
||||||
ROImageInfo roImageInfo = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]);
|
ROImageInfo roImageInfo = ROImageInfo.GetByROFstID_FileName(rofst.ROFstID, vals[0]) ?? rofst.GetROImageByFilename(vals[0], MyItemInfo);
|
||||||
if (roImageInfo == null) roImageInfo = rofst.GetROImageByFilename(vals[0], MyItemInfo);
|
|
||||||
if (roImageInfo != null)
|
if (roImageInfo != null)
|
||||||
{
|
{
|
||||||
System.Drawing.Image.GetThumbnailImageAbort myCallback =
|
System.Drawing.Image.GetThumbnailImageAbort myCallback =
|
||||||
@@ -526,7 +522,7 @@ namespace Volian.Controls.Library
|
|||||||
// if there is config data that saves the resize of the image, use it, otherwise use what was passed in:
|
// if there is config data that saves the resize of the image, use it, otherwise use what was passed in:
|
||||||
StepConfig sc = new StepConfig(MyItemInfo as StepInfo);
|
StepConfig sc = new StepConfig(MyItemInfo as StepInfo);
|
||||||
SizeF sizef = new Size(1, 1);
|
SizeF sizef = new Size(1, 1);
|
||||||
if (sc.Step_ImageHeight == null || sc.Step_ImageHeight == 0)
|
if (sc?.Step_ImageHeight == null || sc.Step_ImageHeight == 0)
|
||||||
{
|
{
|
||||||
sizef = new SizeF((img2.Width / img2.HorizontalResolution),
|
sizef = new SizeF((img2.Width / img2.HorizontalResolution),
|
||||||
(img2.Height / img2.VerticalResolution));
|
(img2.Height / img2.VerticalResolution));
|
||||||
@@ -555,16 +551,16 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
// Always be sure to add the same event handlers to RemoveEventHandlers
|
// Always be sure to add the same event handlers to RemoveEventHandlers
|
||||||
MyItemInfo.MyContent.Changed += new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed);
|
MyItemInfo.MyContent.Changed += new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed);
|
||||||
this.Enter += new System.EventHandler(ImageItem_Enter);
|
Enter += new System.EventHandler(ImageItem_Enter);
|
||||||
this.MyPictureBox.Enter += new System.EventHandler(ImageItem_Enter);
|
MyPictureBox.Enter += new System.EventHandler(ImageItem_Enter);
|
||||||
this.Click += new EventHandler(ImageItem_Click);
|
Click += new EventHandler(ImageItem_Click);
|
||||||
this.MyPictureBox.Click += new EventHandler(ImageItem_Click);
|
MyPictureBox.Click += new EventHandler(ImageItem_Click);
|
||||||
this.MyPictureBox.PreviewKeyDown += new PreviewKeyDownEventHandler(ImageItem_PreviewKeyDown); //note that PictureBox does not have cursorkey events
|
MyPictureBox.PreviewKeyDown += new PreviewKeyDownEventHandler(ImageItem_PreviewKeyDown); //note that PictureBox does not have cursorkey events
|
||||||
this.MyPictureBox.KeyDown += new KeyEventHandler(ImageItem_KeyDown);
|
MyPictureBox.KeyDown += new KeyEventHandler(ImageItem_KeyDown);
|
||||||
this.MyStepRTB.RoInsert += new StepRTBRoEvent(MyStepRTB_RoInsert);
|
MyStepRTB.RoInsert += new StepRTBRoEvent(MyStepRTB_RoInsert);
|
||||||
this.MyStepRTB.DoSaveContents += new StepRTBEvent(MyStepRTB_DoSaveContents); // for storing RO data
|
MyStepRTB.DoSaveContents += new StepRTBEvent(MyStepRTB_DoSaveContents); // for storing RO data
|
||||||
this.MyPictureBox.Resize += MyPictureBox_Resize;
|
MyPictureBox.Resize += MyPictureBox_Resize;
|
||||||
this.MyPictureBox.MouseDown += MyPictureBox_MouseDown;
|
MyPictureBox.MouseDown += MyPictureBox_MouseDown;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyPictureBox_MouseDown(object sender, MouseEventArgs e)
|
void MyPictureBox_MouseDown(object sender, MouseEventArgs e)
|
||||||
@@ -574,10 +570,10 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
void MyPictureBox_Resize(object sender, EventArgs e)
|
void MyPictureBox_Resize(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (this.Height != _MyPictureBox.Height + _MyPictureBox.Top + 7) // add in 7 to make it look good // + 10)
|
if (Height != _MyPictureBox.Height + _MyPictureBox.Top + 7) // add in 7 to make it look good // + 10)
|
||||||
{
|
{
|
||||||
LastMethodsPush(string.Format("MyPictureBox_Resize {0}", _MyPictureBox.Height));
|
LastMethodsPush(string.Format("MyPictureBox_Resize {0}", _MyPictureBox.Height));
|
||||||
this.Height = _MyPictureBox.Height + _MyPictureBox.Top + 7;
|
Height = _MyPictureBox.Height + _MyPictureBox.Top + 7;
|
||||||
LastMethodsPop();
|
LastMethodsPop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -585,16 +581,16 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
// Always be sure to add the same event handlers to RemoveEventHandlers
|
// Always be sure to add the same event handlers to RemoveEventHandlers
|
||||||
MyItemInfo.MyContent.Changed -= new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed);
|
MyItemInfo.MyContent.Changed -= new VEPROMS.CSLA.Library.ContentInfoEvent(MyContent_Changed);
|
||||||
this.Enter -= new System.EventHandler(ImageItem_Enter);
|
Enter -= new System.EventHandler(ImageItem_Enter);
|
||||||
this.MyPictureBox.Enter -= new System.EventHandler(ImageItem_Enter);
|
MyPictureBox.Enter -= new System.EventHandler(ImageItem_Enter);
|
||||||
this.Click -= new EventHandler(ImageItem_Click);
|
Click -= new EventHandler(ImageItem_Click);
|
||||||
this.MyPictureBox.Click -= new EventHandler(ImageItem_Click);
|
MyPictureBox.Click -= new EventHandler(ImageItem_Click);
|
||||||
this.MyPictureBox.PreviewKeyDown -= new PreviewKeyDownEventHandler(ImageItem_PreviewKeyDown);
|
MyPictureBox.PreviewKeyDown -= new PreviewKeyDownEventHandler(ImageItem_PreviewKeyDown);
|
||||||
this.MyPictureBox.KeyDown -= new KeyEventHandler(ImageItem_KeyDown);
|
MyPictureBox.KeyDown -= new KeyEventHandler(ImageItem_KeyDown);
|
||||||
this.MyStepRTB.RoInsert -= new StepRTBRoEvent(MyStepRTB_RoInsert);
|
MyStepRTB.RoInsert -= new StepRTBRoEvent(MyStepRTB_RoInsert);
|
||||||
this.MyStepRTB.DoSaveContents -= new StepRTBEvent(MyStepRTB_DoSaveContents);
|
MyStepRTB.DoSaveContents -= new StepRTBEvent(MyStepRTB_DoSaveContents);
|
||||||
this.MyPictureBox.Resize -= MyPictureBox_Resize;
|
MyPictureBox.Resize -= MyPictureBox_Resize;
|
||||||
this.MyPictureBox.MouseDown -= MyPictureBox_MouseDown;
|
MyPictureBox.MouseDown -= MyPictureBox_MouseDown;
|
||||||
}
|
}
|
||||||
void ImageItem_Click(object sender, EventArgs e)
|
void ImageItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -675,7 +671,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
void MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args)
|
void MyStepRTB_RoInsert(object sender, StepRTBRoEventArgs args)
|
||||||
{
|
{
|
||||||
int sel = MyStepRTB.SelectionStart + args.ValText.Length;
|
_ = MyStepRTB.SelectionStart + args.ValText.Length;
|
||||||
_IsDirty = true;
|
_IsDirty = true;
|
||||||
InsType = E_ImageSource.RoFigure;
|
InsType = E_ImageSource.RoFigure;
|
||||||
MyStepRTB.UpdateStepRtb(args.LinkText, args.ValText);
|
MyStepRTB.UpdateStepRtb(args.LinkText, args.ValText);
|
||||||
@@ -725,9 +721,11 @@ namespace Volian.Controls.Library
|
|||||||
bool success = MyStepRTB.OrigDisplayText.Save((RichTextBox)MyStepRTB);
|
bool success = MyStepRTB.OrigDisplayText.Save((RichTextBox)MyStepRTB);
|
||||||
if (success && _newSizeHt != 0)
|
if (success && _newSizeHt != 0)
|
||||||
{
|
{
|
||||||
StepConfig sc = new StepConfig(MyItemInfo as StepInfo);
|
StepConfig sc = new StepConfig(MyItemInfo as StepInfo)
|
||||||
sc.Step_ImageWidth = (int)(_newSizeWd / (MyStepPanel.DPI / 72f));
|
{
|
||||||
sc.Step_ImageHeight = (int)(_newSizeHt / (MyStepPanel.DPI / 72f));
|
Step_ImageWidth = (int)(_newSizeWd / (MyStepPanel.DPI / 72f)),
|
||||||
|
Step_ImageHeight = (int)(_newSizeHt / (MyStepPanel.DPI / 72f))
|
||||||
|
};
|
||||||
using (Item item = MyItemInfo.Get())
|
using (Item item = MyItemInfo.Get())
|
||||||
{
|
{
|
||||||
item.MyContent.Config = sc.ToString();
|
item.MyContent.Config = sc.ToString();
|
||||||
@@ -761,8 +759,10 @@ namespace Volian.Controls.Library
|
|||||||
ImageConfig imgCfg = null;
|
ImageConfig imgCfg = null;
|
||||||
if (_pastedNew && compressed)
|
if (_pastedNew && compressed)
|
||||||
{
|
{
|
||||||
imgCfg = new ImageConfig();
|
imgCfg = new ImageConfig
|
||||||
imgCfg.Image_DataSize = origLen;
|
{
|
||||||
|
Image_DataSize = origLen
|
||||||
|
};
|
||||||
_MyItem.MyContent.MyImage.Config = imgCfg.ToString();
|
_MyItem.MyContent.MyImage.Config = imgCfg.ToString();
|
||||||
}
|
}
|
||||||
else if (_newSizeHt != 0)
|
else if (_newSizeHt != 0)
|
||||||
@@ -800,10 +800,10 @@ namespace Volian.Controls.Library
|
|||||||
// this should be saved for every piece of edited data. Note that the set of config
|
// this should be saved for every piece of edited data. Note that the set of config
|
||||||
// item Step_MultipleChangeID has the save built in to it.
|
// item Step_MultipleChangeID has the save built in to it.
|
||||||
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
if (MyItemInfo.ActiveFormat.PlantFormat.FormatData.ProcData.ChangeBarData.ChangeIds
|
||||||
&& !this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange)
|
&& !MyStepPanel.MyStepTabPanel.MyDisplayTabControl.EditorialChange)
|
||||||
{
|
{
|
||||||
if (sc == null) sc = new StepConfig();
|
if (sc == null) sc = new StepConfig();
|
||||||
sc.Step_ChangeID = this.MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
|
sc.Step_ChangeID = MyStepPanel.MyStepTabPanel.MyDisplayTabControl.ChgId;
|
||||||
}
|
}
|
||||||
// We saved changes. Reset the change bar override.
|
// We saved changes. Reset the change bar override.
|
||||||
// IF there is a step config remove the change bar override by setting the CBOverride value to null
|
// IF there is a step config remove the change bar override by setting the CBOverride value to null
|
||||||
@@ -813,7 +813,7 @@ namespace Volian.Controls.Library
|
|||||||
sc.Step_CBOverride = null; // clear the change bar override
|
sc.Step_CBOverride = null; // clear the change bar override
|
||||||
MyStepRTB.ClearUndo();
|
MyStepRTB.ClearUndo();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
FlexibleMessageBox.Show("The image could not be saved.", "Image Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
FlexibleMessageBox.Show("The image could not be saved.", "Image Save", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
return;
|
return;
|
||||||
@@ -825,7 +825,9 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
// get filename's extension to map to imageformat:
|
// get filename's extension to map to imageformat:
|
||||||
string ext = fname.Substring(fname.LastIndexOf(".") + 1).ToUpper();
|
string ext = fname.Substring(fname.LastIndexOf(".") + 1).ToUpper();
|
||||||
|
#pragma warning disable IDE0059 // Unnecessary assignment of a value
|
||||||
System.Drawing.Imaging.ImageFormat ifmt = System.Drawing.Imaging.ImageFormat.Gif;
|
System.Drawing.Imaging.ImageFormat ifmt = System.Drawing.Imaging.ImageFormat.Gif;
|
||||||
|
#pragma warning restore IDE0059 // Unnecessary assignment of a value
|
||||||
switch (ext)
|
switch (ext)
|
||||||
{
|
{
|
||||||
case ("JPG"):
|
case ("JPG"):
|
||||||
@@ -891,11 +893,13 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
if (img == null)
|
if (img == null)
|
||||||
{
|
{
|
||||||
OpenFileDialog openFileDialog1 = new OpenFileDialog();
|
OpenFileDialog openFileDialog1 = new OpenFileDialog
|
||||||
openFileDialog1.InitialDirectory = "c:\\";
|
{
|
||||||
openFileDialog1.Filter = "Image files (*.jpg;*.tif;*.bmp;*.png)|*.jpg;*.tif;*.bmp;*.png|All files (*.*)|*.*";
|
InitialDirectory = "c:\\",
|
||||||
openFileDialog1.FilterIndex = 0;
|
Filter = "Image files (*.jpg;*.tif;*.bmp;*.png)|*.jpg;*.tif;*.bmp;*.png|All files (*.*)|*.*",
|
||||||
openFileDialog1.RestoreDirectory = true;
|
FilterIndex = 0,
|
||||||
|
RestoreDirectory = true
|
||||||
|
};
|
||||||
DialogResult dr = openFileDialog1.ShowDialog();
|
DialogResult dr = openFileDialog1.ShowDialog();
|
||||||
if (dr == DialogResult.OK)
|
if (dr == DialogResult.OK)
|
||||||
{
|
{
|
||||||
@@ -904,7 +908,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
img = System.Drawing.Image.FromFile(openFileDialog1.FileName);
|
img = System.Drawing.Image.FromFile(openFileDialog1.FileName);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
img = null;
|
img = null;
|
||||||
}
|
}
|
||||||
@@ -939,8 +943,10 @@ namespace Volian.Controls.Library
|
|||||||
ImageConfig imgCfg = null;
|
ImageConfig imgCfg = null;
|
||||||
if (compressed)
|
if (compressed)
|
||||||
{
|
{
|
||||||
imgCfg = new ImageConfig();
|
imgCfg = new ImageConfig
|
||||||
imgCfg.Image_DataSize = origLen;
|
{
|
||||||
|
Image_DataSize = origLen
|
||||||
|
};
|
||||||
_MyItem.MyContent.MyImage.Config = imgCfg.ToString();
|
_MyItem.MyContent.MyImage.Config = imgCfg.ToString();
|
||||||
}
|
}
|
||||||
_MyItem.MyContent.MyImage.Data = imgToByte;
|
_MyItem.MyContent.MyImage.Data = imgToByte;
|
||||||
@@ -956,13 +962,13 @@ namespace Volian.Controls.Library
|
|||||||
public override void IdentifyMe(bool highlight)
|
public override void IdentifyMe(bool highlight)
|
||||||
{
|
{
|
||||||
if (highlight)
|
if (highlight)
|
||||||
this.BackColor = Color.Gray;
|
BackColor = Color.Gray;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (MyPictureBox.Focused || this.Focused) // If active Set BackColor to the active color
|
if (MyPictureBox.Focused || Focused) // If active Set BackColor to the active color
|
||||||
this.BackColor = MyStepPanel.ActiveColor;
|
BackColor = MyStepPanel.ActiveColor;
|
||||||
else // note that the 'inactive' color is actually MyStepPanel.PanelColor
|
else // note that the 'inactive' color is actually MyStepPanel.PanelColor
|
||||||
this.BackColor = MyItemInfo.ItemAnnotationCount == 0 ? MyStepPanel.PanelColor : MyStepPanel.AnnotationColor;
|
BackColor = MyItemInfo.ItemAnnotationCount == 0 ? MyStepPanel.PanelColor : MyStepPanel.AnnotationColor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -16,15 +16,20 @@ namespace Volian.Controls.Library
|
|||||||
private EPFields myEPFields;
|
private EPFields myEPFields;
|
||||||
private AnnotationConfig MyConfig;
|
private AnnotationConfig MyConfig;
|
||||||
|
|
||||||
private StepTabRibbon _MyStepTabRibbon;
|
private readonly StepTabRibbon _MyStepTabRibbon;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<string, TextBox> _DicTB;
|
private Dictionary<string, TextBox> _DicTB;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<string, CheckBox> _DicCheckBox;
|
private Dictionary<string, CheckBox> _DicCheckBox;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<string, ComboBox> _DicComboBox;
|
private Dictionary<string, ComboBox> _DicComboBox;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<string, ComboBox> _DicSingleRO;
|
private Dictionary<string, ComboBox> _DicSingleRO;
|
||||||
|
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0044:Add readonly modifier", Justification = "Keeping Collections Not ReadOnly")]
|
||||||
private Dictionary<string, ListBoxMulti> _DicMultiRO;
|
private Dictionary<string, ListBoxMulti> _DicMultiRO;
|
||||||
private TablePropertiesControl _TablePropControl;
|
private TablePropertiesControl _TablePropControl;
|
||||||
|
|
||||||
private string multiseparator = ",";
|
private readonly string multiseparator = ",";
|
||||||
|
|
||||||
public frmEPAnnotationDetails(AnnotationInfo currAnn)
|
public frmEPAnnotationDetails(AnnotationInfo currAnn)
|
||||||
{
|
{
|
||||||
@@ -58,12 +63,14 @@ namespace Volian.Controls.Library
|
|||||||
|
|
||||||
if (EP.type.ToLower() != "tableinput")
|
if (EP.type.ToLower() != "tableinput")
|
||||||
{
|
{
|
||||||
Label wlbl = new Label();
|
Label wlbl = new Label
|
||||||
wlbl.Text = EP.label;
|
{
|
||||||
wlbl.Visible = true;
|
Text = EP.label,
|
||||||
wlbl.TextAlign = ContentAlignment.MiddleLeft;
|
Visible = true,
|
||||||
wlbl.Anchor = AnchorStyles.Left | AnchorStyles.Top;
|
TextAlign = ContentAlignment.MiddleLeft,
|
||||||
wlbl.Width = (8 * MaxCharsInLabel) + 5;
|
Anchor = AnchorStyles.Left | AnchorStyles.Top,
|
||||||
|
Width = (8 * MaxCharsInLabel) + 5
|
||||||
|
};
|
||||||
panelEP.Controls.Add(wlbl, 0, panelEP.RowCount - 1);
|
panelEP.Controls.Add(wlbl, 0, panelEP.RowCount - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,9 +106,11 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
if (EP.type.ToLower() == "logical")
|
if (EP.type.ToLower() == "logical")
|
||||||
{
|
{
|
||||||
CheckBox cb = new CheckBox();
|
CheckBox cb = new CheckBox
|
||||||
cb.Text = EP.text;
|
{
|
||||||
cb.Visible = true;
|
Text = EP.text,
|
||||||
|
Visible = true
|
||||||
|
};
|
||||||
string val = MyConfig.GetValue("EP", EP.name);
|
string val = MyConfig.GetValue("EP", EP.name);
|
||||||
cb.Checked = val != null && val != "" && val.ToUpper()[0] == 'Y';
|
cb.Checked = val != null && val != "" && val.ToUpper()[0] == 'Y';
|
||||||
_DicCheckBox.Add(EP.name, cb);
|
_DicCheckBox.Add(EP.name, cb);
|
||||||
@@ -110,8 +119,10 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
if (EP.type.ToLower() == "combo")
|
if (EP.type.ToLower() == "combo")
|
||||||
{
|
{
|
||||||
ComboBox cmb = new ComboBox();
|
ComboBox cmb = new ComboBox
|
||||||
cmb.Visible = true;
|
{
|
||||||
|
Visible = true
|
||||||
|
};
|
||||||
string tmp = EP.text;
|
string tmp = EP.text;
|
||||||
string[] tmps = tmp.Split(",".ToCharArray());
|
string[] tmps = tmp.Split(",".ToCharArray());
|
||||||
foreach (string t in tmps) cmb.Items.Add(t.Trim());
|
foreach (string t in tmps) cmb.Items.Add(t.Trim());
|
||||||
@@ -124,8 +135,10 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
if (EP.type.ToLower() == "rosingle")
|
if (EP.type.ToLower() == "rosingle")
|
||||||
{
|
{
|
||||||
ComboBox cmb = new ComboBox();
|
ComboBox cmb = new ComboBox
|
||||||
cmb.Visible = true;
|
{
|
||||||
|
Visible = true
|
||||||
|
};
|
||||||
|
|
||||||
List<ROListItem> tmps = EP.getROList(currAnn, true);
|
List<ROListItem> tmps = EP.getROList(currAnn, true);
|
||||||
cmb.DisplayMember = "Text";
|
cmb.DisplayMember = "Text";
|
||||||
@@ -156,8 +169,10 @@ namespace Volian.Controls.Library
|
|||||||
if (EP.type.ToLower() == "tableinput" && _TablePropControl == null)
|
if (EP.type.ToLower() == "tableinput" && _TablePropControl == null)
|
||||||
{
|
{
|
||||||
string val = MyConfig.GetValue("EP", EP.name);
|
string val = MyConfig.GetValue("EP", EP.name);
|
||||||
_TablePropControl = new TablePropertiesControl(EP.name, EP.label, val);
|
_TablePropControl = new TablePropertiesControl(EP.name, EP.label, val)
|
||||||
_TablePropControl.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
|
{
|
||||||
|
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
|
||||||
|
};
|
||||||
panelEP.Controls.Add(_TablePropControl, 1, panelEP.RowCount - 1);
|
panelEP.Controls.Add(_TablePropControl, 1, panelEP.RowCount - 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ namespace Volian.Controls.Library
|
|||||||
public partial class frmImportWordContents : Form
|
public partial class frmImportWordContents : Form
|
||||||
{
|
{
|
||||||
LBApplicationClass _WordApp;
|
LBApplicationClass _WordApp;
|
||||||
bool _initializing = false;
|
|
||||||
private StepRTB _MyStepRTB = null;
|
private StepRTB _MyStepRTB = null;
|
||||||
|
|
||||||
public StepRTB MyStepRTB
|
public StepRTB MyStepRTB
|
||||||
@@ -23,12 +22,10 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
public frmImportWordContents()
|
public frmImportWordContents()
|
||||||
{
|
{
|
||||||
_initializing = true;
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
// C2019-021 Allow the Number field to be edited.
|
// C2019-021 Allow the Number field to be edited.
|
||||||
txbWordFile.Text = Properties.Settings.Default.ImportWordFilePath;
|
txbWordFile.Text = Properties.Settings.Default.ImportWordFilePath;
|
||||||
disableButtons();
|
disableButtons();
|
||||||
_initializing = false;
|
|
||||||
// B2019-108 Enable/disable buttons
|
// B2019-108 Enable/disable buttons
|
||||||
btnOpen.Enabled = File.Exists(txbWordFile.Text) && _WordApp == null;
|
btnOpen.Enabled = File.Exists(txbWordFile.Text) && _WordApp == null;
|
||||||
}
|
}
|
||||||
@@ -44,12 +41,7 @@ namespace Volian.Controls.Library
|
|||||||
btnInsertNext.Enabled = false;
|
btnInsertNext.Enabled = false;
|
||||||
btnReplaceNext.Enabled = false;
|
btnReplaceNext.Enabled = false;
|
||||||
}
|
}
|
||||||
private void ofd_FileOk(object sender, CancelEventArgs e)
|
private void ofd_FileOk(object sender, CancelEventArgs e) => txbWordFile.Text = ofd.FileName;
|
||||||
{
|
|
||||||
_initializing = true;
|
|
||||||
txbWordFile.Text = ofd.FileName;
|
|
||||||
_initializing = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void btnBrowse_Click(object sender, EventArgs e)
|
private void btnBrowse_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
@@ -254,7 +246,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
return retval.ToString();
|
return retval.ToString();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
return "12";
|
return "12";
|
||||||
}
|
}
|
||||||
@@ -281,8 +273,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (_WordApp != null)
|
_WordApp?.Quit();
|
||||||
_WordApp.Quit();
|
|
||||||
// B2019-108 Reset WordApp when closed.
|
// B2019-108 Reset WordApp when closed.
|
||||||
_WordApp = null;
|
_WordApp = null;
|
||||||
}
|
}
|
||||||
@@ -355,8 +346,7 @@ namespace Volian.Controls.Library
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
if (MyStepRTB.Parent is EditItem ei)
|
||||||
if (ei != null)
|
|
||||||
{
|
{
|
||||||
ei.AddSiblingAfter();
|
ei.AddSiblingAfter();
|
||||||
}
|
}
|
||||||
@@ -380,10 +370,7 @@ namespace Volian.Controls.Library
|
|||||||
ei = ei.MyParentEditItem;
|
ei = ei.MyParentEditItem;
|
||||||
else
|
else
|
||||||
ei = ei.MyPreviousEditItem;
|
ei = ei.MyPreviousEditItem;
|
||||||
if (ei != null)
|
ei?.AddSiblingAfter();
|
||||||
{
|
|
||||||
ei.AddSiblingAfter();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// C201-021 New Function Add a new High level step
|
// C201-021 New Function Add a new High level step
|
||||||
@@ -402,10 +389,7 @@ namespace Volian.Controls.Library
|
|||||||
ei = ei.MyParentEditItem;
|
ei = ei.MyParentEditItem;
|
||||||
else
|
else
|
||||||
ei = ei.MyPreviousEditItem;
|
ei = ei.MyPreviousEditItem;
|
||||||
if (ei != null)
|
ei?.AddSiblingAfter();
|
||||||
{
|
|
||||||
ei.AddSiblingAfter();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private EditItem GetEditItem(Control Ctrl)
|
private EditItem GetEditItem(Control Ctrl)
|
||||||
@@ -556,7 +540,6 @@ namespace Volian.Controls.Library
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LoadTable2(xd.DocumentElement);
|
LoadTable2(xd.DocumentElement);
|
||||||
int type = 20008;
|
|
||||||
if(MyStepRTB.MyItemInfo.IsTable)
|
if(MyStepRTB.MyItemInfo.IsTable)
|
||||||
{
|
{
|
||||||
using( Item itm = MyStepRTB.MyItemInfo.Get())
|
using( Item itm = MyStepRTB.MyItemInfo.Get())
|
||||||
@@ -573,7 +556,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
EditItem ei = MyStepRTB.Parent as EditItem;
|
EditItem ei = MyStepRTB.Parent as EditItem;
|
||||||
ei.AddChild(E_FromType.Table, 20008, TblFlexGrid);
|
ei.AddChild(E_FromType.Table, 20008, TblFlexGrid);
|
||||||
if (ei != null) ei.SetAllTabs();
|
ei?.SetAllTabs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,7 +607,7 @@ namespace Volian.Controls.Library
|
|||||||
int TableWidth = 0;
|
int TableWidth = 0;
|
||||||
for (iC = 0; iC < tbl.Columns.Count; iC++)
|
for (iC = 0; iC < tbl.Columns.Count; iC++)
|
||||||
{
|
{
|
||||||
TableWidth = TableWidth + Wcol[iC];
|
TableWidth += Wcol[iC];
|
||||||
}
|
}
|
||||||
tend = DateTime.Now; Console.WriteLine("{0} before Rollup columns", TimeSpan.FromTicks(tend.Ticks - tstart.Ticks).TotalMilliseconds); tstart = tend;
|
tend = DateTime.Now; Console.WriteLine("{0} before Rollup columns", TimeSpan.FromTicks(tend.Ticks - tstart.Ticks).TotalMilliseconds); tstart = tend;
|
||||||
// roll up columns
|
// roll up columns
|
||||||
@@ -649,7 +632,7 @@ namespace Volian.Controls.Library
|
|||||||
Wcell[iR, i] = Wcell[iR, i - 1];
|
Wcell[iR, i] = Wcell[iR, i - 1];
|
||||||
Wcell[iR, i - 1] = 0;
|
Wcell[iR, i - 1] = 0;
|
||||||
}
|
}
|
||||||
tmp = tmp - Wcol[iC + SpanC[iR, iC]];
|
tmp -= Wcol[iC + SpanC[iR, iC]];
|
||||||
SpanC[iR, iC]++;
|
SpanC[iR, iC]++;
|
||||||
}
|
}
|
||||||
iC = iC + SpanC[iR, iC] - 1;
|
iC = iC + SpanC[iR, iC] - 1;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
public partial class frmSendErrorLog : Form
|
public partial class frmSendErrorLog : Form
|
||||||
{
|
{
|
||||||
private string _ErrorLogPath;
|
private readonly string _ErrorLogPath;
|
||||||
public bool OutlookEmail
|
public bool OutlookEmail
|
||||||
{
|
{
|
||||||
get { return rbOutlook.Checked; }
|
get { return rbOutlook.Checked; }
|
||||||
@@ -75,16 +75,20 @@ namespace Volian.Controls.Library
|
|||||||
FileStream fs = null;
|
FileStream fs = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
MailMessage mm = new MailMessage();
|
MailMessage mm = new MailMessage
|
||||||
mm.From = new MailAddress(SMTPUser);
|
{
|
||||||
|
From = new MailAddress(SMTPUser)
|
||||||
|
};
|
||||||
mm.To.Add("support@volian.com");
|
mm.To.Add("support@volian.com");
|
||||||
mm.Subject = $"PROMS Error Log {DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss")}";
|
mm.Subject = $"PROMS Error Log {DateTime.Now:MM/dd/yyyy hh:mm:ss}";
|
||||||
mm.Body = $"{Header}\r\n\r\n{tbContent.Text}";
|
mm.Body = $"{Header}\r\n\r\n{tbContent.Text}";
|
||||||
fs = File.Open(_ErrorLogPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
fs = File.Open(_ErrorLogPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
|
||||||
mm.Attachments.Add(new Attachment(fs, "ErrorLog.txt"));
|
mm.Attachments.Add(new Attachment(fs, "ErrorLog.txt"));
|
||||||
SmtpClient sc = new SmtpClient(SMTPServer);
|
SmtpClient sc = new SmtpClient(SMTPServer)
|
||||||
sc.EnableSsl = true;
|
{
|
||||||
sc.Credentials = new NetworkCredential(SMTPUser, tbPassword.Text);
|
EnableSsl = true,
|
||||||
|
Credentials = new NetworkCredential(SMTPUser, tbPassword.Text)
|
||||||
|
};
|
||||||
sc.Send(mm);
|
sc.Send(mm);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -129,7 +133,7 @@ namespace Volian.Controls.Library
|
|||||||
LBApplicationClass app = new LBApplicationClass();
|
LBApplicationClass app = new LBApplicationClass();
|
||||||
LBMailItemClass msg = app.CreateMailItem();
|
LBMailItemClass msg = app.CreateMailItem();
|
||||||
msg.Recipients.Add("support@volian.com");
|
msg.Recipients.Add("support@volian.com");
|
||||||
msg.Subject = $"PROMS Error Log {DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss")}";
|
msg.Subject = $"PROMS Error Log {DateTime.Now:MM/dd/yyyy hh:mm:ss}";
|
||||||
msg.BodyFormat = LBOlBodyFormat.olFormatPlain;
|
msg.BodyFormat = LBOlBodyFormat.olFormatPlain;
|
||||||
msg.Body = $"{Header}\r\n\r\n{tbContent.Text}";
|
msg.Body = $"{Header}\r\n\r\n{tbContent.Text}";
|
||||||
msg.AddAttachment(_ErrorLogPath);
|
msg.AddAttachment(_ErrorLogPath);
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ namespace Volian.Controls.Library
|
|||||||
{
|
{
|
||||||
public partial class frmViewTextFile : DevComponents.DotNetBar.Office2007Form //Form
|
public partial class frmViewTextFile : DevComponents.DotNetBar.Office2007Form //Form
|
||||||
{
|
{
|
||||||
string _FileName;
|
readonly string _FileName;
|
||||||
RichTextBoxStreamType _RTBType;
|
readonly RichTextBoxStreamType _RTBType;
|
||||||
public string ButtonText
|
public string ButtonText
|
||||||
{
|
{
|
||||||
get { return buttonX1.Text; }
|
get { return buttonX1.Text; }
|
||||||
|
|||||||
@@ -3,31 +3,19 @@
|
|||||||
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
*********************************************************************************************/
|
*********************************************************************************************/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO.Pipes;
|
using System.IO.Pipes;
|
||||||
//using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
//using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Volian.Pipe.Library
|
namespace Volian.Pipe.Library
|
||||||
{
|
{
|
||||||
public class PipeClient
|
public class PipeClient
|
||||||
{
|
{
|
||||||
private string _Name;
|
public string Name { get; set; }
|
||||||
public string Name
|
|
||||||
{
|
public int TimeOut { get; set; } = 1000;
|
||||||
get { return _Name; }
|
|
||||||
set { _Name = value; }
|
|
||||||
}
|
|
||||||
private int _TimeOut = 1000;
|
|
||||||
public int TimeOut
|
|
||||||
{
|
|
||||||
get { return _TimeOut; }
|
|
||||||
set { _TimeOut = value; }
|
|
||||||
}
|
|
||||||
public PipeClient(string name)
|
public PipeClient(string name)
|
||||||
{
|
{
|
||||||
_Name = name;
|
Name = name;
|
||||||
}
|
}
|
||||||
public void Send(string msg)
|
public void Send(string msg)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,11 +3,8 @@
|
|||||||
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
* Volian Enterprises - Proprietary Information - DO NOT COPY OR DISTRIBUTE
|
||||||
*********************************************************************************************/
|
*********************************************************************************************/
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO.Pipes;
|
using System.IO.Pipes;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
//using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Volian.Pipe.Library
|
namespace Volian.Pipe.Library
|
||||||
{
|
{
|
||||||
@@ -15,18 +12,12 @@ namespace Volian.Pipe.Library
|
|||||||
public delegate void DelegateMessage(string Reply);
|
public delegate void DelegateMessage(string Reply);
|
||||||
public class PipeServer
|
public class PipeServer
|
||||||
{
|
{
|
||||||
private string _Name;
|
public string Name { get; set; }
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get { return _Name; }
|
|
||||||
set { _Name = value; }
|
|
||||||
}
|
|
||||||
public PipeServer(string name)
|
public PipeServer(string name)
|
||||||
{
|
{
|
||||||
_Name = name;
|
Name = name;
|
||||||
}
|
}
|
||||||
public event DelegateMessage PipeMessage;
|
public event DelegateMessage PipeMessage;
|
||||||
string _pipeName;
|
|
||||||
public void Listen()
|
public void Listen()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@@ -66,9 +57,7 @@ namespace Volian.Pipe.Library
|
|||||||
// Kill original sever and create new wait server
|
// Kill original sever and create new wait server
|
||||||
pipeServer.Close();
|
pipeServer.Close();
|
||||||
pipeServer = null;
|
pipeServer = null;
|
||||||
//pipeServer = new NamedPipeServerStream(_pipeName, PipeDirection.In, 1, PipeTransmissionMode.Byte, PipeOptions.Asynchronous);
|
// Recursively wait for the connection again and again....
|
||||||
//// Recursively wait for the connection again and again....
|
|
||||||
//pipeServer.BeginWaitForConnection(new AsyncCallback(WaitForConnectionCallBack), pipeServer);
|
|
||||||
Listen();
|
Listen();
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
Reference in New Issue
Block a user