</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\Debug</OutputPath>
- <DefineConstants>DEBUG_LAYOUTING0;TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD_TIME0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+ <DefineConstants>DEBUG_LAYOUTING0;TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
</PropertyGroup>
<!-- <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">
<DefineConstants>__linux__</DefineConstants>
/// <summary> Loads the default values from XML attributes default </summary>
protected virtual void loadDefaultValues()
- {
+ {
+ #if DEBUG_LOAD
+ Debug.WriteLine ("LoadDefValues for " + this.ToString ());
+ #endif
+
Type thisType = this.GetType ();
if (Interface.DefaultValuesLoader.ContainsKey(thisType.FullName)) {
Interface.DefaultValuesLoader[thisType.FullName] (this);
Interface.DefaultValuesLoader[thisType.FullName] = (Interface.loadDefaultInvoker)dm.CreateDelegate(typeof(Interface.loadDefaultInvoker));
Interface.DefaultValuesLoader[thisType.FullName] (this);
+ applyStyle ();
}
public virtual GraphicObject FindByName(string nameToFind){
Stream s = Interface.GetStreamFromPath (style);
if (s == null)
throw new Exception ("Style Path not found: " + style);
+
+ #if DEBUG_LOAD
+ Debug.WriteLine ("ApplyStyle for " + this.ToString ());
+ #endif
+
using (StreamReader sr = new StreamReader (s)) {
while (!sr.EndOfStream) {
string tmp = sr.ReadLine ();
void loadPage(int pageNum)
{
- #if DEBUG_LOAD_TIME
+ #if DEBUG_LOAD
Stopwatch loadingTime = new Stopwatch ();
loadingTime.Start ();
#endif
_list.AddChild (page);
- #if DEBUG_LOAD_TIME
+ #if DEBUG_LOAD
loadingTime.Stop ();
Debug.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",
loadingTime.ElapsedTicks,
} else
loadTemplate (Interface.Load (template, this));
- if (this.child == null) {
+ //if no template found, load default one
+ if (this.child == null)
loadTemplate ();
- loadDefaultValues ();
- }
//normal xml read
using (XmlReader xr = new XmlTextReader (tmp, XmlNodeType.Element, null)) {
public static GraphicObject Load (Stream stream, Type type, object hostClass = null)
{
- #if DEBUG_LOAD_TIME
+ #if DEBUG_LOAD
Stopwatch loadingTime = new Stopwatch ();
loadingTime.Start ();
#endif
result = (GraphicObject)xs.Deserialize (stream);
//result.DataSource = hostClass;
- #if DEBUG_LOAD_TIME
+ #if DEBUG_LOAD
FileStream fs = stream as FileStream;
if (fs!=null)
CurrentGOMLPath = fs.Name;