]> O.S.I.I.S - jp/crowedit.git/commitdiff
wip, save commit before node editing
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 11 Oct 2021 08:09:02 +0000 (08:09 +0000)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Mon, 11 Oct 2021 08:09:02 +0000 (08:09 +0000)
31 files changed:
CrowEditBase/src/CrowEditBase.cs
CrowEditBase/src/Project.cs
CrowEditBase/src/SourceEditor.cs
CrowEditBase/src/TreeNode.cs
CrowEditBase/ui/CrowEdit.style
CrowEditBase/ui/TreeExpandable.template
plugins/CECrowPlugin/src/CrowService.cs
plugins/CECrowPlugin/src/DebugInterface.cs
plugins/CECrowPlugin/src/DebugInterfaceWidget.cs
plugins/CECrowPlugin/src/ImlDocument.cs
plugins/CECrowPlugin/src/Parsing/ImlTokenizer.cs [new file with mode: 0644]
plugins/CECrowPlugin/src/Parsing/StyleTokenType.cs [new file with mode: 0644]
plugins/CECrowPlugin/src/Parsing/StyleTokenizer.cs [new file with mode: 0644]
plugins/CECrowPlugin/src/Parsing/SyntaxAnalyser.cs [new file with mode: 0644]
plugins/CECrowPlugin/src/Parsing/SyntaxNodes.cs [new file with mode: 0644]
plugins/CECrowPlugin/src/StyleParsing/StyleTokenType.cs [deleted file]
plugins/CECrowPlugin/src/StyleParsing/StyleTokenizer.cs [deleted file]
plugins/CECrowPlugin/src/StyleParsing/SyntaxAnalyser.cs [deleted file]
plugins/CECrowPlugin/src/StyleParsing/SyntaxNodes.cs [deleted file]
plugins/CECrowPlugin/ui/winConfiguration.crow
plugins/CERoslynPlugin/CERoslynPlugin.csproj
plugins/CERoslynPlugin/src/CELogger.cs
plugins/CERoslynPlugin/src/MSBuildProject.cs
plugins/CERoslynPlugin/src/RoslynService.cs
plugins/CERoslynPlugin/src/SolutionProject.cs
plugins/CERoslynPlugin/ui/MSBuildProjectNode.template
plugins/CERoslynPlugin/ui/winConfiguration.crow
plugins/CEXmlPlugin/src/Parsing/XmlTokenizer.cs
src/CrowEdit.cs
ui/main.crow
ui/windows/winProjects.crow

index f89d437105953e49f2475e886b4e8e76d742d7dc..8c13f2b588ab97659121aaf8da743e3817e7eba7 100644 (file)
@@ -95,7 +95,7 @@ namespace CrowEditBase
                //TODO:flattened project
                public IEnumerable<Project> FlattenProjects {
                        get {
-                               foreach (var node in Projects.SelectMany (child => child.FlattenSubProjetcs))
+                               foreach (var node in Projects.SelectMany (child => child.FlattenProjetcs))
                                        yield return node;
                        }
                }
index 0b7c049c18005c1be10ed509c0c7c1da60745bfd..a4c3926469752b6917cac1ec198c14427de795be 100644 (file)
@@ -14,9 +14,10 @@ namespace CrowEditBase
                protected Project parent;
                public abstract bool ContainsFile (string fullPath);
                public IEnumerable<Project> SubProjetcs => Childs.OfType<Project> ();
