This commit is contained in:
Jsj
2008-05-16 18:13:12 +00:00
parent 8ba64060e2
commit af04fa6ef6
16 changed files with 1240 additions and 595 deletions

View File

@@ -122,7 +122,17 @@ namespace Volian.Controls.Library
//this._MyDSOFramer.OnActivationChange += new AxDSOFramer._DFramerCtlEvents_OnActivationChangeEventHandler(_MyDSOFramer_OnActivationChange);
this.Enter += new EventHandler(DSOTabPanel_Enter);
this.Leave += new EventHandler(DSOTabPanel_Leave);
//this.GotFocus += new EventHandler(DSOTabPanel_GotFocus);
//this.LostFocus += new EventHandler(DSOTabPanel_LostFocus);
}
//void DSOTabPanel_LostFocus(object sender, EventArgs e)
//{
// vlnStackTrace.ShowStack("DSOTabPanel_LostFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
//}
//void DSOTabPanel_GotFocus(object sender, EventArgs e)
//{
// vlnStackTrace.ShowStack("DSOTabPanel_GotFocus {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
//}
#endregion
#region Event Handlers
/// <summary>
@@ -132,6 +142,7 @@ namespace Volian.Controls.Library
/// <param name="e"></param>
void DSOTabPanel_Leave(object sender, EventArgs e)
{
//vlnStackTrace.ShowStack("DSOTabPanel_Leave {0} DocID {1} Index {2} {3}", _In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
_MyTransparentPanel.BringToFront();
}
/// <summary>
@@ -161,6 +172,8 @@ namespace Volian.Controls.Library
{
try
{
this.Enter -= new EventHandler(DSOTabPanel_Enter);
this.Leave -= new EventHandler(DSOTabPanel_Leave);
SaveDirty();
}
catch (Exception ex)
@@ -168,6 +181,8 @@ namespace Volian.Controls.Library
_MyLog.Warn("Before Closing Document ", ex);
}
}
public static bool IgnoreEnter = false;
private bool _In_DSOTabPanel_Enter=false;
/// <summary>
/// When a Word document is selected make sure it's tab is activated and
/// the SelectedItem for the DisplayTabControl is updated.
@@ -176,6 +191,7 @@ namespace Volian.Controls.Library
/// <param name="e"></param>
void DSOTabPanel_Enter(object sender, EventArgs e)
{
if (IgnoreEnter) return;
_MyTransparentPanel.SendToBack();
try
{
@@ -186,8 +202,12 @@ namespace Volian.Controls.Library
{
if (_MyLog.IsErrorEnabled) _MyLog.ErrorFormat("DSOTabPage_Enter", ex);
}
_MyDisplayTabControl.OnItemSelectedChanged(this, null);
if (_In_DSOTabPanel_Enter) return;
vlnStackTrace.ShowStack("DSOTabPanel_Enter {0} DocID {1} Index {2} {3}",_In_DSOTabPanel_Enter, this._MyDocumentInfo.DocID, _MyDisplayTabControl.MyBar.SelectedDockTab, sender.GetType().FullName);
_In_DSOTabPanel_Enter = true;
_MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyDisplayTabItem.MyItemInfo));
_MyDSOFramer.Focus();
_In_DSOTabPanel_Enter = false;
}
#endregion
#region Public Methods

View File

@@ -122,13 +122,13 @@ namespace Volian.Controls.Library
/// <summary>
/// Occurs when the user selects a different item or page
/// </summary>
public event StepPanelEvent ItemSelectedChanged;
public event ItemSelectedChangedEvent ItemSelectedChanged;
/// <summary>
/// Checks to see if the 'ItemSelectedChanged' event is handled and launches it
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
internal void OnItemSelectedChanged(object sender, StepPanelEventArgs args)
internal void OnItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
if (ItemSelectedChanged != null) ItemSelectedChanged(sender, args);
}

View File

