Object and Property name changes for consistency

This commit is contained in:
Rich
2008-03-27 19:39:10 +00:00
parent 7caa952bc3
commit c0511c990d
19 changed files with 2229 additions and 1407 deletions

View File

@@ -12,17 +12,12 @@ using System.Reflection;
namespace Volian.Controls.Library
{
public enum LinkType : int
{
ReferencedObject = 21,
Transition = 9516,
TransitionRange = 9574
}
public partial class DisplayRTBSimple : RichTextBox, IDisplayRTB
public partial class StepRTBSimple : RichTextBox, IStepRTB
{
#region Fields
private StepItem _MyStepItem;
private IContainer _Container = null;
private ItemInfo _MyItem;
private ItemInfo _MyItemInfo;
private Size _AdjustSize;
private Rectangle _ContentsRectangle;
private E_EditPrintMode _EpMode;
@@ -65,15 +60,23 @@ namespace Volian.Controls.Library
//}
#endregion
#region Events
public event DisplayRTBLinkEvent LinkGoTo;
private void OnLinkGoTo(object sender,LinkClickedEventArgs args)
/// <summary>
/// Occurs in response to Link GoTo
/// </summary>
public event StepRTBLinkEvent LinkGoTo;
/// <summary>
/// Checks to see if the LinkGoTo event is handled and launches it.
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private void OnLinkGoTo(object sender, StepPanelLinkEventArgs args)
{
if (LinkGoTo != null) LinkGoTo(sender, args);
}
/// <summary>
/// Occurs when a content or format change causes the box to get taller or shorter
/// </summary>
public event DisplayRTBEvent HeightChanged;
public event StepRTBEvent HeightChanged;
/// <summary>
/// Checks to see if the HeightChanged event is handled and launches it
/// </summary>
@@ -90,18 +93,18 @@ namespace Volian.Controls.Library
/// </summary>
/// <param name="match"></param>
/// <returns></returns>
public ItemInfo MyItem
public ItemInfo MyItemInfo
{
get { return _MyItem; }
get { return _MyItemInfo; }
set
{
_MyItem = value;
_MyItemInfo = value;
if (value != null)
{
//// TIMING: DisplayItem.TimeIt("rtbMyItem Start");
//if (value.ItemID == 90)
// if(_MyLog.IsInfoEnabled)_MyLog.InfoFormat(value.MyContent.Text);
string txt = _MyItem.MyContent.Text;
string txt = _MyItemInfo.MyContent.Text;
txt = txt.Replace("\n", "\r\n\\par ");
//txt = Regex.Replace(txt, "(.){([0-9]*){([0-9 ]*)}}",FixTransition);
//txt = Regex.Replace(txt, @"(.)\\v TRAN", FixTransition);
@@ -132,6 +135,11 @@ namespace Volian.Controls.Library
}
}
}
public StepItem MyStepItem
{
get { return _MyStepItem; }
set { _MyStepItem = value; }
}
public Size AdjustSize
{
get { return _AdjustSize; }
@@ -164,7 +172,7 @@ namespace Volian.Controls.Library
//int transitionID = Convert.ToInt32(match.Groups[2].Value);
int transitionID = Convert.ToInt32(match.Groups[4].Value.Split(" ".ToCharArray())[1]);
// Find the transition
foreach (TransitionInfo ti in _MyItem.MyContent.ContentTransitions)
foreach (TransitionInfo ti in _MyItemInfo.MyContent.ContentTransitions)
{
if (ti.TransitionID == transitionID)
{
@@ -227,23 +235,23 @@ namespace Volian.Controls.Library
//ContextMenuStrip = this.contextMenuStrip1;
//ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
//this.TextChanged += new EventHandler(VERichTextBox_TextChanged);
this.ContentsResized += new ContentsResizedEventHandler(VERichTextBox_ContentsResized);
this.ContentsResized += new ContentsResizedEventHandler(StepRTBSimple_ContentsResized);
//if (Text != "") ResizeForText();
this.LinkClicked += new LinkClickedEventHandler(DisplayRTBSimple_LinkClicked);
this.LinkClicked += new LinkClickedEventHandler(StepRTBSimple_LinkClicked);
}
void DisplayRTBSimple_LinkClicked(object sender, LinkClickedEventArgs e)
void StepRTBSimple_LinkClicked(object sender, LinkClickedEventArgs args)
{
OnLinkGoTo(sender, e);
OnLinkGoTo(sender, new StepPanelLinkEventArgs(_MyStepItem, args.LinkText));
}
#endregion
#region Constructors
public DisplayRTBSimple()
public StepRTBSimple()
{
InitializeComponent();
SetUp();
}
public DisplayRTBSimple(IContainer container)
public StepRTBSimple(IContainer container)
{
container.Add(this);
InitializeComponent();
@@ -252,7 +260,7 @@ namespace Volian.Controls.Library
}
#endregion
#region Event Handlers
void VERichTextBox_ContentsResized(object sender, ContentsResizedEventArgs e)
void StepRTBSimple_ContentsResized(object sender, ContentsResizedEventArgs e)
{
this.Height = e.NewRectangle.Height;
OnHeightChanged(sender, new EventArgs());
@@ -260,10 +268,11 @@ namespace Volian.Controls.Library
#endregion
}
[TypeConverter(typeof(ExpandableObjectConverter))]
public interface IDisplayRTB
public interface IStepRTB
{
event DisplayRTBEvent HeightChanged;
ItemInfo MyItem { get; }
event StepRTBEvent HeightChanged;
ItemInfo MyItemInfo { get; set;}
StepItem MyStepItem { get; set;}
Size AdjustSize { get; set; }
Rectangle ContentsRectangle { get; set; }
E_EditPrintMode EpMode { get; set; }
@@ -274,5 +283,11 @@ namespace Volian.Controls.Library
// public DisplayRTBSimple()
// public DisplayRTBSimple(IContainer container)
}
public enum LinkType : int
{
ReferencedObject = 21,
Transition = 9516,
TransitionRange = 9574
}
}