Esempio n. 1
0
        internal VaultItem(string id, string itemKey, DateTime purchaseDate, List <ObjectProperty> properties)
        {
            this.Id               = id;
            this.ItemKey          = itemKey;
            this.PurchaseDate     = purchaseDate;
            this.ExistsInDatabase = true;
            this.Properties       = new Dictionary <string, object>();

            if (properties != null)
            {
                this.Properties = (DatabaseEx.FromDictionary(DatabaseEx.ToDictionary(properties)) as DatabaseObject).Properties;
            }
        }
Esempio n. 2
0
        internal DatabaseObject(BigDB owner, string table, string key, string version, List <ObjectProperty> properties)
        {
            this.Owner            = owner;
            this.Table            = table;
            this.Key              = key;
            this.Version          = version;
            this.Properties       = new Dictionary <string, object>();
            this.ExistsInDatabase = true;

            if (properties != null)
            {
                this.Properties = (DatabaseEx.FromDictionary(DatabaseEx.ToDictionary(properties)) as DatabaseObject).Properties;
            }
        }
Esempio n. 3
0
        internal static List <ValueObject> MakeRange(object[] indexPath, object tail)
        {
            var result = new object[((indexPath == null) ? 0 : indexPath.Length) + ((tail == null) ? 0 : 1)];

            if (indexPath != null)
            {
                Array.Copy(indexPath, result, indexPath.Length);
            }

            if (tail != null)
            {
                result[result.Length - 1] = tail;
            }

            return(result.Select(value => DatabaseEx.Create(value)).ToList());
        }
Esempio n. 4
0
 /// <summary>
 /// This method allows you to load a Database Object (properties only) from a TSON string.
 /// </summary>
 /// <param name="input"> The TSON string. </param>
 /// <returns> A database object containing the properties of the deserialized TSON. </returns>
 public static DatabaseObject LoadFromString(string input) => DatabaseEx.FromDictionary(TsonConvert.DeserializeObject(input)) as DatabaseObject;