addition of log4net
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
public partial class DisplayPanel : Panel
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#region Events
|
||||
public event DisplayPanelEvent ItemClick;
|
||||
internal void OnItemClick(object sender, DisplayPanelEventArgs args)
|
||||
@@ -24,17 +25,23 @@ namespace Volian.Controls.Library
|
||||
if (LinkClicked != null) LinkClicked(sender, args);
|
||||
else MessageBox.Show(args.LinkInfo.LinkText, "Unhandled Link Click", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
public event DisplayPanelAttachmentEvent AttachmentClicked;
|
||||
internal void OnAttachmentClicked(object sender, DisplayPanelAttachmentEventArgs args)
|
||||
{
|
||||
if (AttachmentClicked != null) AttachmentClicked(sender, args);
|
||||
else MessageBox.Show(args.MyDisplayItem.MyItem.MyContent.MyEntry.MyDocument.DocumentTitle, "Unhandled Attachment Click", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
#endregion
|
||||
#region Constructors
|
||||
public DisplayPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.Paint += new PaintEventHandler(vlnCSLAPanel_Paint);
|
||||
this.DoubleClick += new EventHandler(vlnCSLAPanel_DoubleClick);
|
||||
this.Paint += new PaintEventHandler(DisplayPanel_Paint);
|
||||
this.DoubleClick += new EventHandler(DisplayPanel_DoubleClick);
|
||||
this.AutoScroll = true;
|
||||
}
|
||||
|
||||
void vlnCSLAPanel_DoubleClick(object sender, EventArgs e)
|
||||
void DisplayPanel_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
ShowLines = !ShowLines;
|
||||
Refresh();
|
||||
@@ -44,25 +51,33 @@ namespace Volian.Controls.Library
|
||||
Pen bluePen = new Pen(Color.CornflowerBlue,1);
|
||||
g.DrawLine(bluePen, x, 0, x, this.Height);
|
||||
}
|
||||
void vlnCSLAPanel_Paint(object sender, PaintEventArgs e)
|
||||
void DisplayPanel_Paint(object sender, PaintEventArgs e)
|
||||
{
|
||||
if (ShowLines)
|
||||
{
|
||||
VerticalLine(e.Graphics, 60);
|
||||
VerticalLine(e.Graphics, 102);
|
||||
VerticalLine(e.Graphics, 415);
|
||||
//int fifth = Height / 5;
|
||||
//Rectangle r1 = new Rectangle(0, 0, Width, Height - fifth);
|
||||
////Brush b = new System.Drawing.Drawing2D.LinearGradientBrush(r1, Color.FromArgb(128, 0, 32), Color.FromArgb(96, 0, 16), 90);
|
||||
//Brush b = new System.Drawing.Drawing2D.LinearGradientBrush(r1, Color.FromArgb(255,128, 0, 32), Color.FromArgb(255,96, 0, 16),System.Drawing.Drawing2D.LinearGradientMode.Vertical);
|
||||
//e.Graphics.FillRectangle(b, r1);
|
||||
//r1 = new Rectangle(0, Height - fifth, Width, fifth);
|
||||
//b = new System.Drawing.Drawing2D.LinearGradientBrush(r1, Color.FromArgb(255,96, 0, 16), Color.FromArgb(255,128, 0, 32), 90);
|
||||
//e.Graphics.FillRectangle(b, r1);
|
||||
//VerticalLine(e.Graphics, 60);
|
||||
//VerticalLine(e.Graphics, 102);
|
||||
//VerticalLine(e.Graphics, 415);
|
||||
}
|
||||
}
|
||||
public DisplayPanel(IContainer container)
|
||||
{
|
||||
container.Add(this);
|
||||
InitializeComponent();
|
||||
this.Paint += new PaintEventHandler(vlnCSLAPanel_Paint);
|
||||
this.BackColorChanged += new EventHandler(vlnCSLAPanel_BackColorChanged);
|
||||
this.DoubleClick += new EventHandler(vlnCSLAPanel_DoubleClick);
|
||||
this.Paint += new PaintEventHandler(DisplayPanel_Paint);
|
||||
this.BackColorChanged += new EventHandler(DisplayPanel_BackColorChanged);
|
||||
this.DoubleClick += new EventHandler(DisplayPanel_DoubleClick);
|
||||
this.AutoScroll = true;
|
||||
}
|
||||
void vlnCSLAPanel_BackColorChanged(object sender, EventArgs e)
|
||||
void DisplayPanel_BackColorChanged(object sender, EventArgs e)
|
||||
{
|
||||
// Walk through controls & set colors
|
||||
InactiveColor = PanelColor = BackColor;
|
||||
@@ -89,8 +104,8 @@ namespace Volian.Controls.Library
|
||||
if(value != null)
|
||||
_Layout = _MyItem.ActiveFormat.PlantFormat.FormatData.SectData.StepSectionData.StepSectionLayoutData;
|
||||
//// TIMING: vlnCSLARTB.TimeIt("pMyItem Layout");
|
||||
//this.Layout += new LayoutEventHandler(vlnCSLAPanel_Layout);
|
||||
//this.Scroll += new ScrollEventHandler(vlnCSLAPanel_Scroll);
|
||||
//this.Layout += new LayoutEventHandler(DisplayPanel_Layout);
|
||||
//this.Scroll += new ScrollEventHandler(DisplayPanel_Scroll);
|
||||
//// TIMING: vlnCSLARTB.TimeIt("pMyItem Scroll");
|
||||
Controls.Clear();
|
||||
ItemLookup = new Dictionary<int, DisplayItem>();
|
||||
@@ -158,13 +173,13 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
set { _Settings = value;}
|
||||
}
|
||||
//void vlnCSLAPanel_Layout(object sender, LayoutEventArgs e)
|
||||
//void DisplayPanel_Layout(object sender, LayoutEventArgs e)
|
||||
// {
|
||||
// //Console.Write("\r\nlayout {0} {1} {2} {3}", e.AffectedComponent.GetType().Name,e.AffectedControl.Name,e.AffectedProperty, sender.GetType().Name);
|
||||
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("layout {0} {1} {2} {3}", e.AffectedComponent.GetType().Name,e.AffectedControl.Name,e.AffectedProperty, sender.GetType().Name);
|
||||
// }
|
||||
//void vlnCSLAPanel_Scroll(object sender, ScrollEventArgs e)
|
||||
//void DisplayPanel_Scroll(object sender, ScrollEventArgs e)
|
||||
//{
|
||||
// //Console.Write("\r\nscroll {0} {1} {2} {3}", e.OldValue, e.NewValue, e.ScrollOrientation,sender.GetType().Name);
|
||||
// //if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("scroll {0} {1} {2} {3}", e.OldValue, e.NewValue, e.ScrollOrientation,sender.GetType().Name);
|
||||
// Scrolling = false;
|
||||
//}
|
||||
//public void AdjustOutOfRangeControls(int yAdjust)
|
||||
@@ -288,14 +303,13 @@ namespace Volian.Controls.Library
|
||||
public void ListControls()
|
||||
{
|
||||
// Walk through the controls and find the next control for each
|
||||
//Console.Clear();
|
||||
Console.WriteLine("'Item','Next'");
|
||||
if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("'Item','Next'");
|
||||
foreach (Control control in Controls)
|
||||
if (control.GetType().Name == "vlnCSLARTB")
|
||||
{
|
||||
DisplayItem rtb = (DisplayItem)control;
|
||||
DisplayItem nxt = rtb.NextItem;
|
||||
Console.WriteLine("{0},{1}", rtb.MyID, nxt == null ? 0 : nxt.MyID);
|
||||
if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("{0},{1}", rtb.MyID, nxt == null ? 0 : nxt.MyID);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -306,6 +320,7 @@ namespace Volian.Controls.Library
|
||||
[TypeConverter(typeof(ExpandableObjectConverter))]
|
||||
public partial class DisplayPanelSettings
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
public DisplayPanelSettings(DisplayPanel panel)
|
||||
{
|
||||
_Panel = panel;
|
||||
@@ -479,20 +494,22 @@ namespace Volian.Controls.Library
|
||||
_MyMouseEventArgs = myMouseEventArgs;
|
||||
}
|
||||
}
|
||||
#region enums
|
||||
public enum ParsedLinkType : int
|
||||
public partial class DisplayPanelAttachmentEventArgs
|
||||
{
|
||||
NotParsed = 0,
|
||||
Transition = 1,
|
||||
TransitionRange = 2,
|
||||
ReferencedObject = 3
|
||||
private DisplayItem _MyDisplayItem; // Volian Property Snippet
|
||||
public DisplayItem MyDisplayItem
|
||||
{
|
||||
get { return _MyDisplayItem; }
|
||||
set { _MyDisplayItem = value; }
|
||||
}
|
||||
public DisplayPanelAttachmentEventArgs(DisplayItem myDisplayItem)
|
||||
{
|
||||
_MyDisplayItem = myDisplayItem;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
public delegate void DisplayPanelEvent(object sender, DisplayPanelEventArgs args);
|
||||
public delegate void DisplayPanelLinkEvent(object sender, DisplayLinkEventArgs args);
|
||||
#region DisplayLinkEventArgs
|
||||
public partial class DisplayLinkEventArgs : EventArgs
|
||||
{
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private DisplayItem _LinkedRTB; // Volian Property Snippet
|
||||
public DisplayItem LinkedRTB
|
||||
{
|
||||
@@ -509,7 +526,7 @@ namespace Volian.Controls.Library
|
||||
{
|
||||
LinkedRTB = linkedRTB;
|
||||
LinkInfo = linkInfo;
|
||||
Console.WriteLine("\r\n DisplayLinkEventArgs in DisplayPanel: LinkInfo '{0}'\r\n", linkInfo.LinkText);
|
||||
//if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("\r\n LinkInfo '{0}'\r\n", linkInfo.LinkText);
|
||||
}
|
||||
private void ParseLink()
|
||||
{
|
||||
@@ -527,10 +544,14 @@ namespace Volian.Controls.Library
|
||||
case "Transition":
|
||||
case "TransitionRange":
|
||||
_Type = (ParsedLinkType)Enum.Parse(_Type.GetType(), m.Groups[1].Value);
|
||||
if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Link String - '{0}'", m.Groups[2].Value);
|
||||
int transitionID = Convert.ToInt32(m.Groups[2].Value.Split(" ".ToCharArray())[1]);
|
||||
foreach (TransitionInfo ti in _LinkedRTB.MyItem.MyContent.ContentTransitions)
|
||||
{
|
||||
if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat("Transition ID = '{0}'", ti.TransitionID);
|
||||
if (ti.TransitionID == transitionID)
|
||||
_MyTransition = ti;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -565,6 +586,17 @@ namespace Volian.Controls.Library
|
||||
}
|
||||
|
||||
}
|
||||
#region enums
|
||||
public enum ParsedLinkType : int
|
||||
{
|
||||
NotParsed = 0,
|
||||
Transition = 1,
|
||||
TransitionRange = 2,
|
||||
ReferencedObject = 3
|
||||
}
|
||||
#endregion
|
||||
public delegate void DisplayPanelEvent(object sender, DisplayPanelEventArgs args);
|
||||
public delegate void DisplayPanelLinkEvent(object sender, DisplayLinkEventArgs args);
|
||||
public delegate void DisplayPanelAttachmentEvent(object sender, DisplayPanelAttachmentEventArgs args);
|
||||
public delegate void DisplayRTBLinkEvent(object sender, LinkClickedEventArgs e);
|
||||
}
|
||||
|
Reference in New Issue
Block a user