]> O.S.I.I.S - jp/crow.git/commitdiff
replace debug.write with console.write
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 18 Nov 2017 02:32:50 +0000 (03:32 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Sat, 18 Nov 2017 02:32:50 +0000 (03:32 +0100)
18 files changed:
src/CompilerServices/CompilerServices.cs
src/GraphicObjects/Expandable.cs
src/GraphicObjects/GenericStack.cs
src/GraphicObjects/GraphicObject.cs
src/GraphicObjects/Group.cs
src/GraphicObjects/Image.cs
src/GraphicObjects/Scroller.cs
src/GraphicObjects/ScrollingTextBox.cs
src/GraphicObjects/TemplatedGroup.cs
src/GraphicObjects/Wrapper.cs
src/IML/Context.cs
src/IML/Reader.cs
src/Instantiator.cs
src/Interface.cs
src/ItemTemplate.cs
src/LayoutingQueueItem.cs
src/PerformanceMeasure.cs
src/XCursor.cs

index 5edcc79e8d8a7ce30f30d10c87e5d210d35e5552..8805c190e3c23141a554c1c2ccc90850b3eb328f 100644 (file)
@@ -286,7 +286,7 @@ namespace Crow
                        MemberInfo miDest = getMemberInfoWithReflexion (dest, destMember);
 
                        if (miDest == null) {
-                               Debug.WriteLine ("Reverse template binding error: " + destMember + " not found in " + dest);
+                               Console.WriteLine ("Reverse template binding error: " + destMember + " not found in " + dest);
                                return;
                        }
 
@@ -312,7 +312,7 @@ namespace Crow
                                        }
                                }
                        } catch (Exception ex) {
-                               Debug.WriteLine (ex.ToString ());
+                               Console.WriteLine (ex.ToString ());
                                return;
                        }
 
@@ -642,7 +642,7 @@ namespace Crow
                        FieldInfo fiEvt = getEventHandlerField (t, eventName);
                        if (fiEvt == null) {
                                #if DEBUG_BINDING
-                               Debug.WriteLine ("RemoveHandlerByName: Event '" + eventName + "' not found in " + instance);
+                               Console.WriteLine ("RemoveHandlerByName: Event '" + eventName + "' not found in " + instance);
                                #endif
                                return;
                        }
@@ -653,7 +653,7 @@ namespace Crow
                                        if (d.Method.Name == delegateName) {
                                                eiEvt.RemoveEventHandler (instance, d);
                                                #if DEBUG_BINDING
-                                               Debug.WriteLine ("\t{0} handler removed in {1} for: {2}", d.Method.Name,instance, eventName);
+                                               Console.WriteLine ("\t{0} handler removed in {1} for: {2}", d.Method.Name,instance, eventName);
                                                #endif
                                        }
                                }
@@ -672,7 +672,7 @@ namespace Crow
                                        if (d.Target == target) {
                                                eiEvt.RemoveEventHandler (instance, d);
                                                #if DEBUG_BINDING
-                                               Debug.WriteLine ("\t{0} handler removed in {1} for: {2}", d.Method.Name,instance, eventName);
+                                               Console.WriteLine ("\t{0} handler removed in {1} for: {2}", d.Method.Name,instance, eventName);
                                                #endif
                                        }
                                }
