{
internal ReaderWriterLockSlim parentRWLock = new ReaderWriterLockSlim();
+ public string design_id;
+ public virtual bool FindByDesignID(string designID, out GraphicObject go){
+ go = null;
+ if (this.design_id == designID){
+ go = this;
+ return true;
+ }
+ return false;
+ }
+
#if DESIGN_MODE
static MethodInfo miDesignAddDefLoc = typeof(GraphicObject).GetMethod("design_add_style_location",
BindingFlags.Instance | BindingFlags.NonPublic);
BindingFlags.Instance | BindingFlags.NonPublic);
public volatile bool design_HasChanged = false;
- public string design_id;
public int design_line;
public int design_column;
public string design_imlPath;
// design_iml_locations.Add(memberName, new FileLocation(path,line,col));
// }
- public virtual bool FindByDesignID(string designID, out GraphicObject go){
- go = null;
- if (this.design_id == designID){
- go = this;
- return true;
- }
- return false;
- }
public string GetIML(){
XmlDocument doc = new XmlDocument( );
}
#endregion
- internal static ulong currentUid = 0;
- internal ulong uid = 0;
-
internal bool isPopup = false;
public GraphicObject focusParent {
get { return (isPopup ? LogicalParent : parent) as GraphicObject; }
/// </summary>
protected GraphicObject () {
Clipping = new Region ();
- #if DEBUG
- uid = currentUid;
- currentUid++;
- #endif
}
/// <summary>
/// This constructor **must** be used when creating widget from code.
}
#if DEBUG
[XmlIgnore]public string TreePath {
- get { return this.GetType().Name + uid.ToString (); }
+ get { return Name; }
}
#endif
/// <summary>
/// </summary>
[DesignCategory ("Divers")]
public virtual string Name {
- get {
- #if DEBUG
- return string.IsNullOrEmpty(name) ? this.GetType().Name + uid.ToString () : name;
- #else
- return name;
- #endif
+ get {
+ return string.IsNullOrEmpty(name) ? design_id : name;
}
set {
- if (name == value)
+ if (Name == value)
return;
name = value;
- NotifyValueChanged("Name", name);
+ NotifyValueChanged("Name", Name);
}
}
/// <summary>
internal string sourcePath;
- #if DESIGN_MODE
public static int NextInstantiatorID = 0;
public int currentInstantiatorID = 0;
int currentDesignID = 0;
internal string NextDesignID { get { return string.Format ("{0}_{1}",currentInstantiatorID, currentDesignID++); }}
- #endif
#region CTOR
/// <summary>
/// </summary>
public Instantiator (Interface _iface, Stream stream, string srcPath = null)
{
- #if DESIGN_MODE
currentInstantiatorID = NextInstantiatorID++;
- #endif
iface = _iface;
sourcePath = srcPath;
#if DEBUG_LOAD
/// positionned on the start tag inside the itemTemplate
/// </summary>
public Instantiator (Interface _iface, XmlReader itr){
- #if DESIGN_MODE
currentInstantiatorID = NextInstantiatorID++;
- #endif
iface = _iface;
parseIML (itr);
}
//TODO:check if still used
public Instantiator (Interface _iface, Type _root, InstanciatorInvoker _loader)
{
- #if DESIGN_MODE
currentInstantiatorID = NextInstantiatorID++;
- #endif
iface = _iface;
RootType = _root;
loader = _loader;
using (XmlTextReader reader = new XmlTextReader (tmpXml, XmlNodeType.Element, null)) {
reader.Read ();
- #if DESIGN_MODE
- IXmlLineInfo li = (IXmlLineInfo)reader;
ctx.il.Emit (OpCodes.Ldloc_0);
ctx.il.Emit (OpCodes.Ldstr, this.NextDesignID);
ctx.il.Emit (OpCodes.Stfld, typeof(GraphicObject).GetField("design_id"));
+
+ #if DESIGN_MODE
+ IXmlLineInfo li = (IXmlLineInfo)reader;
ctx.il.Emit (OpCodes.Ldloc_0);
ctx.il.Emit (OpCodes.Ldc_I4, ctx.curLine + li.LineNumber);
ctx.il.Emit (OpCodes.Stfld, typeof(GraphicObject).GetField("design_line"));