-               public IEnumerable<Project> FlattenSubProjetcs {
+               public virtual IEnumerable<Project> FlattenProjetcs {
                        get {
-                               foreach (var node in SubProjetcs.SelectMany (sp => sp.FlattenSubProjetcs))
+                               yield return this;
+                               foreach (var node in SubProjetcs.SelectMany (sp => sp.FlattenProjetcs))
                                        yield return node;
                        }
                }
index 41d5b7d3769cffd4c25b6113e1e28aa108383b35..81bfd55448962a529b148c7698ce5a829ce42671 100644 (file)
@@ -135,8 +135,12 @@ namespace Crow
                                if (currentLoc == value)
                                        return;
                                currentLoc = value;
-                               if (currentLoc.HasValue)
-                                       getFoldContainingLine (currentLoc.Value.Line)?.UnfoldToTheTop();
+                               if (currentLoc.HasValue) {
+                                       SyntaxNode fold = getFoldContainingLine (currentLoc.Value.Line);
+                                       while (fold != null && fold.StartLine == currentLoc.Value.Line)
+                                               fold = fold.Parent;
+                                       fold?.UnfoldToTheTop();
+                               }
                                NotifyValueChanged ("CurrentLine", CurrentLine);
                                NotifyValueChanged ("CurrentColumn", CurrentColumn);
                                CMDCopy.CanExecute = CMDCut.CanExecute = !SelectionIsEmpty;
index 195216f9cf5c333ca86f279d695cc7db9981225e..a9804657262a2b100a2407003ea90507b1434b7d 100644 (file)
@@ -40,6 +40,7 @@ namespace CrowEditBase
                public abstract NodeType NodeType { get; }
                public abstract string Icon { get; }
                public virtual string IconSub => null;
+               public virtual string StatusIcon => null;
                public T GetFirstAncestorOfType<T> () where T : TreeNode {
                        TreeNode n = this;
                        while (n.Parent != null && !(n is T))
index 147c1ec89516b89255bb21ce697d9f19dda2fe9c..89d08c6c4730b3408b4d2c3f9e6e7dd6c968f13b 100644 (file)
@@ -29,6 +29,7 @@ Editor {
        MouseWheelSpeed = "20";
        BubbleEvents ="None";
        ClipToClientRect = "true";
+       MouseCursor = "ibeam";
 }
 
 icon {
index ea45ddb5a5e174693e2458b0eb29d678bcaa30df..0a46ecac064e42e60711c1194211b02e0c1cfe6a 100644 (file)
@@ -27,6 +27,7 @@
                                                <Image Style="TreeIcon"
                                                        Path="{Icon}" SvgSub="{IconSub}"/>
                                                <Label Style="TreeLabel" Text="{./Caption}"/>
+                                               <Image Style="TreeIconSmall" Path="{StatusIcon}" />
                                        </HorizontalStack>
                                </Border>
                        </ListItem>
index c146d22e42136836dff9cd07e45b115fa0e239b4..eda163feb38a4a54b1c8a7d25e1b8b08018aad6c 100644 (file)
@@ -65,13 +65,34 @@ namespace Crow
 
 
                }
-
-
+               #region Commands
                public Command CMDStartRecording, CMDStopRecording, CMDRefresh;
                public Command CMDGotoParentEvent, CMDEventHistoryForward, CMDEventHistoryBackward;
                public CommandGroup LoggerCommands => new CommandGroup (CMDRefresh, CMDStartRecording, CMDStopRecording);
                public CommandGroup EventCommands => new CommandGroup(
                                CMDGotoParentEvent, CMDEventHistoryBackward, CMDEventHistoryForward);
+               public ActionCommand CMDOptions_SelectCrowAssemblyLocation => new ActionCommand ("...",
+                       () => {
+                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
+                               <FileDialog Caption='Select Crow.dll assembly' CurrentDirectory='{CrowDbgAssemblyLocation}'
+                                                       ShowFiles='true' ShowHidden='true' />");
+                               dlg.OkClicked += (sender, e) => CrowDbgAssemblyLocation = (sender as FileDialog).SelectedFileFullPath;
+                               dlg.DataSource = this;
+                       }
+               );
+               public ActionCommand CMDOptions_AddCrowAssembly => new ActionCommand ("Add Assembly with Crow Ressource",
+                       () => {
+                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
+                               <FileDialog Caption='Select Assembly with Crow Ressources' CurrentDirectory='{CrowDbgAssemblyLocation}'
+                                                       ShowFiles='true' ShowHidden='true' />");
+                               dlg.OkClicked += (sender, e) => {
+                                       crowAssemblies.Add ((sender as FileDialog).SelectedFileFullPath);
+                                       saveCrowAssemblies ();
+                               };
+                               dlg.DataSource = this;
+                       }
+               );
+
                void initCommands ()
                {
                        App.ViewCommands.Add (
@@ -84,11 +105,15 @@ namespace Crow
                        CMDEventHistoryBackward = new ActionCommand("back.", currentEventHistoryGoBack, "#icons.previous.svg", false);
                        CMDEventHistoryForward = new ActionCommand("forw.", currentEventHistoryGoForward, "#icons.forward-arrow.svg", false);
                }
+               #endregion
+
                public void LoadIML (string imlSource) {
                        if (CurrentState == Status.Running)
                                delSetSource (imlSource);
                }
                Exception currentException;
+               public string ErrorMessage = "";
+               public bool ServiceIsInError;
                object dbgIFace;
                AssemblyLoadContext crowLoadCtx;
                Assembly crowAssembly, thisAssembly;
@@ -107,6 +132,9 @@ namespace Crow
                Func<IntPtr> delGetSurfacePointer;
                Action<string> delSetSource;
                Action delReloadIml;
+               Func<double> delGetZoomFactor;
+               Action<double> delSetZoomFactor;
+
 
                FieldInfo fiDbg_IncludeEvents, fiDbg_DiscardEvents, fiDbg_ConsoleOutput, fiDbgIFace_MaxLayoutingTries, fiDbgIFace_MaxDiscardCount;
                #endregion
@@ -146,7 +174,7 @@ namespace Crow
                public bool PreviewHasError => currentException != null;
                public Exception CurrentException {
                        get => currentException;
-                       set {
+                       private set {
                                if (currentException == value)
                                        return;
                                currentException = value;
@@ -216,32 +244,38 @@ namespace Crow
                                NotifyValueChanged (value);
                        }
                }
-               public string ErrorMessage = "";
-               public bool ServiceIsInError;
                void updateCrowDebuggerState (string errorMsg = null) {
                        ErrorMessage = errorMsg;
                        ServiceIsInError = errorMsg != null;
                        NotifyValueChanged ("ServiceErrorMessage", (object)ErrorMessage);
                        NotifyValueChanged ("ServiceIsInError",  ServiceIsInError);
                }
-               public void GetMouseScreenCoordinates (out int x, out int y) {
+
+               #region DesignInterface callbacks
+               //those methods are called by designed interface
+               void getMouseScreenCoordinates (out int x, out int y) {
                        x = mouseScreenPos.X;
                        y = mouseScreenPos.Y;
                }
-               void saveCrowAssemblies () {
-                       if (crowAssemblies.Count > 0)
-                               Configuration.Global.Set ("CrowAssemblies", crowAssemblies.Aggregate ((a, b)=> $"{a};{b}"));
-                       else
-                               Configuration.Global.Set ("CrowAssemblies", "");
+               IEnumerable<object> getStyling () {
+                       if (App.CurrentProject is CERoslynPlugin.SolutionProject sol) {
+                               if (sol.StartupProject is CERoslynPlugin.MSBuildProject csprj) {
+                                       foreach (var style in csprj.Flatten.OfType<CERoslynPlugin.ProjectItemNode>()
+                                               .Where (pin=>pin.NodeType == NodeType.EmbeddedResource && pin.FullPath.EndsWith (".style", StringComparison.OrdinalIgnoreCase)))
+                                               yield return style.FullPath;
+                               }
+                       }
+                       yield return crowAssembly;
                }
-               void loadCrowAssemblies () {
-                       crowAssemblies.Clear ();
-                       if (!Configuration.Global.TryGet<string> ("CrowAssemblies", out string assemblies))
-                               return;
-                       foreach (string a in assemblies.Split (';'))
-                               crowAssemblies.Add (a);
+               Stream getStreamFromPath (string path) {
+                       if (App.CurrentProject is CERoslynPlugin.SolutionProject sol) {
+                               if (sol.StartupProject is CERoslynPlugin.MSBuildProject csprj) {
+                                       return csprj.GetStreamFromTargetPath (path);
+                               }
+                       }
+                       return null;
                }
-
+               #endregion
                public override void Start()
                {
                        if (CurrentState == Status.Running)
@@ -315,6 +349,11 @@ namespace Crow
                                                                                        dbgIFace, dbgIfaceType.GetProperty("Source").GetSetMethod());
                                delReloadIml = (Action)Delegate.CreateDelegate(typeof(Action), dbgIFace, dbgIfaceType.GetMethod("ReloadIml"));
 
+                               delGetZoomFactor = (Func<double>)Delegate.CreateDelegate(typeof(Func<double>),
+                                                                                       dbgIFace, dbgIfaceType.GetProperty("ZoomFactor").GetGetMethod());
+                               delSetZoomFactor = (Action<double>)Delegate.CreateDelegate(typeof(Action<double>),
+                                                                                       dbgIFace, dbgIfaceType.GetProperty("ZoomFactor").GetSetMethod());
+
                                fiDbgIFace_IsDirty = dbgIfaceType.GetField("IsDirty");
                                fiDbgIFace_MaxLayoutingTries = dbgIfaceType.GetField("MaxLayoutingTries", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
                                fiDbgIFace_MaxDiscardCount = dbgIfaceType.GetField("MaxDiscardCount", BindingFlags.Static | BindingFlags.Public | BindingFlags.FlattenHierarchy);
@@ -335,6 +374,8 @@ namespace Crow
                                CurrentState = Status.Running;
 
                                updateCrowDebuggerState();
+
+                               delSetZoomFactor (ZoomFactor);
                }
                public override void Stop()
                {
@@ -348,7 +389,17 @@ namespace Crow
                        CurrentState = Status.Paused;
                }
                public override string ConfigurationWindowPath => "#CECrowPlugin.ui.winConfiguration.crow";
-
+               Project activeSolution;
+               public Project ActiveSolution {
+                       get => activeSolution;
+                       set {
+                               CERoslynPlugin.SolutionProject sol = value as CERoslynPlugin.SolutionProject;
+                               if (activeSolution == sol)
+                                       return;
+                               activeSolution = sol;
+                               NotifyValueChanged (activeSolution);
+                       }
+               }
                public string CrowDbgAssemblyLocation {
                        get => Configuration.Global.Get<string> ("CrowDbgAssemblyLocation");
                        set {
@@ -358,32 +409,35 @@ namespace Crow
                                NotifyValueChanged(value);
                        }
                }
+               public double ZoomFactor {
+                       get => Configuration.Global.Get<Double> ("CrowPreviewZoomFactor", 1.0);
+                       set {
+                               if (ZoomFactor == value)
+                                       return;
+                               Configuration.Global.Set<Double> ("CrowPreviewZoomFactor", value);
+                               NotifyValueChanged (value);
+                               if (CurrentState == Status.Running)
+                                       delSetZoomFactor (value);
+                       }
+               }
                //assemblies with crow resources in order of loading
                IList<string> crowAssemblies = new ObservableList<string> ();
                public IList<string> CrowAssemblies => crowAssemblies;
+               void saveCrowAssemblies () {
+                       if (crowAssemblies.Count > 0)
+                               Configuration.Global.Set ("CrowAssemblies", crowAssemblies.Aggregate ((a, b)=> $"{a};{b}"));
+                       else
+                               Configuration.Global.Set ("CrowAssemblies", "");
+               }
+               void loadCrowAssemblies () {
+                       crowAssemblies.Clear ();
+                       if (!Configuration.Global.TryGet<string> ("CrowAssemblies", out string assemblies))
+                               return;
+                       foreach (string a in assemblies.Split (';'))
+                               crowAssemblies.Add (a);
+               }
+
 
-               public ActionCommand CMDOptions_SelectCrowAssemblyLocation => new ActionCommand ("...",
-                       () => {
-                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
-                               <FileDialog Caption='Select Crow.dll assembly' CurrentDirectory='{CrowDbgAssemblyLocation}'
-                                                       ShowFiles='true' ShowHidden='true' />");
-                               dlg.OkClicked += (sender, e) => CrowDbgAssemblyLocation = (sender as FileDialog).SelectedFileFullPath;
-                               dlg.DataSource = this;
-                       }
-               );
-               public ActionCommand CMDOptions_AddCrowAssembly => new ActionCommand ("Add Assembly with Crow Ressource",
-                       () => {
-                               FileDialog dlg = App.LoadIMLFragment<FileDialog> (@"
-                               <FileDialog Caption='Select Assembly with Crow Ressources' CurrentDirectory='{CrowDbgAssemblyLocation}'
-                                                       ShowFiles='true' ShowHidden='true' />");
-                               dlg.OkClicked += (sender, e) => {
-                                       crowAssemblies.Add ((sender as FileDialog).SelectedFileFullPath);
-                                       saveCrowAssemblies ();
-                               };
-                               dlg.DataSource = this;
-                       }
-               );
-               
 
                protected override void onStateChange(Status previousState, Status newState)
                {
@@ -437,7 +491,7 @@ namespace Crow
                                try
                                {
                                        mouseScreenPos = _mouseScreenPos;//absolute on screen position.
-                                       e.Handled = delMouseMove (e.X, e.Y);//DebugInterface local coordinate for mouse.
+                                       e.Handled = delMouseMove ((int)(e.X / ZoomFactor), (int)(e.Y / ZoomFactor));//DebugInterface local coordinate for mouse.
                                }
                                catch (System.Exception ex)
                                {
@@ -495,24 +549,6 @@ namespace Crow
                                fiDbgIFace_IsDirty.SetValue (dbgIFace, false);
                }
                public bool GetDirtyState => IsRunning ? (bool)fiDbgIFace_IsDirty.GetValue (dbgIFace) : false;
-               public IEnumerable<object> GetStyling () {
-                       if (App.CurrentProject is CERoslynPlugin.SolutionProject sol) {
-                               if (sol.StartupProject is CERoslynPlugin.MSBuildProject csprj) {
-                                       foreach (var style in csprj.Flatten.OfType<CERoslynPlugin.ProjectItemNode>()
-                                               .Where (pin=>pin.NodeType == NodeType.EmbeddedResource && pin.FullPath.EndsWith (".style", StringComparison.OrdinalIgnoreCase)))
-                                               yield return style.FullPath;
-                               }
-                       }
-                       yield return crowAssembly;
-               }
-               public Stream GetStreamFromPath (string path) {
-                       if (App.CurrentProject is CERoslynPlugin.SolutionProject sol) {
-                               if (sol.StartupProject is CERoslynPlugin.MSBuildProject csprj) {
-                                       return csprj.GetStreamFromTargetPath (path);
-                               }
-                       }
-                       return null;
-               }
 
                #region Debug log
                IList<DbgEvent> events;
index cffbc91a765b2bf7a1dda6de0c52e2190ec1d4c0..f179d25d281a499915d687e6780569c302dd4d7b 100644 (file)
@@ -38,12 +38,12 @@ namespace CECrowPlugin
                public bool Terminate;
                string source;
                Action delRegisterForRepaint;//call RegisterForRepaint in the container widget (DebugInterfaceWidget)
-               Action<Exception> delSetCurrentException;
+               Action<Exception> delCrowServiceSetCurrentException;
 
                delegate void GetScreenCoordinateDelegateType(out int x, out int y);
-               GetScreenCoordinateDelegateType delGetScreenCoordinate;
-               Func<IEnumerable<object>> delGetStyling;
-               Func<string, Stream> delGetStreamFromPath;
+               GetScreenCoordinateDelegateType delCrowServiceGetScreenCoordinate;
+               Func<IEnumerable<object>> delCrowServiceGetStyling;
+               Func<string, Stream> delCrowServiceGetStreamFromPath;
 
                void interfaceThread () {
                        while (!Terminate) {
@@ -73,7 +73,7 @@ namespace CECrowPlugin
                                                Monitor.Exit (UpdateMutex);
                                        while (Monitor.IsEntered(ClippingMutex))
                                                Monitor.Exit (ClippingMutex);*/
-                                       delSetCurrentException (ex);
+                                       delCrowServiceSetCurrentException (ex);
                                        Console.WriteLine ($"[DbgIFace] {ex}");
                                        ClearInterface();
                                        Thread.Sleep(1000);
@@ -85,19 +85,23 @@ namespace CECrowPlugin
                                Thread.Sleep (UPDATE_INTERVAL);
                        }
                }
-               public IntPtr SurfacePointer {
+               public new IntPtr SurfacePointer {
                        get {
                                lock(UpdateMutex)
                                        return surf.Handle;
                        }
                }
-               public void RegisterDebugInterfaceCallback (object w){
-                       Type t = w.GetType();
+               public void RegisterDebugInterfaceCallback (object crowService){
+                       Type t = crowService.GetType();
                        //delRegisterForRepaint = (Action)Delegate.CreateDelegate(typeof(Action), w, t.GetMethod("RegisterForRepaint"));
-                       delSetCurrentException = (Action<Exception>)Delegate.CreateDelegate(typeof(Action<Exception>), w, t.GetProperty("CurrentException").GetSetMethod());
-                       delGetScreenCoordinate = (GetScreenCoordinateDelegateType)Delegate.CreateDelegate(typeof(GetScreenCoordinateDelegateType), w, t.GetMethod("GetMouseScreenCoordinates"));
-                       delGetStyling = (Func<IEnumerable<object>>)Delegate.CreateDelegate (typeof (Func<IEnumerable<object>>), w, t.GetMethod ("GetStyling"));
-                       delGetStreamFromPath = (Func<string, Stream>)Delegate.CreateDelegate (typeof (Func<string, Stream>), w, t.GetMethod ("GetStreamFromPath"));
+                       delCrowServiceSetCurrentException = (Action<Exception>)Delegate.CreateDelegate(typeof(Action<Exception>), crowService,
+                               t.GetProperty("CurrentException").GetSetMethod(true));
+                       delCrowServiceGetScreenCoordinate = (GetScreenCoordinateDelegateType)Delegate.CreateDelegate(typeof(GetScreenCoordinateDelegateType), crowService,
+                               t.GetMethod("getMouseScreenCoordinates", BindingFlags.Instance | BindingFlags.NonPublic));
+                       delCrowServiceGetStyling = (Func<IEnumerable<object>>)Delegate.CreateDelegate (typeof (Func<IEnumerable<object>>), crowService,
+                               t.GetMethod ("getStyling", BindingFlags.Instance | BindingFlags.NonPublic));
+                       delCrowServiceGetStreamFromPath = (Func<string, Stream>)Delegate.CreateDelegate (typeof (Func<string, Stream>), crowService,
+                               t.GetMethod ("getStreamFromPath", BindingFlags.Instance | BindingFlags.NonPublic));
                }
                /*public void ResetDirtyState () {
                        IsDirty = false;
@@ -107,7 +111,7 @@ namespace CECrowPlugin
                                if (source == value)
                                        return;
                                source = value;
-                               delSetCurrentException(null);
+                               delCrowServiceSetCurrentException(null);
                                try
                                {
                                        lock (UpdateMutex) {
@@ -121,18 +125,18 @@ namespace CECrowPlugin
                                }
                                catch (IML.InstantiatorException iTorEx)
                                {
-                                       delSetCurrentException(iTorEx.InnerException);
+                                       delCrowServiceSetCurrentException(iTorEx.InnerException);
                                }
                                catch (System.Exception ex)
                                {
-                                       delSetCurrentException(ex);
+                                       delCrowServiceSetCurrentException(ex);
                                }
                        }
                }
                void resetInterface () {
                        ClearInterface();
                        initDictionaries();
-                       foreach (object style in delGetStyling ()) {
+                       foreach (object style in delCrowServiceGetStyling ()) {
                                if (style is string stylePath)
                                        LoadStyle (stylePath);
                                else if (style is Assembly styleAssembly)
@@ -164,7 +168,7 @@ namespace CECrowPlugin
                }
                public override void ForceMousePosition()
                {
-                       delGetScreenCoordinate(out int x, out int y);
+                       delCrowServiceGetScreenCoordinate(out int x, out int y);
                        Glfw.Glfw3.SetCursorPosition (WindowHandle, x, y);
                }
 
@@ -178,7 +182,7 @@ namespace CECrowPlugin
 
                public override Stream GetStreamFromPath(string path)
                {
-                       Stream result = delGetStreamFromPath (path);
+                       Stream result = delCrowServiceGetStreamFromPath (path);
                        if (result != null)
                                return result;
                        return base.GetStreamFromPath (path);
index 20b27056b3d32cdab2d9da1590282eebd48b806d..13a5dcfae580a5b9bf0399a4bd480faa9232e1fe 100644 (file)
@@ -33,7 +33,7 @@ namespace Crow
                                NotifyValueChangedAuto (crowIFaceService);
                        }
                }
-               Command CMDRefresh;
+               Command CMDRefresh, CMDZoomIn, CMDZoomOut;
                public DebugInterfaceWidget () : base () {
                        CMDRefresh = new ActionCommand (this, "Refresh",
                                () => {
@@ -43,6 +43,20 @@ namespace Crow
                                },
                                "#icons.refresh.svg",
                                new KeyBinding (Key.F3));
+                       CMDZoomIn = new ActionCommand ("Zoom in",
+                               () => {
+                                       if (crowIFaceService != null) {
+                                               crowIFaceService.ZoomFactor *= 2.0;
+                                               RegisterForGraphicUpdate ();
+                                       }
+                               }, "#icons.zoom-in.svg");
+                       CMDZoomOut = new ActionCommand ("Zoom out",
+                               () => {
+                                       if (crowIFaceService != null) {
+                                               crowIFaceService.ZoomFactor /= 2.0;
+                                               RegisterForGraphicUpdate ();
+                                       }
+                               }, "#icons.zoom-out.svg");
 
                        Thread t = new Thread (backgroundThreadFunc);
                        t.IsBackground = true;
@@ -116,14 +130,13 @@ namespace Crow
                                new Command("Load from file", () => loadLogFromDebugLogFilePath ())
                        );*/
                public CommandGroup WindowCommands => new CommandGroup (
-                       CMDRefresh,
+                       CMDRefresh, CMDZoomIn, CMDZoomOut,
                        crowIFaceService.CMDStartRecording,
                        crowIFaceService.CMDStopRecording,
                        crowIFaceService.CMDOpenConfig,
                        (Parent.LogicalParent as DockWindow).CMDClose
                );
 
-
                protected override void onDraw(Context gr)
                {
                        Console.WriteLine("onDraw");
index 1b4c1ad7f6ff3f52d8e2456887eafb063860b678..72d57984b438feb31d744b3710db3174448db5ca 100644 (file)
@@ -29,6 +29,7 @@ namespace CECrowPlugin
                                if (msbp.IsCrowProject)
                        }*/
                }
+               protected override Tokenizer CreateTokenizer() => new ImlTokenizer ();
 
                string[] allWidgetNames = typeof (Widget).Assembly.GetExportedTypes ().Where(t=>typeof(Widget).IsAssignableFrom (t))
                                        .Select (s => s.Name).ToArray ();
diff --git a/plugins/CECrowPlugin/src/Parsing/ImlTokenizer.cs b/plugins/CECrowPlugin/src/Parsing/ImlTokenizer.cs
new file mode 100644 (file)
index 0000000..b3e4259
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+using Crow.Text;
+using System.Collections.Generic;
+using CrowEditBase;
+using CrowEdit.Xml;
+
+namespace CECrowPlugin
+{
+       public class ImlTokenizer : XmlTokenizer {
+               protected override void parseAttributeValue (ref SpanCharReader reader) {
+                       char q = reader.Read();
+                       addTok (ref reader, XmlTokenType.AttributeValueOpen);
+                       while (!reader.EndOfSpan) {
+                               if (reader.Eol()) {
+                                       addTok (ref reader, XmlTokenType.AttributeValue);
+                                       reader.ReadEol();
+                                       addTok (ref reader, XmlTokenType.LineBreak);
+                                       continue;
+                               }
+                               if (reader.TryPeak (q)) {
+                                       addTok (ref reader, XmlTokenType.AttributeValue);
+                                       reader.Advance (1);
+                                       addTok (ref reader, XmlTokenType.AttributeValueClose);
+                                       return;
+                               } else
+                                       reader.Read ();
+                       }
+               }
+       }
+}
diff --git a/plugins/CECrowPlugin/src/Parsing/StyleTokenType.cs b/plugins/CECrowPlugin/src/Parsing/StyleTokenType.cs
new file mode 100644 (file)
index 0000000..e6609f5
--- /dev/null
@@ -0,0 +1,36 @@
+// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+
+namespace CECrowPlugin
+{
+       [Flags]
+       public enum StyleTokenType {
+               Unknown,
+               Trivia                                  = 0x0100,
+               WhiteSpace                              = 0x4100,
+               Tabulation                              = 0x4101,
+               LineBreak                               = 0x4102,
+               LineCommentStart                = 0x0102,
+               LineComment                             = 0x0103,
+               BlockCommentStart               = 0x0104,
+               BlockComment                    = 0x0105,
+               BlockCommentEnd                 = 0x0106,
+               Name                                    = 0x0200,
+               StyleKey                                = 0x0201,//may be a class name or a style name.
+               MemberName                              = 0x0202,
+               ConstantName                    = 0x0203,
+               Punctuation                             = 0x0400,
+               OpeningBrace                    = 0x0401,// '{'
+               ClosingBrace                    = 0x0402,// '}'
+               Comma                                   = 0x0403,// ','
+               EndOfExpression                 = 0x0404,// ';'
+               EqualSign                               = 0x0801,
+               MemberValuePart                         = 0x2000,
+               MemberValueOpen                 = 0x2401,
+               MemberValueClose                = 0x2402,
+               ConstantRefOpen                 = 0x2403,// '${'
+       }
+}
\ No newline at end of file
diff --git a/plugins/CECrowPlugin/src/Parsing/StyleTokenizer.cs b/plugins/CECrowPlugin/src/Parsing/StyleTokenizer.cs
new file mode 100644 (file)
index 0000000..33fa2f2
--- /dev/null
@@ -0,0 +1,144 @@
+// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+
+using System;
+using Crow.Text;
+using System.Collections.Generic;
+using CrowEditBase;
+using System.Globalization;
+using Crow.Coding;
+
+namespace CECrowPlugin {
+       public class StyleTokenizer : Tokenizer {
+               enum States     {
+                       classNames, members, value, endOfStatement
+               }
+
+               States curState;
+
+               public StyleTokenizer  () {}
+
+               bool readName (ref SpanCharReader reader) {
+                       if (reader.EndOfSpan)
+                               return false;
+                       char c = reader.Peak;
+                       if (char.IsLetter(c) || c == '_' ) {
+                               reader.Advance ();
+                               while (reader.TryPeak (ref c)) {
+                                       if (!char.IsLetterOrDigit(c)) {
+                                               UnicodeCategory uc = Char.GetUnicodeCategory (c);
+                                               if (uc != UnicodeCategory.NonSpacingMark &&
+                                                       uc != UnicodeCategory.SpacingCombiningMark &&
+                                                       uc != UnicodeCategory.ConnectorPunctuation &&
+                                                       uc != UnicodeCategory.Format)
+                                                       return true;
+                                       }
+                                       reader.Advance ();
+                               }
+                               return true;
+                       }
+                       return false;
+               }
+
+               public override Token[] Tokenize (string source) {
+                       SpanCharReader reader = initParsing (source);
+
+                       curState = States.classNames;
+
+                       while(!reader.EndOfSpan) {
+
+                               skipWhiteSpaces (ref reader);
+
+                               if (reader.EndOfSpan)
+                                       break;
+
+                               switch (reader.Peak) {
+                               case '/':
+                                       reader.Advance ();
+                                       if (reader.TryPeak ('/')) {
+                                               reader.Advance ();
+                                               addTok (ref reader, StyleTokenType.LineCommentStart);
+                                               reader.AdvanceUntilEol ();
+                                               addTok (ref reader, StyleTokenType.LineComment);
+                                       } else if (reader.TryPeak ('*')) {
+                                               reader.Advance ();
+                                               addTok (ref reader, StyleTokenType.BlockCommentStart);
+                                               if (reader.TryReadUntil ("*/")) {
+                                                       addTok (ref reader, StyleTokenType.BlockComment);
+                                                       reader.Advance (2);
+                                                       addTok (ref reader, StyleTokenType.BlockCommentEnd);
+                                               }
+                                       }
+                                       break;
+                               case ',':
+                                       reader.Advance ();
+                                       addTok (ref reader, StyleTokenType.Comma);
+                                       curState = States.classNames;
+                                       break;
+                               case '{':
+                                       reader.Advance ();
+                                       addTok (ref reader, StyleTokenType.OpeningBrace);
+                                       curState = States.members;
+                                       break;
+                               case '}':
+                                       reader.Advance ();
+                                       addTok (ref reader, StyleTokenType.ClosingBrace);
+                                       curState = States.classNames;
+                                       break;
+                               case '=':
+                                       reader.Advance ();
+                                       addTok (ref reader, StyleTokenType.EqualSign);
+                                       curState = States.value;
+                                       break;
+                               case '"':
+                                       reader.Advance ();
+                                       addTok (ref reader, StyleTokenType.MemberValueOpen);
+
+                                       while (!reader.EndOfSpan) {
+                                               if (reader.TryPeak ("${")) {
+                                                       addTok (ref reader, StyleTokenType.MemberValuePart);
+                                                       reader.Advance (2);
+                                                       addTok (ref reader, StyleTokenType.ConstantRefOpen);
+
+                                                       while (!reader.EndOfSpan) {
+                                                               if (reader.TryPeak ('}')) {
+                                                                       addTok (ref reader, StyleTokenType.ConstantName);
+                                                                       reader.Read ();
+                                                                       addTok (ref reader, StyleTokenType.ClosingBrace);
+                                                                       break;
+                                                               }
+                                                               reader.Advance ();
+                                                       }
+                                                       continue;
+                                               } else if (reader.TryPeak ('\"')) {
+                                                       addTok (ref reader, StyleTokenType.MemberValuePart);
+                                                       reader.Advance ();
+                                                       addTok (ref reader, StyleTokenType.MemberValueClose);
+                                                       break;
+                                               }
+                                               reader.Advance ();
+                                       }
+                                       curState = States.endOfStatement;
+                                       break;
+                               case ';':
+                                       reader.Advance();
+                                       addTok (ref reader, StyleTokenType.EndOfExpression);
+                                       curState = States.members;
+                                       break;
+                               default:
+                                       if (readName (ref reader)) {
+                                               addTok (ref reader, StyleTokenType.Name);
+                                               break;
+                                       }
+                                       reader.Advance ();
+                                       addTok (ref reader, StyleTokenType.Unknown);
+                                       break;
+                               }
+
+                       }
+
+                       return Toks.ToArray();
+               }
+       }
+}
diff --git a/plugins/CECrowPlugin/src/Parsing/SyntaxAnalyser.cs b/plugins/CECrowPlugin/src/Parsing/SyntaxAnalyser.cs
new file mode 100644 (file)
index 0000000..d3cf493
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright (c) 2021-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using CrowEditBase;
+
+namespace CECrowPlugin
+{
+       public class StyleSyntaxAnalyser : SyntaxAnalyser {
+               public override SyntaxNode Root => CurrentNode;
+               public StyleSyntaxAnalyser (StyleDocument source) : base (source) {
+                       this.source = source;
+               }
+
+               SyntaxNode CurrentNode;
+               Token previousTok;
+               IEnumerator<Token> iter;
+               int currentLine;
+               public override void Process () {
+                       StyleDocument doc = source as StyleDocument;
+                       Exceptions = new List<SyntaxException> ();
+                       CurrentNode = new StyleRootSyntax (doc);
+                       previousTok = default;
+                       iter = doc.Tokens.AsEnumerable().GetEnumerator ();
+                       currentLine = 0;
+
+                       bool notEndOfSource = iter.MoveNext ();
+                       while (notEndOfSource) {
+                               if (iter.Current.Type == TokenType.LineBreak)
+                                       currentLine++;
+                               else if (!iter.Current.Type.HasFlag (TokenType.Trivia)) {
+                               }
+
+                               previousTok = iter.Current;
+                               notEndOfSource = iter.MoveNext ();
+                       }
+                       while (currentNode.Parent != null) {
+                               if (!currentNode.LastTokenOffset.HasValue)
+                                       storeCurrentNode (-1);
+                               else
+                                       currentNode = currentNode.Parent;
+                       }
+                       setCurrentNodeEndLine (currentLine);
+               }
+       }
+}
\ No newline at end of file
diff --git a/plugins/CECrowPlugin/src/Parsing/SyntaxNodes.cs b/plugins/CECrowPlugin/src/Parsing/SyntaxNodes.cs
new file mode 100644 (file)
index 0000000..1f2f33e
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+using CrowEditBase;
+
+namespace CECrowPlugin
+{
+
+       public class StyleRootSyntax : SyntaxRootNode {
+               public StyleRootSyntax (StyleDocument source)
+                       : base (source) {
+               }
+       }
+
+       public class AttributeSyntax : SyntaxNode {
+               public Token? NameToken { get; internal set; }
+               public Token? EqualToken { get; internal set; }
+               public Token? ValueOpenToken { get; internal set; }
+               public Token? ValueCloseToken { get; internal set; }
+               public Token? ValueToken { get; internal set; }
+               public AttributeSyntax (int startLine, int startTok) : base  (startLine, startTok) {}
+               public override bool IsComplete => base.IsComplete & NameToken.HasValue & EqualToken.HasValue &
+                       ValueToken.HasValue & ValueOpenToken.HasValue & ValueCloseToken.HasValue;
+       }
+}
\ No newline at end of file
diff --git a/plugins/CECrowPlugin/src/StyleParsing/StyleTokenType.cs b/plugins/CECrowPlugin/src/StyleParsing/StyleTokenType.cs
deleted file mode 100644 (file)
index e6609f5..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-
-using System;
-
-namespace CECrowPlugin
-{
-       [Flags]
-       public enum StyleTokenType {
-               Unknown,
-               Trivia                                  = 0x0100,
-               WhiteSpace                              = 0x4100,
-               Tabulation                              = 0x4101,
-               LineBreak                               = 0x4102,
-               LineCommentStart                = 0x0102,
-               LineComment                             = 0x0103,
-               BlockCommentStart               = 0x0104,
-               BlockComment                    = 0x0105,
-               BlockCommentEnd                 = 0x0106,
-               Name                                    = 0x0200,
-               StyleKey                                = 0x0201,//may be a class name or a style name.
-               MemberName                              = 0x0202,
-               ConstantName                    = 0x0203,
-               Punctuation                             = 0x0400,
-               OpeningBrace                    = 0x0401,// '{'
-               ClosingBrace                    = 0x0402,// '}'
-               Comma                                   = 0x0403,// ','
-               EndOfExpression                 = 0x0404,// ';'
-               EqualSign                               = 0x0801,
-               MemberValuePart                         = 0x2000,
-               MemberValueOpen                 = 0x2401,
-               MemberValueClose                = 0x2402,
-               ConstantRefOpen                 = 0x2403,// '${'
-       }
-}
\ No newline at end of file
diff --git a/plugins/CECrowPlugin/src/StyleParsing/StyleTokenizer.cs b/plugins/CECrowPlugin/src/StyleParsing/StyleTokenizer.cs
deleted file mode 100644 (file)
index 33fa2f2..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-
-using System;
-using Crow.Text;
-using System.Collections.Generic;
-using CrowEditBase;
-using System.Globalization;
-using Crow.Coding;
-
-namespace CECrowPlugin {
-       public class StyleTokenizer : Tokenizer {
-               enum States     {
-                       classNames, members, value, endOfStatement
-               }
-
-               States curState;
-
-               public StyleTokenizer  () {}
-
-               bool readName (ref SpanCharReader reader) {
-                       if (reader.EndOfSpan)
-                               return false;
-                       char c = reader.Peak;
-                       if (char.IsLetter(c) || c == '_' ) {
-                               reader.Advance ();
-                               while (reader.TryPeak (ref c)) {
-                                       if (!char.IsLetterOrDigit(c)) {
-                                               UnicodeCategory uc = Char.GetUnicodeCategory (c);
-                                               if (uc != UnicodeCategory.NonSpacingMark &&
-                                                       uc != UnicodeCategory.SpacingCombiningMark &&
-                                                       uc != UnicodeCategory.ConnectorPunctuation &&
-                                                       uc != UnicodeCategory.Format)
-                                                       return true;
-                                       }
-                                       reader.Advance ();
-                               }
-                               return true;
-                       }
-                       return false;
-               }
-
-               public override Token[] Tokenize (string source) {
-                       SpanCharReader reader = initParsing (source);
-
-                       curState = States.classNames;
-
-                       while(!reader.EndOfSpan) {
-
-                               skipWhiteSpaces (ref reader);
-
-                               if (reader.EndOfSpan)
-                                       break;
-
-                               switch (reader.Peak) {
-                               case '/':
-                                       reader.Advance ();
-                                       if (reader.TryPeak ('/')) {
-                                               reader.Advance ();
-                                               addTok (ref reader, StyleTokenType.LineCommentStart);
-                                               reader.AdvanceUntilEol ();
-                                               addTok (ref reader, StyleTokenType.LineComment);
-                                       } else if (reader.TryPeak ('*')) {
-                                               reader.Advance ();
-                                               addTok (ref reader, StyleTokenType.BlockCommentStart);
-                                               if (reader.TryReadUntil ("*/")) {
-                                                       addTok (ref reader, StyleTokenType.BlockComment);
-                                                       reader.Advance (2);
-                                                       addTok (ref reader, StyleTokenType.BlockCommentEnd);
-                                               }
-                                       }
-                                       break;
-                               case ',':
-                                       reader.Advance ();
-                                       addTok (ref reader, StyleTokenType.Comma);
-                                       curState = States.classNames;
-                                       break;
-                               case '{':
-                                       reader.Advance ();
-                                       addTok (ref reader, StyleTokenType.OpeningBrace);
-                                       curState = States.members;
-                                       break;
-                               case '}':
-                                       reader.Advance ();
-                                       addTok (ref reader, StyleTokenType.ClosingBrace);
-                                       curState = States.classNames;
-                                       break;
-                               case '=':
-                                       reader.Advance ();
-                                       addTok (ref reader, StyleTokenType.EqualSign);
-                                       curState = States.value;
-                                       break;
-                               case '"':
-                                       reader.Advance ();
-                                       addTok (ref reader, StyleTokenType.MemberValueOpen);
-
-                                       while (!reader.EndOfSpan) {
-                                               if (reader.TryPeak ("${")) {
-                                                       addTok (ref reader, StyleTokenType.MemberValuePart);
-                                                       reader.Advance (2);
-                                                       addTok (ref reader, StyleTokenType.ConstantRefOpen);
-
-                                                       while (!reader.EndOfSpan) {
-                                                               if (reader.TryPeak ('}')) {
-                                                                       addTok (ref reader, StyleTokenType.ConstantName);
-                                                                       reader.Read ();
-                                                                       addTok (ref reader, StyleTokenType.ClosingBrace);
-                                                                       break;
-                                                               }
-                                                               reader.Advance ();
-                                                       }
-                                                       continue;
-                                               } else if (reader.TryPeak ('\"')) {
-                                                       addTok (ref reader, StyleTokenType.MemberValuePart);
-                                                       reader.Advance ();
-                                                       addTok (ref reader, StyleTokenType.MemberValueClose);
-                                                       break;
-                                               }
-                                               reader.Advance ();
-                                       }
-                                       curState = States.endOfStatement;
-                                       break;
-                               case ';':
-                                       reader.Advance();
-                                       addTok (ref reader, StyleTokenType.EndOfExpression);
-                                       curState = States.members;
-                                       break;
-                               default:
-                                       if (readName (ref reader)) {
-                                               addTok (ref reader, StyleTokenType.Name);
-                                               break;
-                                       }
-                                       reader.Advance ();
-                                       addTok (ref reader, StyleTokenType.Unknown);
-                                       break;
-                               }
-
-                       }
-
-                       return Toks.ToArray();
-               }
-       }
-}
diff --git a/plugins/CECrowPlugin/src/StyleParsing/SyntaxAnalyser.cs b/plugins/CECrowPlugin/src/StyleParsing/SyntaxAnalyser.cs
deleted file mode 100644 (file)
index d3cf493..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2021-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using CrowEditBase;
-
-namespace CECrowPlugin
-{
-       public class StyleSyntaxAnalyser : SyntaxAnalyser {
-               public override SyntaxNode Root => CurrentNode;
-               public StyleSyntaxAnalyser (StyleDocument source) : base (source) {
-                       this.source = source;
-               }
-
-               SyntaxNode CurrentNode;
-               Token previousTok;
-               IEnumerator<Token> iter;
-               int currentLine;
-               public override void Process () {
-                       StyleDocument doc = source as StyleDocument;
-                       Exceptions = new List<SyntaxException> ();
-                       CurrentNode = new StyleRootSyntax (doc);
-                       previousTok = default;
-                       iter = doc.Tokens.AsEnumerable().GetEnumerator ();
-                       currentLine = 0;
-
-                       bool notEndOfSource = iter.MoveNext ();
-                       while (notEndOfSource) {
-                               if (iter.Current.Type == TokenType.LineBreak)
-                                       currentLine++;
-                               else if (!iter.Current.Type.HasFlag (TokenType.Trivia)) {
-                               }
-
-                               previousTok = iter.Current;
-                               notEndOfSource = iter.MoveNext ();
-                       }
-                       while (currentNode.Parent != null) {
-                               if (!currentNode.LastTokenOffset.HasValue)
-                                       storeCurrentNode (-1);
-                               else
-                                       currentNode = currentNode.Parent;
-                       }
-                       setCurrentNodeEndLine (currentLine);
-               }
-       }
-}
\ No newline at end of file
diff --git a/plugins/CECrowPlugin/src/StyleParsing/SyntaxNodes.cs b/plugins/CECrowPlugin/src/StyleParsing/SyntaxNodes.cs
deleted file mode 100644 (file)
index 1f2f33e..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2013-2021  Bruyère Jean-Philippe <jp_bruyere@hotmail.com>
-//
-// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-using CrowEditBase;
-
-namespace CECrowPlugin
-{
-
-       public class StyleRootSyntax : SyntaxRootNode {
-               public StyleRootSyntax (StyleDocument source)
-                       : base (source) {
-               }
-       }
-
-       public class AttributeSyntax : SyntaxNode {
-               public Token? NameToken { get; internal set; }
-               public Token? EqualToken { get; internal set; }
-               public Token? ValueOpenToken { get; internal set; }
-               public Token? ValueCloseToken { get; internal set; }
-               public Token? ValueToken { get; internal set; }
-               public AttributeSyntax (int startLine, int startTok) : base  (startLine, startTok) {}
-               public override bool IsComplete => base.IsComplete & NameToken.HasValue & EqualToken.HasValue &
-                       ValueToken.HasValue & ValueOpenToken.HasValue & ValueCloseToken.HasValue;
-       }
-}
\ No newline at end of file
index 8ad2c70663d282afe029de42b61714e612f90d95..8ca5a54850e8c23a51a0cfae87eeb17f2fa6b9a4 100644 (file)
                        IsVisible="{ServiceIsInError}"/>
                <ListBox Style="ScrollingListBox" Data="{CrowAssemblies}"/>
                <HorizontalStack Height="Fit" Width="Fit" HorizontalAlignment="Right">
-                       <Button Command="{CMDOptions_AddCrowAssembly}"/>
-                       <Button Command="{CMDOptions_AddCrowAssembly}"/>
+                       <Button Command="{CMDOptions_AddCrowAssembly}" Fit="true"/>
+                       
                </HorizontalStack>
+               <Spinner Caption="Zoom Factor" Value="{²ZoomFactor}" Minimum="0.2" Maximum="4.0" SmallIncrement="0.1" LargeIncrement="0.2"/>
                <Spinner Caption="Refresh Rate (ms)" Value="{²RefreshRate}" Maximum="1000"/>
                <Spinner Caption="Max Layout Try" Value="{²MaxLayoutingTries}" Maximum="1000"/>
                <Spinner Caption="Max Layout Discard" Value="{²MaxDiscardCount}" Maximum="1000"/>
index 2986f3b5ff27422b7b4bbbf4cff05f0c5cb76c07..03295c02060b3a3639215ca5964df9aed685c434 100644 (file)
@@ -2,9 +2,9 @@
 <Project Sdk="Microsoft.NET.Sdk">
        <PropertyGroup>
                <TargetFrameworks>netcoreapp3.1</TargetFrameworks>
-               <EnableDefaultItems>false</EnableDefaultItems>          
+               <EnableDefaultItems>false</EnableDefaultItems>
        </PropertyGroup>
-       
+
        <ItemGroup>
                <Compile Include="src\**\*.cs" />
                <EmbeddedResource Include="ui\**\*.*" />
@@ -41,7 +41,7 @@
                </PackageReference>
        </ItemGroup>
 
-       <ItemGroup>    
+       <ItemGroup>
                <PackageReference Include="Microsoft.CodeAnalysis.Common" Version="3.7.*" >
                        <IncludeAssets>all</IncludeAssets>
                        <PrivateAssets>all</PrivateAssets>
@@ -55,5 +55,5 @@
                        <Visible>False</Visible>
                </PackageReference>
                <!--<PackageReference Include="Microsoft.VisualStudio.TestPlatform.ObjectModel" />-->
-       </ItemGroup>    
+       </ItemGroup>
 </Project>
index 0d41c961a2352f56706c9e51a0c528b24e7a2b30..c9353942df708a29e0d629caa2bc60cc3dae7d0a 100644 (file)
@@ -13,8 +13,14 @@ using static CrowEditBase.CrowEditBase;
 
 namespace CERoslynPlugin
 {
-       internal class CELogger : ILogger
-       {
+       internal class CELogger : ILogger, IValueChange {
+               #region IValueChange implementation
+               public event EventHandler<ValueChangeEventArgs> ValueChanged;
+               public void NotifyValueChanged (string MemberName, object _value)
+               {
+                       ValueChanged.Raise (this, new ValueChangeEventArgs (MemberName, _value));
+               }
+               #endregion
                IEventSource eventSource;
                LoggerVerbosity verbosity;
                MessageImportance maxMsgImportance;
@@ -24,18 +30,32 @@ namespace CERoslynPlugin
                        set {
                                if (verbosity == value)
                                        return;
-                               if (eventSource != null)
-                                       unregisterHandles ();
                                verbosity = value;
-                               if (eventSource != null)
-                                       registerHandles ();
+                               NotifyValueChanged ("Verbosity", verbosity);
+                               Configuration.Global.Set<Microsoft.Build.Framework.LoggerVerbosity> ("CERoslyn.LoggerVerbosity", verbosity);
+
+                               switch (verbosity) {
+                               case LoggerVerbosity.Minimal:
+                                       maxMsgImportance = MessageImportance.High;
+                                       break;
+                               case LoggerVerbosity.Normal:
+                                       maxMsgImportance = MessageImportance.High;
+                                       break;
+                               case LoggerVerbosity.Detailed:
+                                       maxMsgImportance = MessageImportance.Normal;
+                                       break;
+                               case LoggerVerbosity.Diagnostic:
+                                       maxMsgImportance = MessageImportance.Low;
+                                       break;
+                               }
+
                        }
                }
                public string Parameters { get; set; }
 
                public CELogger (LoggerVerbosity verbosity = LoggerVerbosity.Detailed)
                {
-                       this.verbosity = verbosity;
+                       Verbosity = verbosity;
                }
                public void Initialize (IEventSource eventSource) {
                        this.eventSource = eventSource;
@@ -49,34 +69,12 @@ namespace CERoslynPlugin
                        eventSource.BuildStarted += EventSource_Progress_BuildStarted;
                        eventSource.BuildFinished += EventSource_Progress_BuildFinished;
                        eventSource.MessageRaised += EventSource_MessageRaised;
-
-                       switch (Verbosity) {
-                       case LoggerVerbosity.Minimal:
-                               maxMsgImportance = MessageImportance.High;
-
-                               break;
-                       case LoggerVerbosity.Normal:
-                               maxMsgImportance = MessageImportance.Normal;
-
-                               eventSource.ProjectStarted += EventSource_ProjectStarted;
-                               eventSource.ProjectFinished += EventSource_ProjectFinished;
-                               break;
-                       case LoggerVerbosity.Detailed:
-                               maxMsgImportance = MessageImportance.Normal;
-
-                               eventSource.ProjectStarted += EventSource_ProjectStarted;
-                               eventSource.ProjectFinished += EventSource_ProjectFinished;
-                               eventSource.TargetStarted += EventSource_TargetStarted;
-                               eventSource.TargetFinished += EventSource_TargetFinished;
-                               eventSource.TaskStarted += EventSource_TaskStarted;
-                               eventSource.TaskFinished += EventSource_TaskFinished;
-                               break;
-                       case LoggerVerbosity.Diagnostic:
-                               maxMsgImportance = MessageImportance.Low;
-
-                               eventSource.AnyEventRaised += EventSource_AnyEventRaised;
-                               break;
-                       }
+                       eventSource.ProjectStarted += EventSource_ProjectStarted;
+                       eventSource.ProjectFinished += EventSource_ProjectFinished;
+                       eventSource.TargetStarted += EventSource_TargetStarted;
+                       eventSource.TargetFinished += EventSource_TargetFinished;
+                       eventSource.TaskStarted += EventSource_TaskStarted;
+                       eventSource.TaskFinished += EventSource_TaskFinished;
                }
 
                void unregisterHandles () {
@@ -85,24 +83,12 @@ namespace CERoslynPlugin
                        eventSource.BuildStarted -= EventSource_Progress_BuildStarted;
                        eventSource.BuildFinished -= EventSource_Progress_BuildFinished;
                        eventSource.MessageRaised -= EventSource_MessageRaised;
-
-                       switch (Verbosity) {
-                       case LoggerVerbosity.Normal:
-                               eventSource.ProjectStarted -= EventSource_ProjectStarted;
-                               eventSource.ProjectFinished -= EventSource_ProjectFinished;
-                               break;
-                       case LoggerVerbosity.Detailed:
-                               eventSource.ProjectStarted -= EventSource_ProjectStarted;
-                               eventSource.ProjectFinished -= EventSource_ProjectFinished;
-                               eventSource.TargetStarted -= EventSource_TargetStarted;
-                               eventSource.TargetFinished -= EventSource_TargetFinished;
-                               eventSource.TaskStarted -= EventSource_TaskStarted;
-                               eventSource.TaskFinished -= EventSource_TaskFinished;
-                               break;
-                       case LoggerVerbosity.Diagnostic:
-                               eventSource.AnyEventRaised -= EventSource_AnyEventRaised;
-                               break;
-                       }
+                       eventSource.ProjectStarted -= EventSource_ProjectStarted;
+                       eventSource.ProjectFinished -= EventSource_ProjectFinished;
+                       eventSource.TargetStarted -= EventSource_TargetStarted;
+                       eventSource.TargetFinished -= EventSource_TargetFinished;
+                       eventSource.TaskStarted -= EventSource_TaskStarted;
+                       eventSource.TaskFinished -= EventSource_TaskFinished;
                }
                void log (LogType type, string message) {
                        string[] lines = Regex.Split (message, "\r\n|\r|\n");//|\r|\n|\\\\n");
@@ -120,22 +106,26 @@ namespace CERoslynPlugin
                }
 
                private void EventSource_TaskFinished (object sender, TaskFinishedEventArgs e) {
-                       log (LogType.Custom1, e.Message);
+                       if (Verbosity == LoggerVerbosity.Diagnostic)
+                               log (LogType.Custom1, e.Message);
                }
 
                private void EventSource_TaskStarted (object sender, TaskStartedEventArgs e) {
-                       log (LogType.Custom1, e.Message);
+                       if (Verbosity == LoggerVerbosity.Diagnostic)
+                               log (LogType.Custom1, e.Message);
                }
 
                private void EventSource_TargetFinished (object sender, TargetFinishedEventArgs e) {
-                       log (LogType.Custom2, e.Message);
+                       if (Verbosity >= LoggerVerbosity.Detailed)
+                               log (LogType.Custom2, e.Message);
                }
 
                private void EventSource_TargetStarted (object sender, TargetStartedEventArgs e) {
-                       log (LogType.Custom2, e.Message);
+                       if (Verbosity >= LoggerVerbosity.Detailed)
+                               log (LogType.Custom2, e.Message);
                }
                private void EventSource_MessageRaised (object sender, BuildMessageEventArgs e) {
-                       if (e.Importance > maxMsgImportance)
+                       if (Verbosity == LoggerVerbosity.Quiet || e.Importance > maxMsgImportance)
                                return;
                        if (e.Importance == MessageImportance.High)
                                log (LogType.High, e.Message);
@@ -144,23 +134,6 @@ namespace CERoslynPlugin
                        else
                                log (LogType.Low, e.Message);
                }
-               private void EventSource_AnyEventRaised (object sender, BuildEventArgs e) {
-                       if (e is BuildErrorEventArgs ||
-                                       e is BuildWarningEventArgs ||
-                                       e is BuildStartedEventArgs ||
-                                       e is BuildMessageEventArgs ||
-                                       e is BuildFinishedEventArgs)
-                               return;
-                       else if (e is TargetFinishedEventArgs || e is TargetStartedEventArgs)
-                               log (LogType.Custom2, e.Message);
-                       else if (e is TaskStartedEventArgs || e is TaskFinishedEventArgs)
-                               log (LogType.Custom1, e.Message);
-                       else if (e is BuildStatusEventArgs)
-                               log (LogType.High, e.Message);
-                       else
-                               log (LogType.Custom3, e.Message);
-               }
-
                void EventSource_ProjectStarted (object sender, ProjectStartedEventArgs e)
                {
                        log (LogType.Custom3, e.Message);
index 8041cec9959043ca299f51cfd220cfa24476cf36..6a6685a20bacfb5a6ef2a667c5a205d0e401f1e4 100644 (file)
@@ -23,6 +23,7 @@ using static CrowEditBase.CrowEditBase;
 using Project = CrowEditBase.Project;
 using Microsoft.CodeAnalysis;
 using Microsoft.CodeAnalysis.CSharp;
+using System.Threading.Tasks;
 
 namespace CERoslynPlugin
 {
@@ -43,6 +44,7 @@ namespace CERoslynPlugin
                public CommandGroup CMDSBuild { get; private set; }
                public Command CMDSetAsStartupProject { get; private set; }
 
+               BuildResult lastBuildResult;
 
                internal MSBuildProject (SolutionProject solution, ProjectInSolution projectInSolution) : base (projectInSolution.AbsolutePath) {
                        this.projectInSolution = projectInSolution;
@@ -114,22 +116,7 @@ namespace CERoslynPlugin
                                Console.WriteLine (ex);
                        }
                }
-               void printEvaluatedProperties (ProjectInstance pi) {
-                       Console.ForegroundColor = ConsoleColor.Green;
-                       Console.WriteLine ($"Evaluated Globals properties for {Name}");
-                       foreach (ProjectPropertyInstance item in pi.Properties.OrderBy (p => p.Name)) {
-                               Console.ForegroundColor = ConsoleColor.White;
-                               Console.Write ($"\t{item.Name,-40} = ");
-                               Console.ForegroundColor = ConsoleColor.Gray;
-                               Console.WriteLine ($"{item.EvaluatedValue}");
 
-                       }
-                       ICollection<ProjectItemInstance> pii = pi.GetItems ("InnerOutput");
-                       ProjectRootElement pre = pi.ToProjectRootElement();
-                       pre.FullPath = "/home/jp/test.csproj";
-                       pre.Save();
-
-               }
                public override void Unload () {
                        CMDSBuild.ToggleAllCommand (false);
                        if (commands.Contains (CMDSetAsStartupProject))
@@ -150,14 +137,27 @@ namespace CERoslynPlugin
                                BuildRequestData request = new BuildRequestData (pi, targets, null,
                                        BuildRequestDataFlags.ProvideProjectStateAfterBuild);
 
-                               BuildResult result = BuildManager.DefaultBuildManager.Build (solutionProject.buildParams, request);
+                               lastBuildResult = BuildManager.DefaultBuildManager.Build (solutionProject.buildParams, request);
 
-                               printEvaluatedProperties (result.ProjectStateAfterBuild);
+                               printEvaluatedProperties (lastBuildResult.ProjectStateAfterBuild);
 
-                               var test = result.ProjectStateAfterBuild.GetItems ("Reference");
+                               var test = lastBuildResult.ProjectStateAfterBuild.GetItems ("Reference");
+
+                               Console.WriteLine (IsCrowProject);
 
                        //}
                }
+               public async void DesignBuild () {
+                       lastBuildResult = await Task.Run (()=> designBuild());
+               }
+               BuildResult designBuild () {
+                       string[] targets = {"Build"};
+                       BuildManager.DefaultBuildManager.ResetCaches ();
+                       ProjectInstance pi = BuildManager.DefaultBuildManager.GetProjectInstanceForBuild (project);
+                       BuildRequestData request = new BuildRequestData (pi, targets, null,
+                               BuildRequestDataFlags.ProvideProjectStateAfterBuild);
+                       return BuildManager.DefaultBuildManager.Build (solutionProject.buildParams, request);
+               }
                public override string Icon {
                        get {
                                switch (Path.GetExtension (FullPath)) {
@@ -171,7 +171,7 @@ namespace CERoslynPlugin
 
                public bool IsCrowProject {
                        get {
-                               foreach (ProjectItemNode reference in Childs[0].Flatten.OfType<ProjectItemNode>()) {
+                               /*foreach (ProjectItemNode reference in Childs[0].Flatten.OfType<ProjectItemNode>()) {
                                        switch (reference.NodeType)     {
                                                case NodeType.PackageReference:
                                                        if (reference.Caption == "Crow")
@@ -182,11 +182,15 @@ namespace CERoslynPlugin
                                                                return true;
                                                        break;
                                        }
+                               }*/
+                               if (lastBuildResult != null) {
+                                       var references = lastBuildResult.ProjectStateAfterBuild.GetItems ("Reference");
+                                       return references.Any (r=>r.GetMetadataValue("PackageName") == "Crow");
                                }
                                return false;
                        }
                }
-               public bool IsStartupProject => solutionProject.StartupProject == this;
+               public override string StatusIcon => solutionProject.StartupProject == this ? "#icons.startup.svg" : null;
                public override bool ContainsFile (string fullPath) =>
                        Flatten.OfType<ProjectItemNode> ().Any (f => f.FullPath == fullPath);
 
@@ -328,5 +332,25 @@ namespace CERoslynPlugin
                        }
                        return null;
                }
+
+
+#region debug
+               void printEvaluatedProperties (ProjectInstance pi) {
+                       Console.ForegroundColor = ConsoleColor.Green;
+                       Console.WriteLine ($"Evaluated Globals properties for {Name}");
+                       foreach (ProjectPropertyInstance item in pi.Properties.OrderBy (p => p.Name)) {
+                               Console.ForegroundColor = ConsoleColor.White;
+                               Console.Write ($"\t{item.Name,-40} = ");
+                               Console.ForegroundColor = ConsoleColor.Gray;
+                               Console.WriteLine ($"{item.EvaluatedValue}");
+
+                       }
+                       ICollection<ProjectItemInstance> pii = pi.GetItems ("InnerOutput");
+                       ProjectRootElement pre = pi.ToProjectRootElement();
+                       pre.FullPath = "/home/jp/test.csproj";
+                       pre.Save();
+
+               }
+#endregion
        }
 }
\ No newline at end of file
index 53bdf25ff28cc110cc9dff5f2baf0ca4fd1d9d23..3652ec80c50a2bb46557a5fd8ff87049b85ebf30 100644 (file)
@@ -18,8 +18,17 @@ using Crow;
 namespace CERoslynPlugin
 {
        public class RoslynService : Service {
-               internal CELogger Logger { get; private set; }
-               public LogLevel LogLevel {
+               CELogger logger;
+               internal CELogger Logger {
+                       get => logger;
+                       private set {
+                               if (logger == value)
+                                       return;
+                               logger = value;
+                               NotifyValueChanged (logger);
+                       }
+               }
+               /*public LogLevel LogLevel {
                        get => Crow.Configuration.Global.Get<LogLevel>("LogLevel");
                        set {
                                if (LogLevel == value)
@@ -44,7 +53,7 @@ namespace CERoslynPlugin
                                Logger.Verbosity = Microsoft.Build.Framework.LoggerVerbosity.Diagnostic;
                                break;
                        }
-               }
+               }*/
 
                public RoslynService () : base () {
                        configureDefaultSDKPathes ();
@@ -76,8 +85,10 @@ namespace CERoslynPlugin
                }
 
                public override void Start() {
-                       Logger = new CELogger ();
-                       updateLogLevel ();
+                       Logger = new CELogger (
+                               Configuration.Global.Get<Microsoft.Build.Framework.LoggerVerbosity> ("CERoslyn.LoggerVerbosity",
+                                       Microsoft.Build.Framework.LoggerVerbosity.Normal));
+                       //updateLogLevel ();
 
                        Environment.SetEnvironmentVariable ("MSBUILD_EXE_PATH", Path.Combine (MSBuildRoot, "MSBuild.dll"));
                        Environment.SetEnvironmentVariable ("MSBuildSDKsPath", Path.Combine (MSBuildRoot, "Sdks"));
index 5cfd86c58358375eb974e7060983a0395c2d9afd..735a380a0d6af541d58783fca25d449701f40718 100644 (file)
@@ -31,7 +31,7 @@ namespace CERoslynPlugin
 
                        Load();
 
-                       if (Flatten.OfType<MSBuildProject>().Any (msb => msb.IsCrowProject)) {
+                       if (FlattenProjetcs.OfType<MSBuildProject>().Any (msb => msb.IsCrowProject)) {
                                Console.WriteLine ("Is crow project!!");
                        }
                }
@@ -62,28 +62,34 @@ namespace CERoslynPlugin
                        }*/
                }
                public override bool ContainsFile (string fullPath) =>
-                               FlattenSubProjetcs.Any (f => f.ContainsFile (fullPath));
+                               FlattenProjetcs.Any (f => f.ContainsFile (fullPath));
                public override string Name => Path.GetFileNameWithoutExtension (FullPath);
                public override string Icon => "#icons.file_type_sln2.svg";
                public Project StartupProject {
-                       get => FlattenSubProjetcs.FirstOrDefault (p => p.FullPath == UserConfig.Get<string> ("StartupProject"));
+                       get => FlattenProjetcs.FirstOrDefault (p => p.FullPath == UserConfig.Get<string> ("StartupProject"));
                        set {
                                if (value == StartupProject)
                                        return;
 
-                               StartupProject?.NotifyValueChanged ("IsStartupProject", false);
+                               StartupProject?.NotifyValueChanged ("StatusIcon", (object)StartupProject?.StatusIcon);
 
                                if (value == null)
                                        UserConfig.Set ("StartupProject", "");
                                else {
                                        UserConfig.Set ("StartupProject", value.FullPath);
-                                       value.NotifyValueChanged("IsStartupProject", true);
+                                       value.NotifyValueChanged ("StatusIcon", (object)value.StatusIcon);
                                }
                                NotifyValueChanged ("StartupProject", StartupProject);
                        }
                }
 
                public override NodeType NodeType => NodeType.ProjectGroup;
+               public override IEnumerable<Project> FlattenProjetcs {
+                       get {
+                               foreach (var node in SubProjetcs.SelectMany (sp => sp.FlattenProjetcs))
+                                       yield return node;
+                       }
+               }
 
                public override void Load () {
                        Dictionary<string,string> globalProperties = new Dictionary<string, string>();
@@ -121,7 +127,8 @@ namespace CERoslynPlugin
                                LogInitialPropertiesAndItems = true,
                                LogTaskInputs = true,
                                UseSynchronousLogging = true,
-                               ResetCaches = true
+                               ResetCaches = true,
+                               DetailedSummary = true
                        };
 
                        //projectCollection.IsBuildEnabled = false;
@@ -169,6 +176,9 @@ namespace CERoslynPlugin
                        }
 
                        IsLoaded = true;
+
+                       if (StartupProject is MSBuildProject msbProj)
+                               msbProj?.DesignBuild();
                }
 
                void build (params string[] targets) {
index 46cd43892160d48c25be259cede723b60e90c7c0..d2589dea9a79edc7122edf63916cfbad9e3f88a6 100644 (file)
@@ -20,7 +20,7 @@
                                        <Image Style="TreeIcon"
                                                Path="{Icon}" SvgSub="{IconSub}"/>
                                        <Label Style="TreeLabel" Text="{./Caption}"/>
-                                       <Image Style="TreeIconSmall"    Path="#icons.startup.svg" IsVisible="{IsStartupProject}"/>
+                                       <Image Style="TreeIconSmall" Path="#icons.startup.svg" IsVisible="{IsStartupProject}"/>
                                </HorizontalStack>
                        </ListItem>
                        <Container Name="Content" Visible="false"/>
index 57fb38267215ca8fad5497fabe1a036236821895..b8875bc39a70260c9190ff6388cc82c91bd04f4d 100644 (file)
@@ -11,7 +11,7 @@
                        <TextBox Width="Stretched" Text="{²MSBuildRoot}"/>
                        <Button Command="{CMDOptions_SelectMSBuildRoot}" MinimumSize="0,0"/>
                </HorizontalStack>
-               <EnumSelector Caption="Log Level" EnumValue="{²LogLevel}" />
+               <EnumSelector DataSource="{Logger}" Caption="Log Level" EnumValue="{²Verbosity}" />
        </VerticalStack>
 </DockWindow>
 
index a349a7f8af698be5cc2a665008b1526cf6265536..fd97073118a14a940243c903c1161535465268f2 100644 (file)
@@ -110,8 +110,8 @@ namespace CrowEdit.Xml
                                                addTok (ref reader, XmlTokenType.ElementOpen);
                                                if (readName (ref reader)) {
                                                        addTok (ref reader, XmlTokenType.ElementName);
-                                                       curState = States.StartTag;
                                                }
+                                               curState = States.StartTag;
                                        }
                                        break;
                                case '?':
@@ -127,12 +127,21 @@ namespace CrowEdit.Xml
                                case '"':
                                        char q = reader.Read();
                                        addTok (ref reader, XmlTokenType.AttributeValueOpen);
-                                       if (reader.TryReadUntil (q)) {
-                                               addTok (ref reader, XmlTokenType.AttributeValue);
-                                               reader.Advance ();
-                                               addTok (ref reader, XmlTokenType.AttributeValueClose);
-                                       } else
-                                               addTok (ref reader, XmlTokenType.AttributeValue);
+                                       while (!reader.EndOfSpan) {
+                                               if (reader.Eol()) {
+                                                       addTok (ref reader, XmlTokenType.AttributeValue);
+                                                       reader.ReadEol();
+                                                       addTok (ref reader, XmlTokenType.LineBreak);
+                                                       continue;
+                                               }
+                                               if (reader.TryPeak (q)) {
+                                                       addTok (ref reader, XmlTokenType.AttributeValue);
+                                                       reader.Advance (1);
+                                                       addTok (ref reader, XmlTokenType.AttributeValueClose);
+                                                       break;
+                                               } else
+                                                       reader.Read ();
+                                       }
                                        break;
                                case '=':
                                        reader.Advance();
index aedb6af6533e041338135d4fba70567f3e95a3e0..0b303e55ef6cfb8743b29c7dbea2fbe3b862ebea 100644 (file)
@@ -79,7 +79,6 @@ namespace CrowEdit
                        base.OnInitialized ();
 
                        loadPlugins ();
-                       reopenLastProjectList ();
 
                        SetWindowIcon ("#Crow.Icons.crow.png");
 
@@ -95,6 +94,8 @@ namespace CrowEdit
 
                        reloadWinConfigs ();
 
+                       reopenLastProjectList ();
+
                        reopenLastDocumentList ();
                }
                public override void Terminate()
index cbc0924f24e1a4028c06cc280ac766937fc70f4e..caa59caf7bab1e1ea393d57293dd22c284026b39 100755 (executable)
@@ -6,7 +6,7 @@
                        <MenuItem Data="{Commands}" Width="Fit" IsEnabled="{CanExecute}"
                                                ItemTemplate="#ui.MenuItem.itmp">
                                <Template>
-                                       <Popper PopDirection="Bottom" Caption="{Caption}" Width="Fit" 
+                                       <Popper PopDirection="Bottom" Caption="{Caption}" Width="Fit"
                                                                        MouseEnter="{Background=${ControlHighlight}}"
                                                                        MouseLeave="{Background=Transparent}">
                                                <Template>
@@ -17,7 +17,7 @@
                                        </Popper>
                                </Template>
                        </MenuItem>
-               </ItemTemplate> 
+               </ItemTemplate>
        </Menu>
        <DockStack Name="mainDock"  RootDataLevel="true" Background="DarkGrey"/>
 </VerticalStack>
index b646c6ec027125561576c0f39316e0af65eea96b..6f4d5fcbe8952130c727f96d3e93181b2b412bcd 100644 (file)
                </ItemTemplate>
 
                <!--<ItemTemplate DataType="CERoslynPlugin.MSBuildProject" Data="Childs" Path="#CERoslynPlugin.ui.MSBuildProjectNode.template" />-->
-               <ItemTemplate DataType="CrowEditBase.VirtualNode" Data="Childs" Path="#ui.TreeExpandable.template" />
 
+               <ItemTemplate DataType="CrowEditBase.VirtualNode" Data="Childs" Path="#ui.TreeExpandable.template" />
                <ItemTemplate DataType="CrowEditBase.Project" Data="Childs" Path="#ui.TreeExpandable.template" />
+
                <!--<ItemTemplate DataType="CrowEditBase.TreeNode" DataTest="NodeType" Data="Childs" Path="#ui.TreeExpandable.template" />-->
        </TreeView>
 </DockWindow>