@@ -685,7 +685,7 @@ namespace Crow
                        Type t = instance.GetType ();
                        MethodInfo mi = t.GetMethod (method, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
                        if (mi == null) {
-                               Debug.WriteLine ("Handler Method '{0}' not found in '{1}'", method, t);
+                               Console.WriteLine ("Handler Method '{0}' not found in '{1}'", method, t);
                                return null;
                        }
                        return Delegate.CreateDelegate (eventType, instance, mi);
@@ -693,7 +693,7 @@ namespace Crow
 
                internal static Delegate compileDynEventHandler(EventInfo sourceEvent, string expression, NodeAddress currentNode = null){
                        #if DEBUG_BINDING
-                       Debug.WriteLine ("\tCompile Event {0}: {1}", sourceEvent.Name, expression);
+                       Console.WriteLine ("\tCompile Event {0}: {1}", sourceEvent.Name, expression);
                        #endif
 
                        Type lopType = null;
index 1cb36450cc5029470445d04b5bccae27a4b2df9a..ad13599046f19812530545231ec50fd16c213383 100644 (file)
@@ -116,7 +116,7 @@ namespace Crow
                                try {
                                        return GetIsExpandable == null ? true : GetIsExpandable (this);
                                } catch (Exception ex) {
-                                       System.Diagnostics.Debug.WriteLine ("Not Expandable error: " + ex.ToString ());
+                                       Console.WriteLine ("Not Expandable error: " + ex.ToString ());
                                        return false;
                                }
                        }
index cecdaffd5116825561ac2114810960b28fe8042b..cb4911ac742d5db4af6445c727634b07ca6d243b 100644 (file)
@@ -138,7 +138,7 @@ namespace Crow
                public override void OnChildLayoutChanges (object sender, LayoutingEventArgs arg)
                {
                        GraphicObject go = sender as GraphicObject;
-                       //Debug.WriteLine ("child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString());
+                       //Console.WriteLine ("child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString());
                        switch (arg.LayoutType) {
                        case LayoutingType.Width:
                                if (Orientation == Orientation.Horizontal) {
@@ -163,7 +163,7 @@ namespace Crow
                                                        stretchedGO.Slot.Width = newW;
                                                        stretchedGO.IsDirty = true;
 #if DEBUG_LAYOUTING
-                                       Debug.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
+                                       Console.WriteLine ("\tAdjusting Width of " + stretchedGO.ToString());
 #endif
                                                        stretchedGO.LayoutChanged -= OnChildLayoutChanges;
                                                        stretchedGO.OnLayoutChanges (LayoutingType.Width);
@@ -202,7 +202,7 @@ namespace Crow
                                                        stretchedGO.Slot.Height = newH;
                                                        stretchedGO.IsDirty = true;
 #if DEBUG_LAYOUTING
-                                       Debug.WriteLine ("\tAdjusting Height of " + stretchedGO.ToString());
+                                       Console.WriteLine ("\tAdjusting Height of " + stretchedGO.ToString());
 #endif
                                                        stretchedGO.LayoutChanged -= OnChildLayoutChanges;
                                                        stretchedGO.OnLayoutChanges (LayoutingType.Height);
index 1ba524d72001d31d5e8c9f4745d490717e9729fe..6118e8c45cd6227767450a7801e7199a881625eb 100644 (file)
@@ -53,14 +53,14 @@ namespace Crow
                protected virtual void Dispose(bool disposing){
                        if (disposed){
                                #if DEBUG_DISPOSE
-                               Debug.WriteLine ("Trying to dispose already disposed obj: {0}", this.ToString());
+                               Console.WriteLine ("Trying to dispose already disposed obj: {0}", this.ToString());
                                #endif
                                return;
                        }
 
                        if (disposing) {
                                #if DEBUG_DISPOSE
-                               Debug.WriteLine ("Disposing: {0}", this.ToString());
+                               Console.WriteLine ("Disposing: {0}", this.ToString());
                                if (IsQueueForRedraw)
                                throw new Exception("Trying to dispose an object queued for Redraw: " + this.ToString());
                                #endif
@@ -80,7 +80,7 @@ namespace Crow
                                        DataSource = null;
                                parent = null;
                        } else
-                               Debug.WriteLine ("!!! Finalized by GC: {0}", this.ToString ());
+                               Console.WriteLine ("!!! Finalized by GC: {0}", this.ToString ());
                        Clipping?.Dispose ();
                        bmp?.Dispose ();
                        disposed = true;
@@ -112,7 +112,7 @@ namespace Crow
                public event EventHandler<ValueChangeEventArgs> ValueChanged;
                public virtual void NotifyValueChanged(string MemberName, object _value)
                {
-                       //Debug.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
+                       //Console.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
                        ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
                }
                #endregion
@@ -675,7 +675,7 @@ namespace Crow
                public virtual void OnDataSourceChanged(object sender, DataSourceChangeEventArgs e){
                        DataSourceChanged.Raise (this, e);
                        #if DEBUG_BINDING
-                       Debug.WriteLine("New DataSource for => {0} \n\t{1}=>{2}", this.ToString(),e.OldDataSource,e.NewDataSource);
+                       Console.WriteLine("New DataSource for => {0} \n\t{1}=>{2}", this.ToString(),e.OldDataSource,e.NewDataSource);
                        #endif
                }
 
@@ -698,7 +698,7 @@ namespace Crow
                public void loadDefaultValues()
                {
                        #if DEBUG_LOAD
-                       Debug.WriteLine ("LoadDefValues for " + this.ToString ());
+                       Console.WriteLine ("LoadDefValues for " + this.ToString ());
                        #endif
 
                        Type thisType = this.GetType ();
@@ -792,7 +792,7 @@ namespace Crow
                                                il.Emit (OpCodes.Castclass, ei.EventHandlerType);
                                                il.Emit (OpCodes.Callvirt, ei.AddMethod);
                                        }else
-                                               Debug.WriteLine("error in styling, event not handled : " + trimed);
+                                               Console.WriteLine("error in styling, event not handled : " + trimed);
                                }
                        }
 
@@ -902,7 +902,7 @@ namespace Crow
                /// </summary>
                public virtual void ClippingRegistration(){
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("ClippingRegistration -> {0}", this.ToString ()));
+                       Console.WriteLine (string.Format("ClippingRegistration -> {0}", this.ToString ()));
                        #endif
                        IsQueueForRedraw = false;
                        if (Parent == null)
@@ -916,7 +916,7 @@ namespace Crow
                /// <param name="clip">Clip rectangle</param>
                public virtual void RegisterClip(Rectangle clip){
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("RegisterClip -> {1}:{0}", clip, this.ToString ()));
+                       Console.WriteLine (string.Format("RegisterClip -> {1}:{0}", clip, this.ToString ()));
                        #endif
                        Rectangle  r = clip + ClientRectangle.Position;
                        if (CacheEnabled && !IsDirty)
@@ -933,7 +933,7 @@ namespace Crow
                public void RegisterForGraphicUpdate ()
                {
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("RegisterForGraphicUpdate (IsDirty set)-> {0}", this.ToString ()));
+                       Console.WriteLine (string.Format("RegisterForGraphicUpdate (IsDirty set)-> {0}", this.ToString ()));
                        #endif
                        IsDirty = true;
                        if (Width.IsFit || Height.IsFit)
@@ -946,7 +946,7 @@ namespace Crow
                public void RegisterForRedraw ()
                {
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("RegisterForRedraw (IsDirty set)-> {0}", this.ToString ()));
+                       Console.WriteLine (string.Format("RegisterForRedraw (IsDirty set)-> {0}", this.ToString ()));
                        #endif
                        IsDirty = true;
                        if (RegisteredLayoutings == LayoutingType.None)
@@ -1013,7 +1013,7 @@ namespace Crow
                        #if DEBUG_LAYOUTING
                        CurrentInterface.currentLQI.Slot = LastSlots;
                        CurrentInterface.currentLQI.NewSlot = Slot;
-                       Debug.WriteLine ("\t\t{0} => {1}",LastSlots,Slot);
+                       Console.WriteLine ("\t\t{0} => {1}",LastSlots,Slot);
                        #endif
 
                        switch (layoutType) {
@@ -1037,7 +1037,7 @@ namespace Crow
                public virtual bool UpdateLayout (LayoutingType layoutType)
                {
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("UpdateLayout ({1})-> {0}", this.ToString (), layoutType));
+                       Console.WriteLine (string.Format("UpdateLayout ({1})-> {0}", this.ToString (), layoutType));
                        #endif
                        //unset bit, it would be reset if LQI is re-queued
                        registeredLayoutings &= (~layoutType);
@@ -1190,7 +1190,7 @@ namespace Crow
                protected virtual void onDraw(Context gr)
                {
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("OnDraw -> {0}", this.ToString ()));
+                       Console.WriteLine (string.Format("OnDraw -> {0}", this.ToString ()));
                        #endif
 
                        Rectangle rBack = new Rectangle (Slot.Size);
@@ -1206,7 +1206,7 @@ namespace Crow
                protected virtual void RecreateCache ()
                {
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("RecreateCache -> {0}", this.ToString ()));
+                       Console.WriteLine (string.Format("RecreateCache -> {0}", this.ToString ()));
                        #endif
                        IsDirty = false;
                        if (bmp != null)
@@ -1220,7 +1220,7 @@ namespace Crow
                }
                protected virtual void UpdateCache(Context ctx){
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("UpdateCache -> {0}", this.ToString ()));
+                       Console.WriteLine (string.Format("UpdateCache -> {0}", this.ToString ()));
                        #endif
                        Rectangle rb = Slot + Parent.ClientRectangle.Position;
                        if (clearBackground) {
@@ -1240,7 +1240,7 @@ namespace Crow
                public virtual void Paint (ref Context ctx)
                {
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("Paint -> {0}", this.ToString ()));
+                       Console.WriteLine (string.Format("Paint -> {0}", this.ToString ()));
                        #endif
                        //TODO:this test should not be necessary
                        if (Slot.Height < 0 || Slot.Width < 0 || parent == null)
@@ -1391,14 +1391,14 @@ namespace Crow
                public virtual void onMouseEnter(object sender, MouseMoveEventArgs e)
                {
                        #if DEBUG_FOCUS
-                       Debug.WriteLine("MouseEnter => " + this.ToString());
+                       Console.WriteLine("MouseEnter => " + this.ToString());
                        #endif
                        MouseEnter.Raise (this, e);
                }
                public virtual void onMouseLeave(object sender, MouseMoveEventArgs e)
                {
                        #if DEBUG_FOCUS
-                       Debug.WriteLine("MouseLeave => " + this.ToString());
+                       Console.WriteLine("MouseLeave => " + this.ToString());
                        #endif
                        MouseLeave.Raise (this, e);
                }
@@ -1406,13 +1406,13 @@ namespace Crow
 
                protected virtual void onFocused(object sender, EventArgs e){
                        #if DEBUG_FOCUS
-                       Debug.WriteLine("Focused => " + this.ToString());
+                       Console.WriteLine("Focused => " + this.ToString());
                        #endif
                        Focused.Raise (this, e);
                }
                protected virtual void onUnfocused(object sender, EventArgs e){
                        #if DEBUG_FOCUS
-                       Debug.WriteLine("UnFocused => " + this.ToString());
+                       Console.WriteLine("UnFocused => " + this.ToString());
                        #endif
                        Unfocused.Raise (this, e);
                }
@@ -1432,7 +1432,7 @@ namespace Crow
                }
                internal void ClearTemplateBinding(){
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("ClearTemplateBinding: {0}", this.ToString()));
+                       Console.WriteLine (string.Format("ClearTemplateBinding: {0}", this.ToString()));
                        #endif
                        if (ValueChanged == null)
                                return;
@@ -1441,7 +1441,7 @@ namespace Crow
                                if (d.Method.Name == "dyn_tmpValueChanged") {
                                        eiEvt.RemoveEventHandler (this, d);
                                        #if DEBUG_BINDING
-                                       Debug.WriteLine ("\t{0} template binding handler removed in {1} for: {2}", d.Method.Name, this, "ValueChanged");
+                                       Console.WriteLine ("\t{0} template binding handler removed in {1} for: {2}", d.Method.Name, this, "ValueChanged");
                                        #endif
                                }
                        }
index e4e9ba2047db34693c47ef3931751c272992aa27..f84191e2a80939e9f9eb2d44363eafbbdca535d6 100644 (file)
@@ -312,7 +312,7 @@ namespace Crow
                }
                void searchLargestChild(){
                        #if DEBUG_LAYOUTING
-                       Debug.WriteLine("\tSearch largest child");
+                       Console.WriteLine("\tSearch largest child");
                        #endif
                        largestChild = null;
                        contentSize.Width = 0;
@@ -329,7 +329,7 @@ namespace Crow
                }
                void searchTallestChild(){
                        #if DEBUG_LAYOUTING
-                       Debug.WriteLine("\tSearch tallest child");
+                       Console.WriteLine("\tSearch tallest child");
                        #endif
                        tallestChild = null;
                        contentSize.Height = 0;
index 6a4c590d0b274ed27b17c3343e2e68fd8a7538c2..c463581a39d8536d3ac73c6525f9468f1d01aac9 100644 (file)
@@ -84,7 +84,7 @@ namespace Crow
                                                }
                                        }
                                } catch (Exception ex) {
-                                       Debug.WriteLine (ex.Message);
+                                       Console.WriteLine (ex.Message);
                                        _pic = null;
                                }
                                NotifyValueChanged ("Path", Path);
