Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="_tg"></param>
 public void LoadFromTGSerializedObject(TGSerializedObject _tg)
 {
     Name          = _tg.GetString("Name");
     Value         = _tg.GetString("Value");
     AttributeType = (AttributeTypes)_tg.GetNullableEnum("AttributeType",
                                                         typeof(AttributeTypes));
 }
Beispiel #2
0
        public override void LoadFromTGSerializedObject(TGSerializedObject _tg)
        {
            base.LoadFromTGSerializedObject(_tg);

            Name  = _tg.GetString("Name");
            Value = _tg.GetString("Value");

            string temp = _tg.GetString("AttributeType");

            AttributeType = (AttributeTypes)Enum.Parse(typeof(AttributeTypes), temp);
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="_tg"></param>
        public virtual void LoadFromTGSerializedObject(TGSerializedObject _tg)
        {
            Guid = _tg.GetGuid("Guid");
            if (Guid == Guid.Empty)
            {
                Guid = Guid.NewGuid();
            }

            Active = _tg.GetBoolean("Active");
            LastModifiedDateTime = _tg.GetDateTime("LastModifiedDateTime");
            LastModifiedBy       = _tg.GetNullableGuid("LastModifiedBy");

            string versionTimeStamp = _tg.GetString("VersionTimeStamp");

            if (VersionTimeStamp == null)
            {
                VersionTimeStamp = DateHelper.GetCurrentTimeStamp();
            }
            else
            {
                VersionTimeStamp = versionTimeStamp;
            }

            ParentGuid        = _tg.GetNullableGuid("ParentGuid");
            VersionGuid       = _tg.GetGuid("VersionGuid");
            PersistedDateTime = _tg.GetDateTime("PersistedDateTime");
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="_tg"></param>
        public void LoadFromTGSerializedObject(TGSerializedObject _tg)
        {
            int recordCount = _tg.GetInt32("RecordCount");

            for (int i = 0; i < recordCount; i++)
            {
                string serialized = _tg.GetString(i.ToString());
                T      item       = TGSerializedObject.GetTGSerializable <T>(serialized);
                Add(item);
            }
        }
Beispiel #5
0
        public void LoadFromTGSerializedObject(TGSerializedObject _tg)
        {
            int?propertyCount = _tg.GetNullableInt32("PropertyCount");

            if (propertyCount != null)
            {
                for (int i = 0; i < propertyCount.Value; i++)
                {
                    string temp = _tg.GetString(i.ToString());

                    Property p = TGSerializedObject.GetTGSerializable <Property>(temp);
                    Add(p);
                }
            }
        }
Beispiel #6
0
        /// <summary>
        /// Loads from TG serilizable object.
        /// </summary>
        /// <param name='_tg'>
        /// Bcn.
        /// </param>
        public void LoadFromTGSerializedObject(TGSerializedObject _tg)
        {
            AttributeDefinitionGuid = _tg.GetGuid("AttributeDefinitionGuid");
            string value = _tg.GetString("Attributes");

            if (value != null)
            {
                string[] temp = value.Split(new[] { "||" }, StringSplitOptions.RemoveEmptyEntries);

                foreach (string item in temp)
                {
                    if (!string.IsNullOrEmpty(item))
                    {
                        Attribute attribute = new Attribute();
                        attribute.LoadFromTGSerializedString(item);

                        Add(attribute);
                    }
                }
            }
        }