aboutsummaryrefslogtreecommitdiffstatsci
path: root/CrowIDE/src/ProjectTree
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-13 17:16:24 +0100
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2018-03-13 17:16:24 +0100
commit5f1d0213e0dadecc8f93d44e36ea3a11a1aa9baa (patch)
tree8c01fd9b8f9e446d17adf9c415e0a4d6ef988a18 /CrowIDE/src/ProjectTree
parent99d63b94c2e0e09eae8efb67e720920c130f7346 (diff)
limit to html safe color plus several ones, crowIDE wip
Diffstat (limited to 'CrowIDE/src/ProjectTree')
-rw-r--r--CrowIDE/src/ProjectTree/ImlProjectItem.cs21
-rw-r--r--CrowIDE/src/ProjectTree/ProjectFile.cs21
-rw-r--r--CrowIDE/src/ProjectTree/StyleProjectItem.cs50
3 files changed, 87 insertions, 5 deletions
diff --git a/CrowIDE/src/ProjectTree/ImlProjectItem.cs b/CrowIDE/src/ProjectTree/ImlProjectItem.cs
index 7ce24ad7..0575d177 100644
--- a/CrowIDE/src/ProjectTree/ImlProjectItem.cs
+++ b/CrowIDE/src/ProjectTree/ImlProjectItem.cs
@@ -41,6 +41,7 @@ namespace Crow.Coding
#endregion
GraphicObject instance;
+ Measure designWidth, designHeight;
/// <summary>
/// instance created with an instantiator from the source by a DesignInterface,
@@ -55,6 +56,26 @@ namespace Crow.Coding
NotifyValueChanged ("Instance", instance);
}
}
+
+ public Measure DesignWidth {
+ get { return designWidth; }
+ set {
+ if (designWidth == value)
+ return;
+ designWidth = value;
+ NotifyValueChanged ("DesignWidth", designWidth);
+ }
+ }
+ public Measure DesignHeight {
+ get { return designHeight; }
+ set {
+ if (designHeight == value)
+ return;
+ designHeight = value;
+ NotifyValueChanged ("DesignHeight", designHeight);
+ }
+ }
+
public List<GraphicObject> GraphicTree {
get { return new List<GraphicObject> (new GraphicObject[] {instance}); }
diff --git a/CrowIDE/src/ProjectTree/ProjectFile.cs b/CrowIDE/src/ProjectTree/ProjectFile.cs
index 2c3dbbe4..2fac2f91 100644
--- a/CrowIDE/src/ProjectTree/ProjectFile.cs
+++ b/CrowIDE/src/ProjectTree/ProjectFile.cs
@@ -96,12 +96,24 @@ namespace Crow.Coding
RegisteredEditors.Add (editor, false);
}
}
- public void UpdateSource (object sender, string newSrc){
+ public virtual void UpdateSource (object sender, string newSrc){
System.Diagnostics.Debug.WriteLine ("update source by {0}", sender);
Source = newSrc;
signalOtherRegisteredEditors (sender);
}
- void signalOtherRegisteredEditors (object sender) {
+ public void SignalEditorOfType<T> (){
+ lock (RegisteredEditors) {
+ object[] keys = RegisteredEditors.Keys.ToArray ();
+ foreach (object ed in keys) {
+ T editor = (T)ed;
+ if (editor == null)
+ continue;
+ RegisteredEditors [editor] = false;
+ break;
+ }
+ }
+ }
+ protected void signalOtherRegisteredEditors (object sender) {
lock (RegisteredEditors) {
object[] keys = RegisteredEditors.Keys.ToArray ();
foreach (object editor in keys) {
@@ -192,7 +204,7 @@ namespace Crow.Coding
origSource = source;
NotifyValueChanged ("IsDirty", false);
}
- public void Save () {
+ public virtual void Save () {
if (!IsDirty)
return;
using (StreamWriter sw = new StreamWriter (AbsolutePath)) {
@@ -201,7 +213,7 @@ namespace Crow.Coding
origSource = source;
NotifyValueChanged ("IsDirty", false);
}
- public void SaveAs () {
+ public virtual void SaveAs () {
if (!IsDirty)
return;
using (StreamWriter sw = new StreamWriter (AbsolutePath)) {
@@ -279,7 +291,6 @@ namespace Crow.Coding
{
Close ();
}
-
void onClickSaveAndCloseNow (object sender, EventArgs e)
{
Save ();
diff --git a/CrowIDE/src/ProjectTree/StyleProjectItem.cs b/CrowIDE/src/ProjectTree/StyleProjectItem.cs
new file mode 100644
index 00000000..1de77cd7
--- /dev/null
+++ b/CrowIDE/src/ProjectTree/StyleProjectItem.cs
@@ -0,0 +1,50 @@
+//
+// ProjectNodes.cs
+//
+// Author:
+// Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// Copyright (c) 2013-2017 Jean-Philippe Bruyère
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using System.IO;
+using Crow;
+using System.Threading;
+
+namespace Crow.Coding
+{
+ public class StyleProjectItem : ProjectFile
+ {
+ #region CTOR
+ public StyleProjectItem (ProjectItem pi) : base (pi){
+ }
+ #endregion
+
+ public override void UpdateSource (object sender, string newSrc)
+ {
+ base.UpdateSource (sender, newSrc);
+ Project.solution.ReloadStyling ();
+ }
+ }
+}
+