index e38b2205dd2fc7b6e88cbe5d30c04fb3245299bb..8bedfa2405aab9da9ddb94af63a039b77bd09ce5 100644 (file)
@@ -134,20 +134,20 @@ namespace Crow
                }
                void OnChildLayoutChanges (object sender, LayoutingEventArgs arg)
                {
-                       //Debug.WriteLine ("scroller childLayoutChanges");
+                       //Console.WriteLine ("scroller childLayoutChanges");
                        int maxScroll = MaximumScroll;
-                       //Debug.WriteLine ("maxscroll={0}", maxScroll);
+                       //Console.WriteLine ("maxscroll={0}", maxScroll);
                        if (_verticalScrolling) {
                                if (arg.LayoutType == LayoutingType.Height) {
                                        if (maxScroll < ScrollY) {
-                                               //Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);
+                                               //Console.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);
                                                ScrollY = maxScroll;
                                        }
                                        NotifyValueChanged("MaximumScroll", maxScroll);
                                }
                        } else if (arg.LayoutType == LayoutingType.Width) {
                                if (maxScroll < ScrollX) {
-                                       //Debug.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);
+                                       //Console.WriteLine ("scrolly={0} maxscroll={1}", ScrollY, maxScroll);
                                        ScrollX = maxScroll;
                                }
                                NotifyValueChanged("MaximumScroll", maxScroll);
index a435f9ee6bf042dcbed486d0e84f1a37a49a4bbd..292aab8937e2883227445a80040e27421c9e0222 100644 (file)
@@ -174,7 +174,7 @@ namespace Crow
                                if (value == _selBegin)
                                        return;
                                _selBegin = value;
-                               System.Diagnostics.Debug.WriteLine ("SelBegin=" + _selBegin);
+                               Console.WriteLine ("SelBegin=" + _selBegin);
                                NotifyValueChanged ("SelBegin", _selBegin);
                                NotifyValueChanged ("SelectedText", SelectedText);
                        }
@@ -423,7 +423,7 @@ namespace Crow
                                        rLineY = cb.Y + i * fe.Height,
                                        rLineW = lstr.Length * fe.MaxXAdvance;
 
-                                       System.Diagnostics.Debug.WriteLine ("sel start: " + selectionStart + " sel end: " + selectionEnd);
+                                       Console.WriteLine ("sel start: " + selectionStart + " sel end: " + selectionEnd);
                                        if (curL == selectionStart.Y) {
                                                rLineX += (selectionStart.X - ScrollX) * fe.MaxXAdvance;
                                                rLineW -= selectionStart.X * fe.MaxXAdvance;
@@ -751,8 +751,8 @@ namespace Crow
                        visibleLines = (int)Math.Floor ((double)ClientRectangle.Height / fe.Height);
                        MaxScrollY = Math.Max (0, lines.Count - visibleLines);
 
-                       System.Diagnostics.Debug.WriteLine ("update visible lines: " + visibleLines);
-                       System.Diagnostics.Debug.WriteLine ("update MaxScrollY: " + MaxScrollY);
+                       Console.WriteLine ("update visible lines: " + visibleLines);
+                       Console.WriteLine ("update MaxScrollY: " + MaxScrollY);
                }
 
 
index 60f18994707f7198c646a43742f681228bfc20f4..a70b3918e7fe7c6802082e9f04e22286c708ea0a 100644 (file)
@@ -332,7 +332,7 @@ namespace Crow
 
                        #if DEBUG_LOAD
                        loadingTime.Stop ();
-                       Debug.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",
+                       Console.WriteLine("Listbox {2} Loading: {0} ticks \t, {1} ms",
                        loadingTime.ElapsedTicks,
                        loadingTime.ElapsedMilliseconds, this.ToString());
                        #endif
@@ -400,7 +400,7 @@ namespace Crow
 //             protected void _list_LayoutChanged (object sender, LayoutingEventArgs e)
 //             {
 //                     #if DEBUG_LAYOUTING
-//                     Debug.WriteLine("list_LayoutChanged");
+//                     Console.WriteLine("list_LayoutChanged");
 //                     #endif
 //                     if (_gsList.Orientation == Orientation.Horizontal) {
 //                             if (e.LayoutType == LayoutingType.Width)
index 8b282ebbce528908981925d1af7d6e5fee849031..b0fa5dfeacf29a03578a51ada9955bbcf2a9d1ad 100644 (file)
@@ -88,7 +88,7 @@ namespace Crow
                {
                        //children can't stretch in a wrapper
                        GraphicObject go = sender as GraphicObject;
-                       //System.Diagnostics.Debug.WriteLine ("wrapper child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString());
+                       //Console.WriteLine ("wrapper child layout change: " + go.LastSlots.ToString() + " => " + go.Slot.ToString());
                        switch (arg.LayoutType) {
                        case LayoutingType.Width:
                                if (Orientation == Orientation.Horizontal && go.Width.Units == Unit.Percent){
index fb1035808427cf3431046e3fc7b041105ab67e38..d4cc3149750ebfe7acb928948f69f61de80ce57e 100644 (file)
@@ -117,7 +117,7 @@ namespace Crow.IML
                                        try {
                                                ResolveName (bd);       
                                        } catch (Exception ex) {
-                                               System.Diagnostics.Debug.WriteLine (ex.ToString ());
+                                               Console.WriteLine (ex.ToString ());
                                                continue;
                                        }
                                }
index 7a0c8405d5b6075d87e9fdc47b57f03f86fab05b..9758b290608c7b339a9a18ff86e962404c705ab6 100644 (file)
@@ -207,7 +207,7 @@ namespace Crow.IML2
                                        Array.Copy (target, nodeIdx, dest, 0, destLength);
 
                                } catch (Exception ex) {
-                                       System.Diagnostics.Debug.WriteLine (ex.ToString ());
+                                       System.Diagnostics.Console.WriteLine (ex.ToString ());
                                }
 
 
index 6cda11c3b854139bf2fef8fb94c929dcca1a9550..b47d9f1bf89575d05070255dafde4e649598b875 100644 (file)
@@ -77,7 +77,7 @@ namespace Crow
                        }
 #if DEBUG_LOAD
                        loadingTime.Stop ();
-                       Debug.WriteLine ("IML Instantiator creation '{2}' : {0} ticks, {1} ms",
+                       Console.WriteLine ("IML Instantiator creation '{2}' : {0} ticks, {1} ms",
                                loadingTime.ElapsedTicks, loadingTime.ElapsedMilliseconds, imlPath);
 #endif
                }
@@ -391,7 +391,7 @@ namespace Crow
                        BindingDefinition bindingDef = sourceNA.GetBindingDef (sourceMember, expression);
 
                        #if DEBUG_BINDING
-                       Debug.WriteLine("Property Binding: " + bindingDef.ToString());
+                       Console.WriteLine("Property Binding: " + bindingDef.ToString());
                        #endif
 
                        if (bindingDef.IsDataSourceBinding)//bind on data source
@@ -426,7 +426,7 @@ namespace Crow
                        BindingDefinition bindingDef = currentNode.GetBindingDef (sourceEvent.Name, expression);
 
                        #if DEBUG_BINDING
-                       Debug.WriteLine("Event Binding: " + bindingDef.ToString());
+                       Console.WriteLine("Event Binding: " + bindingDef.ToString());
                        #endif
 
                        if (bindingDef.IsTemplateBinding | bindingDef.IsDataSourceBinding) {
@@ -604,7 +604,7 @@ namespace Crow
                        ctx.emitCachedDelegateHandlerAddition (dmIdx, CompilerServices.eiValueChange, origine);
 
                        #if DEBUG_BINDING
-                       Debug.WriteLine("\tCrow property binding: " + dm.Name);
+                       Console.WriteLine("\tCrow property binding: " + dm.Name);
                        #endif
 
                }
@@ -676,7 +676,7 @@ namespace Crow
 
                                foreach (MemberAddress ma in bindingCase.Value) {
                                        if (ma.Address.Count == 0){
-                                               Debug.WriteLine("\t\tBUG: reverse template binding in normal template binding");
+                                               Console.WriteLine("\t\tBUG: reverse template binding in normal template binding");
                                                continue;//template binding
                                        }
                                        //first we try to get memberInfo of new parent, if it doesn't exist, it's a propery less binding
@@ -920,8 +920,8 @@ namespace Crow
                        ctx.emitCachedDelegateHandlerAddition(delDSIndex, CompilerServices.eiDSChange);
 
                        #if DEBUG_BINDING
-                       Debug.WriteLine("\tDataSource ValueChanged: " + delName);
-                       Debug.WriteLine("\tDataSource Changed: " + dm.Name);
+                       Console.WriteLine("\tDataSource ValueChanged: " + delName);
+                       Console.WriteLine("\tDataSource Changed: " + dm.Name);
                        #endif
                }
                /// <summary>
@@ -939,11 +939,11 @@ namespace Crow
                        PropertyInfo piDest = tDest.GetProperty (destMember);
 
                        if (piDest == null) {
-                               Debug.WriteLine ("Member '{0}' not found in new DataSource '{1}' of '{2}'", destMember, dest, orig);
+                               Console.WriteLine ("Member '{0}' not found in new DataSource '{1}' of '{2}'", destMember, dest, orig);
                                return;
                        }
                        #if DEBUG_BINDING
-                       Debug.WriteLine ("DS Reverse binding: Member '{0}' found in new DS '{1}' of '{2}'", destMember, dest, orig);
+                       Console.WriteLine ("DS Reverse binding: Member '{0}' found in new DS '{1}' of '{2}'", destMember, dest, orig);
                        #endif
 
                        #region ValueChanged emit
index c1c96d489ae907c07cd0c055a0125b4081e59e2a..07c7afbf1b0c4cde408bb71e50fe41ddf91dd188 100644 (file)
@@ -50,8 +50,17 @@ namespace Crow
        ///     - Keyboard and Mouse logic
        ///     - the resulting bitmap of the interface
        /// </summary>
-       public class Interface : ILayoutable
+       public class Interface : ILayoutable, IValueChange
        {
+               #region IValueChange implementation
+               public event EventHandler<ValueChangeEventArgs> ValueChanged;
+               public void NotifyValueChanged(string MemberName, object _value)
+               {
+                       //Console.WriteLine ("Value changed: {0}->{1} = {2}", this, MemberName, _value);
+                       ValueChanged.Raise(this, new ValueChangeEventArgs(MemberName, _value));
+               }
+               #endregion
+
                [MethodImplAttribute(MethodImplOptions.InternalCall)][System.Security.SecuritySafeCriticalAttribute]
                internal static extern void crow_mono_update(IntPtr region, byte[] bitmap);
 
@@ -64,8 +73,8 @@ namespace Crow
                        FontRenderingOptions = new FontOptions ();
                        FontRenderingOptions.Antialias = Antialias.Subpixel;
                        FontRenderingOptions.HintMetrics = HintMetrics.On;
-                       FontRenderingOptions.HintStyle = HintStyle.Medium;
-                       FontRenderingOptions.SubpixelOrder = SubpixelOrder.Rgb;
+                       FontRenderingOptions.HintStyle = HintStyle.Full;
+                       //FontRenderingOptions.SubpixelOrder = SubpixelOrder.Rgb;
                }
                public Interface(){
                        CurrentInterface = this;
@@ -277,7 +286,7 @@ namespace Crow
                        lock (UpdateMutex) {
                                GraphicObject tmp = Load (path);
                                AddWidget (tmp);
-
+                               tmp.DataSource = this;
                                return tmp;
                        }
                }
@@ -342,9 +351,9 @@ namespace Crow
                                {
                                        _activeWidget.IsActive = true;
                                        #if DEBUG_FOCUS
-                                       Debug.WriteLine("Active => " + _activeWidget.ToString());
+                                       Console.WriteLine("Active => " + _activeWidget.ToString());
                                }else
-                                       Debug.WriteLine("Active => null");
+                                       Console.WriteLine("Active => null");
                                        #else
                                }
                                        #endif
