Updating the model where serialization attributes where missing and adding a few comments.
Fixes U4-48
This commit is contained in:
@@ -1,8 +1,13 @@
|
||||
namespace Umbraco.Core.Models
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the various statuses a Content object can have
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public enum ContentStatus
|
||||
{
|
||||
Unpublished, Published, Expired, Trashed, AwaitingRelease
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
@@ -7,6 +10,8 @@ namespace Umbraco.Core.Models
|
||||
/// Object is added to support complex values from PropertyEditors,
|
||||
/// but will be saved under the Ntext column.
|
||||
/// </remarks>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public enum DataTypeDatabaseType
|
||||
{
|
||||
Integer,
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an abstract file which provides basic functionality for a File with an Alias and Name
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public abstract class File : IFile
|
||||
{
|
||||
private string _name;
|
||||
@@ -16,6 +22,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Gets or sets the Name of the File including extension
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public virtual string Name
|
||||
{
|
||||
get
|
||||
@@ -32,6 +39,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Gets or sets the Alias of the File, which is the name without the extension
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public virtual string Alias
|
||||
{
|
||||
get
|
||||
@@ -51,11 +59,13 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Gets or sets the Path to the File from the root of the site
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public virtual string Path { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Content of a File
|
||||
/// </summary>
|
||||
[DataMember]
|
||||
public virtual string Content { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
namespace Umbraco.Core.Models
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the three allowed BaseTypes
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public enum MacroPropertyTypeBaseTypes
|
||||
{
|
||||
Int32,
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
namespace Umbraco.Core.Models
|
||||
using System;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum for the various types of Macros
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public enum MacroTypes
|
||||
{
|
||||
Xslt = 1,
|
||||
|
||||
@@ -8,6 +8,9 @@ using System.Threading;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a Collection of <see cref="Property"/> objects
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class PropertyCollection : KeyedCollection<string, Property>, INotifyCollectionChanged
|
||||
|
||||
@@ -8,6 +8,9 @@ using System.Threading;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of <see cref="PropertyGroup"/> objects
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class PropertyGroupCollection : KeyedCollection<string, PropertyGroup>, INotifyCollectionChanged
|
||||
|
||||
@@ -8,6 +8,9 @@ using System.Threading;
|
||||
|
||||
namespace Umbraco.Core.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of <see cref="PropertyType"/> objects
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class PropertyTypeCollection : KeyedCollection<string, PropertyType>, INotifyCollectionChanged
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
@@ -7,6 +9,8 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Represents a Script file
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class Script : File
|
||||
{
|
||||
public Script(string path) : base(path)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Models.Css;
|
||||
using Umbraco.Core.Models.EntityBase;
|
||||
@@ -9,6 +11,8 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Represents a Stylesheet file
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class Stylesheet : File
|
||||
{
|
||||
public Stylesheet(string path) : base(path)
|
||||
@@ -19,6 +23,7 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Returns a list of <see cref="StylesheetProperty"/>
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IEnumerable<StylesheetProperty> Properties
|
||||
{
|
||||
get
|
||||
@@ -26,6 +31,7 @@ namespace Umbraco.Core.Models
|
||||
var properties = new List<StylesheetProperty>();
|
||||
var parser = new CssParser(Path);//TODO change CssParser so we can use Content instead of Path
|
||||
|
||||
//TODO Need to explorer how the Stylesheet should be iterated to generate a list of css properties
|
||||
foreach (CssAtRule statement in parser.StyleSheet.Statements)
|
||||
{
|
||||
properties.Add(new StylesheetProperty(statement.Value, ""));
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.IO;
|
||||
|
||||
@@ -7,6 +9,8 @@ namespace Umbraco.Core.Models
|
||||
/// <summary>
|
||||
/// Represents a Template file
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
[DataContract(IsReference = true)]
|
||||
public class Template : File
|
||||
{
|
||||
public Template(string path)
|
||||
|
||||
Reference in New Issue
Block a user