Work on project panel, trees, added settings

This commit is contained in:
2014-07-28 20:18:18 +03:00
parent 5e526fa48c
commit 1c4c7ccfb0
23 changed files with 932 additions and 133 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using RainmeterStudio.Storage;
namespace RainmeterStudio.Model
{
@ -170,9 +171,26 @@ namespace RainmeterStudio.Model
/// <summary>
/// Gets or sets the root node
/// </summary>
[XmlElement("root")]
[XmlIgnore]
public Tree<Reference> Root { get; set; }
/// <summary>
/// Gets or sets the serializable root node
/// </summary>
/// <remarks>Warning: not efficient</remarks>
[XmlElement("root")]
public SerializableTree<Reference> SerializableRoot
{
get
{
return Root.AsSerializableTree();
}
set
{
Root = value.AsTree();
}
}
#endregion
#region Constructor

View File

@ -7,13 +7,11 @@ using System.Xml.Serialization;
namespace RainmeterStudio.Model
{
public class Tree<T>
public class Tree<T> : IList<Tree<T>>
{
[XmlElement("data")]
public T Data { get; set; }
[XmlArray("children"), XmlArrayItem("child")]
public ObservableCollection<Tree<T>> Children { get; set; }
public ObservableCollection<Tree<T>> Children { get; private set; }
public Tree()
{
@ -150,5 +148,10 @@ namespace RainmeterStudio.Model
return hash;
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return Children.GetEnumerator();
}
}
}