@@ -360,9 +369,9 @@ namespace Crow
                                _hoverWidget = value;
                                #if DEBUG_FOCUS
                                if (_hoverWidget != null)
-                               Debug.WriteLine("Hover => " + _hoverWidget.ToString());
+                               Console.WriteLine("Hover => " + _hoverWidget.ToString());
                                else
-                               Debug.WriteLine("Hover => null");
+                               Console.WriteLine("Hover => null");
                                #endif
                        }
                }
@@ -390,7 +399,7 @@ namespace Crow
                public void EnqueueForRepaint(GraphicObject g)
                {
                        #if DEBUG_UPDATE
-                       Debug.WriteLine (string.Format("\tEnqueueForRepaint -> {0}", g?.ToString ()));
+                       Console.WriteLine (string.Format("\tEnqueueForRepaint -> {0}", g?.ToString ()));
                        #endif
                        lock (DrawingQueue) {
                                if (g.IsQueueForRedraw)
@@ -407,12 +416,12 @@ namespace Crow
                ///     - Drawing
                /// Result: the Interface bitmap is drawn in memory (byte[] bmp) and a dirtyRect and bitmap are available
                /// </summary>
-               public void Update(){
-                       if (mouseRepeatCount > 0) {
+               public void Update(){                   
+                       if (mouseRepeatCount > 0) {                             
                                int mc = mouseRepeatCount;
                                mouseRepeatCount -= mc;
                                if (_focusedWidget != null) {
-                                       for (int i = 0; i < mc; i++) {
+                                       for (int i = 0; i < mc; i++) {                                          
                                                _focusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true));
                                        }
                                }
@@ -473,7 +482,7 @@ namespace Crow
 
                        if (Monitor.TryEnter (LayoutMutex)) {
                                DiscardQueue = new Queue<LayoutingQueueItem> ();
-                               //Debug.WriteLine ("======= Layouting queue start =======");
+                               //Console.WriteLine ("======= Layouting queue start =======");
                                LayoutingQueueItem lqi;
                                while (LayoutingQueue.Count > 0) {
                                        lqi = LayoutingQueue.Dequeue ();
@@ -844,6 +853,7 @@ namespace Crow
                KeyboardKeyEventArgs lastKeyDownEvt;
                void mouseRepeatThreadFunc()
                {
+                       
                        mouseRepeatOn = true;
                        Thread.Sleep (Interface.DeviceRepeatDelay);
                        while (mouseRepeatOn) {
index 5361904292531a2f09258302fe824057d607c31d..0d1937b06baee44164061d4cbf0ca99e932abd13 100644 (file)
@@ -76,7 +76,7 @@ namespace Crow
                                }
                        }
                        if (dataType == null) {
-                               Debug.WriteLine ("ItemTemplate error: DataType not found: {0}.", strDataType);
+                               Console.WriteLine ("ItemTemplate error: DataType not found: {0}.", strDataType);
                                return;
                        }
                        Type tmpGrpType = typeof(TemplatedGroup);
index e87c4146527bd6aba9659a83dddce785d0df2eb9..26425d1f5b8169ef4e598d5e2169de8f52db6ac9 100644 (file)
@@ -89,7 +89,7 @@ namespace Crow
                        LQITime = new Stopwatch();
                        Slot = Rectangle.Empty;
                        NewSlot = Rectangle.Empty;
-                       Debug.WriteLine ("\tRegister => " + this.ToString ());
+                       Console.WriteLine ("\tRegister => " + this.ToString ());
                        #endif
                }
                #endregion
@@ -101,25 +101,25 @@ namespace Crow
                                //cancel layouting for object without parent, maybe some were in queue when
                                //removed from a listbox
                                #if DEBUG_UPDATE || DEBUG_LAYOUTING
-                               Debug.WriteLine ("ERROR: processLayouting, no parent for: " + this.ToString ());
+                               Console.WriteLine ("ERROR: processLayouting, no parent for: " + this.ToString ());
                                #endif
                                return;
                        }
                        #if DEBUG_LAYOUTING
                        LQITime.Start();
-                       Debug.WriteLine ("=> " + this.ToString ());
+                       Console.WriteLine ("=> " + this.ToString ());
                        #endif
                        LayoutingTries++;
                        if (!Layoutable.UpdateLayout (LayoutType)) {
                                #if DEBUG_LAYOUTING
-                               Debug.WriteLine ("\t\tRequeued");
+                               Console.WriteLine ("\t\tRequeued");
                                #endif
                                if (LayoutingTries < Interface.MaxLayoutingTries) {
                                        Layoutable.RegisteredLayoutings |= LayoutType;
                                        (Layoutable as GraphicObject).CurrentInterface.LayoutingQueue.Enqueue (this);
                                } else if (DiscardCount < Interface.MaxDiscardCount) {
                                        #if DEBUG_LAYOUTING
-                                       Debug.WriteLine ("\t\tDiscarded");
+                                       Console.WriteLine ("\t\tDiscarded");
                                        #endif
                                        LayoutingTries = 0;
                                        DiscardCount++;
@@ -128,13 +128,13 @@ namespace Crow
                                }
                                #if DEBUG_LAYOUTING
                                else
-                                       Debug.WriteLine ("\tDELETED    => " + this.ToString ());
+                                       Console.WriteLine ("\tDELETED    => " + this.ToString ());
                                #endif
                        }
                        #if DEBUG_LAYOUTING
                        else{
                                if (LayoutingTries > 2 || DiscardCount > 0)
-                                       Debug.WriteLine (this.ToString ());
+                                       Console.WriteLine (this.ToString ());
                        }
                        LQITime.Stop();
                        #endif
index 3c978e8b473e379353b63c7aee19e80300eca9f1..ee81302caf2364027f09ae9a1a9dd36c9062a983 100644 (file)
@@ -82,7 +82,7 @@ namespace Crow
                                maximum = timer.ElapsedTicks;                   
                }
                void ResetStats(){
-                       Debug.WriteLine("reset measure cpt:{0}",cptMeasures);
+                       Console.WriteLine("reset measure cpt:{0}",cptMeasures);
                        cptMeasures = total = current = maximum = 0;
                        minimum = long.MaxValue;
                }
index 627e2afdd473aa1cd70bc0580537b3a99fc3672c..6835715d2d2860b03d9285c024a2a493695206f4 100644 (file)
@@ -61,7 +61,7 @@ namespace Crow
                                byte[] data;
                                //magic: CARD32 ’Xcur’ (0x58, 0x63, 0x75, 0x72)
                                if (new string (sr.ReadChars (4)) != "Xcur") {
-                                       Debug.WriteLine ("XCursor Load error: Wrong magic");
+                                       Console.WriteLine ("XCursor Load error: Wrong magic");
                                        return null;
                                }
                                //header: CARD32 bytes in this header