aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/GraphicObjects
diff options
context:
space:
mode:
Diffstat (limited to 'src/GraphicObjects')
-rw-r--r--src/GraphicObjects/GraphicObject.cs2
-rw-r--r--src/GraphicObjects/Group.cs2
-rw-r--r--src/GraphicObjects/ListBox.cs3
-rw-r--r--src/GraphicObjects/Popper.cs99
-rw-r--r--src/GraphicObjects/TemplatedContainer.cs3
-rw-r--r--src/GraphicObjects/TemplatedControl.cs8
6 files changed, 59 insertions, 58 deletions
diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs
index 36be650d..8966acf6 100644
--- a/src/GraphicObjects/GraphicObject.cs
+++ b/src/GraphicObjects/GraphicObject.cs
@@ -1304,7 +1304,7 @@ namespace Crow
PropertyInfo pi = mi as PropertyInfo;
if (pi.GetSetMethod () == null) {
- Debug.WriteLine ("GOML: Read only property in " + thisType.ToString() + " : " + name);
+ Debug.WriteLine ("XML: Read only property in " + thisType.ToString() + " : " + name);
return;
}
diff --git a/src/GraphicObjects/Group.cs b/src/GraphicObjects/Group.cs
index 4d851b1a..a6ca5758 100644
--- a/src/GraphicObjects/Group.cs
+++ b/src/GraphicObjects/Group.cs
@@ -337,7 +337,7 @@ namespace Crow
}
}
if (t == null)
- throw new Exception ("Crow." + subTree.Name + " type not found");
+ throw new Exception (subTree.Name + " type not found");
GraphicObject go = (GraphicObject)Activator.CreateInstance(t);
(go as IXmlSerializable).ReadXml(subTree);
AddChild(go);
diff --git a/src/GraphicObjects/ListBox.cs b/src/GraphicObjects/ListBox.cs
index b92fe39f..58d41e0b 100644
--- a/src/GraphicObjects/ListBox.cs
+++ b/src/GraphicObjects/ListBox.cs
@@ -104,7 +104,7 @@ namespace Crow
SelectedItemChanged.Raise (this, new SelectionChangeEventArgs (SelectedItem));
}
- #region implemented abstract members of TemplatedControl
+ #region TemplatedControl override
protected override void loadTemplate (GraphicObject template = null)
{
base.loadTemplate (template);
@@ -114,6 +114,7 @@ namespace Crow
_gsList = _list as GenericStack;
}
#endregion
+
void loading(){
if (ItemTemplates == null)
ItemTemplates = new Dictionary<string, ItemTemplate> ();
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs
index 14e7ec7a..0a013ae1 100644
--- a/src/GraphicObjects/Popper.cs
+++ b/src/GraphicObjects/Popper.cs
@@ -37,12 +37,54 @@ namespace Crow
bool _isPopped;
string caption;
- string image;
+ Alignment popDirection;
GraphicObject _content;
public event EventHandler Pop;
public event EventHandler Unpop;
+ #region Public Properties
+ [XmlAttributeAttribute()][DefaultValue("Popper")]
+ public string Caption {
+ get { return caption; }
+ set {
+ if (caption == value)
+ return;
+ caption = value;
+ NotifyValueChanged ("Caption", caption);
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(false)]
+ public bool IsPopped
+ {
+ get { return _isPopped; }
+ set
+ {
+ if (value == _isPopped)
+ return;
+
+ _isPopped = value;
+ NotifyValueChanged ("IsPopped", _isPopped);
+
+ if (_isPopped)
+ onPop (this, null);
+ else
+ onUnpop (this, null);
+
+ }
+ }
+ [XmlAttributeAttribute()][DefaultValue(Alignment.Bottom)]
+ public virtual Alignment PopDirection {
+ get { return popDirection; }
+ set {
+ if (popDirection == value)
+ return;
+ popDirection = value;
+ NotifyValueChanged ("PopDirection", popDirection);
+ }
+ }
+ #endregion
+
public override GraphicObject Content {
get { return _content; }
set {
@@ -109,6 +151,7 @@ namespace Crow
}
}
+ #region GraphicObject overrides
public override void OnLayoutChanges (LayoutingType layoutType)
{
base.OnLayoutChanges (layoutType);
@@ -120,7 +163,6 @@ namespace Crow
_content.MinimumSize = new Size (this.Slot.Width, _content.MinimumSize.Height);
}
- #region GraphicObject overrides
public override void ClearBinding ()
{
//ensure popped window is cleared
@@ -156,59 +198,6 @@ namespace Crow
IsPopped = false;
}
#endregion
-
- #region Public Properties
- [XmlAttributeAttribute()][DefaultValue("Popper")]
- public string Caption {
- get { return caption; }
- set {
- if (caption == value)
- return;
- caption = value;
- NotifyValueChanged ("Caption", caption);
- }
- }
- [XmlAttributeAttribute()][DefaultValue("#Crow.Images.Icons.expandable.svg")]
- public string Image {
- get { return image; }
- set {
- if (image == value)
- return;
- image = value;
- NotifyValueChanged ("Image", image);
- }
- }
- [XmlAttributeAttribute()][DefaultValue(false)]
- public bool IsPopped
- {
- get { return _isPopped; }
- set
- {
- if (value == _isPopped)
- return;
-
- _isPopped = value;
- NotifyValueChanged ("IsPopped", _isPopped);
-
- if (_isPopped)
- onPop (this, null);
- else
- onUnpop (this, null);
-
- }
- }
- Alignment popDirection;
- [XmlAttributeAttribute()][DefaultValue(Alignment.Bottom)]
- public virtual Alignment PopDirection {
- get { return popDirection; }
- set {
- if (popDirection == value)
- return;
- popDirection = value;
- NotifyValueChanged ("PopDirection", popDirection);
- }
- }
- #endregion
public virtual void onPop(object sender, EventArgs e)
{
diff --git a/src/GraphicObjects/TemplatedContainer.cs b/src/GraphicObjects/TemplatedContainer.cs
index a845722a..18977cf9 100644
--- a/src/GraphicObjects/TemplatedContainer.cs
+++ b/src/GraphicObjects/TemplatedContainer.cs
@@ -92,6 +92,9 @@ namespace Crow
t = expT;
}
}
+ if (t == null)
+ throw new Exception (xr.Name + " type not found");
+
GraphicObject go = (GraphicObject)Activator.CreateInstance (t);
(go as IXmlSerializable).ReadXml (xr);
diff --git a/src/GraphicObjects/TemplatedControl.cs b/src/GraphicObjects/TemplatedControl.cs
index 9040ddeb..b325a0d2 100644
--- a/src/GraphicObjects/TemplatedControl.cs
+++ b/src/GraphicObjects/TemplatedControl.cs
@@ -27,6 +27,7 @@ using System.Diagnostics;
using System.Linq;
using System.Collections.Generic;
using System.Text;
+using System.Reflection;
namespace Crow
{
@@ -174,6 +175,13 @@ namespace Crow
xr.Read ();
Type t = Type.GetType ("Crow." + xr.Name);
+ if (t == null) {
+ Assembly a = Assembly.GetEntryAssembly ();
+ foreach (Type expT in a.GetExportedTypes ()) {
+ if (expT.Name == xr.Name)
+ t = expT;
+ }
+ }
GraphicObject go = (GraphicObject)Activator.CreateInstance (t);
(go as IXmlSerializable).ReadXml (xr);