@@ -89,7 +89,7 @@ namespace Volian.Controls.Library
if(myTabItem == null)return;
StepTabPanel myTabPanel = myTabItem.MyStepTabPanel as StepTabPanel;
if(myTabPanel == null) return;
_MyDisplayTabControl.OnItemSelectedChanged(this,new StepPanelEventArgs(MyStepTabPanel.SelectedStepItem,null));
_MyDisplayTabControl.OnItemSelectedChanged(this,new ItemSelectedChangedEventArgs(MyStepTabPanel.SelectedStepItem));
}
#endregion
#region private Methods
@@ -133,14 +133,27 @@ namespace Volian.Controls.Library
Text = _MyItemInfo.TabTitle;
Tooltip = _MyItemInfo.TabToolTip;
//
//Console.WriteLine("this.Focus {0}", Name);
//this.Focus();
//Console.WriteLine("Controls.Add {0}", Name);
_MyDisplayTabControl.Controls.Add(_MyDSOTabPanel);
//Console.WriteLine("Enabled = false {0}", Name);
//_MyDisplayTabControl.MyBar.Enabled = false;
DSOTabPanel.IgnoreEnter = true;
Console.WriteLine("AddRange {0}", Name);
_MyDisplayTabControl.MyBar.Items.AddRange(new DevComponents.DotNetBar.BaseItem[] {
this});
//
// tabPanel
//
//Console.WriteLine("Enabled = true {0}", Name);
//_MyDisplayTabControl.MyBar.Enabled = true;
Console.WriteLine("SelectedDisplayTabItem {0}", Name);
_MyDisplayTabControl.SelectedDisplayTabItem = this;
Console.WriteLine("MyDisplayTabItem {0}", Name);
_MyDSOTabPanel.MyDisplayTabItem = this;
DSOTabPanel.IgnoreEnter = false;
_MyDisplayTabControl.OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(MyItemInfo));
}
#endregion
}

View File

@@ -72,13 +72,13 @@ namespace Volian.Controls.Library
/// <summary>
/// Occurs when the selected StepItem changes
/// </summary>
public event StepPanelEvent ItemSelectedChanged;
public event ItemSelectedChangedEvent ItemSelectedChanged;
/// <summary>
/// Checks to see if the 'ItemSelectedChanged' event is handled and launches it
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
internal void OnItemSelectedChanged(object sender, StepPanelEventArgs args)
internal void OnItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
if (ItemSelectedChanged != null) ItemSelectedChanged(sender, args);
}
@@ -308,7 +308,7 @@ namespace Volian.Controls.Library
ExpandAsNeeded(value);
StepItem itm = _LookupStepItems[id];
itm.ItemSelect();
OnItemSelectedChanged(this, new StepPanelEventArgs(itm, null));
OnItemSelectedChanged(this, new ItemSelectedChangedEventArgs(itm));
//vlnStackTrace.ShowStack("_ItemSelected = {0}", _ItemSelected.ItemID);// Show StackTrace
}
}
@@ -736,6 +736,30 @@ namespace Volian.Controls.Library
_MyMouseEventArgs = myMouseEventArgs;
}
}
public partial class ItemSelectedChangedEventArgs
{
private ItemInfo _MyItemInfo;
public ItemInfo MyItemInfo
{
get { return _MyItemInfo; }
set { _MyItemInfo = value; }
}
private StepItem _MyStepItem = null;
public StepItem MyStepItem
{
get { return _MyStepItem; }
set { _MyStepItem = value; }
}
public ItemSelectedChangedEventArgs(ItemInfo myItemInfo)
{
_MyItemInfo = myItemInfo;
}
public ItemSelectedChangedEventArgs(StepItem myStepItem)
{
_MyItemInfo = myStepItem.MyItemInfo;
_MyStepItem = myStepItem;
}
}
public partial class StepPanelAttachmentEventArgs
{
private StepItem _MyStepItem;
@@ -777,6 +801,7 @@ namespace Volian.Controls.Library
}
}
public delegate void StepPanelEvent(object sender, StepPanelEventArgs args);
public delegate void ItemSelectedChangedEvent(object sender, ItemSelectedChangedEventArgs args);
public delegate void StepPanelLinkEvent(object sender, StepPanelLinkEventArgs args);
public delegate void StepPanelAttachmentEvent(object sender, StepPanelAttachmentEventArgs args);
public delegate void StepRTBLinkEvent(object sender, StepPanelLinkEventArgs args);

