public Global(sCMS.Enums.FieldType Type, string Name) { this._id = Guid.NewGuid (); this._createtimestamp = SNDK.Date.CurrentDateTimeToTimestamp (); this._updatetimestamp = SNDK.Date.CurrentDateTimeToTimestamp (); this._field = new Field (Type, Name); this._content = new Content (this._field); }
public void SetContent(Field Field, object Data) { SetContent (Field.Id, Data); }
public object GetContent(Field Field) { return GetContent (Field.Id); }
public void RemoveField(Field Field) { this._fields.RemoveAll (delegate (Field f) { return f.Id == Field.Id; }); }
public void AddField(Field Field) { this._fields.Add (Field); }
public Content(Field Field, object Data) { this._id = Field.Id; this._type = Field.Type; this.Data = Data; }
public Content(Field field) { this._id = field.Id; this._type = field.Type; this.Data = Field.DefaultValue (field.Type); }
public static Field FromXmlDocument(XmlDocument xmlDocument) { Hashtable item; Field result = new Field (); try { item = (Hashtable)SNDK.Convert.FromXmlDocument (SNDK.Convert.XmlNodeToXmlDocument (xmlDocument.SelectSingleNode ("(//scms.field)[1]"))); } catch { item = (Hashtable)SNDK.Convert.FromXmlDocument (xmlDocument); } try { result._id = new Guid ((string)item["id"]); } catch (Exception exception) { // LOG: LogDebug.ExceptionUnknown SorentoLib.Services.Logging.LogDebug (string.Format (SorentoLib.Strings.LogDebug.ExceptionUnknown, "SCMS.FIELD", exception.Message)); // EXCEPTION: Exception.FieldFromXMLDocument throw new Exception (Strings.Exception.FieldFromXMLDocument); } if (item.ContainsKey ("type")) { result._type = SNDK.Convert.StringToEnum<Enums.FieldType> ((string)item["type"]); } if (item.ContainsKey ("name")) { result._name = (string)item["name"]; } if (item.ContainsKey ("sort")) { result._sort = int.Parse ((string)item["sort"]); } if (item.ContainsKey ("options")) { try { result._options = (Hashtable)item["options"]; } catch { } } return result; }