View File

@@ -120,7 +120,7 @@ namespace Volian.Controls.Library
_MyStepPanel.LinkModifyRO += new StepPanelLinkEvent(_MyStepPanel_LinkModifyRO);
_MyStepPanel.ItemClick +=new Volian.Controls.Library.StepPanelEvent(_MyStepPanel_ItemClick);
_MyStepPanel.AttachmentClicked += new Volian.Controls.Library.StepPanelAttachmentEvent(_MyStepPanel_AttachmentClicked);
_MyStepPanel.ItemSelectedChanged += new StepPanelEvent(_MyStepPanel_ItemSelectedChanged);
_MyStepPanel.ItemSelectedChanged += new ItemSelectedChangedEvent(_MyStepPanel_ItemSelectedChanged);
}
#endregion
#region Event Handlers
@@ -184,7 +184,7 @@ namespace Volian.Controls.Library
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _MyStepPanel_ItemSelectedChanged(object sender, StepPanelEventArgs args)
void _MyStepPanel_ItemSelectedChanged(object sender, ItemSelectedChangedEventArgs args)
{
//_MyTabRibbon.MyDisplayRTB = args.MyDisplayItem.MyDisplayRTB;
_MyStepTabRibbon.MyStepItem = args.MyStepItem;

View File

@@ -0,0 +1,123 @@
<?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.Runtime.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:import namespace="http://www.w3.org/XML/1998/namespace" />
<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" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</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" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</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>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@@ -29,13 +29,62 @@ namespace Volian.Controls.Library
StackTrace st = new StackTrace(true);
StackFrame[] sfs = st.GetFrames();
int ii = 0;
string sLast = "";
string sThis = "";
int imax = MatchingStackFrame(sfs);
foreach (StackFrame sf in sfs)
{
if (imax == 0)
sb.Append(string.Format("\r\n{0}---------", "".PadLeft(ii++ * 2)));
imax--;
if (ii < 2) ii++;
else if (sf.GetFileLineNumber() != 0)
sb.Append(string.Format("\r\n{0}{1}", "".PadLeft(ii++ * 2), sf.ToString().TrimEnd(" \r\n".ToCharArray())));
else
{
string sMethod = sf.GetMethod().Name;
string sNamespace = sf.GetMethod().ReflectedType.Namespace;
string sType = sf.GetMethod().ReflectedType.Name;
if (sf.GetFileLineNumber() != 0)
{
sMethod += string.Format(" {0}[{1}]", sf.GetFileName(), sf.GetFileLineNumber());
sThis = "";
}
else
{
sThis = sNamespace;
}
if (sLast == sThis && sThis != "")
sb.Append(string.Format("\t*.{0}.{1}", sType, sMethod));
else
sb.Append(string.Format("\r\n{0}{1}.{2}.{3}", "".PadLeft(ii++ * 2), sNamespace, sType, sMethod));
}
sLast = sThis;
}
return sb.ToString();
}
private static StackFrame [] _LastSFS;
private static int MatchingStackFrame(StackFrame[] sfs)
{
int iFound = -1;
if (_LastSFS != null)
{
// start at the far end and work backward
for (int i = 1; iFound < 0 && i <= sfs.Length && i <= _LastSFS.Length; i++)
{
if (!Match(sfs[sfs.Length - i],_LastSFS[_LastSFS.Length - i]))
iFound = 1+ sfs.Length - i;
}
}
if (iFound < 0) iFound = sfs.Length;
_LastSFS = (StackFrame[])sfs.Clone();
return iFound;
}
private static bool Match(StackFrame stackFrame1, StackFrame stackFrame2)
{
if (stackFrame1.GetMethod().Name != stackFrame2.GetMethod().Name) return false;
if (stackFrame1.GetMethod().DeclaringType.FullName != stackFrame2.GetMethod().DeclaringType.FullName) return false;
if (stackFrame1.GetILOffset() != stackFrame2.GetILOffset()) return false;
return true;
}
}
}