Example #1
0
        /// <summary>
        /// Creates a new instance of the Model and generates an associated hash.
        /// The hash is used to determine whether the Model has unsaved changes.
        /// </summary>
        /// <typeparam name="T">The type of the root object in the Model.</typeparam>
        /// <returns>A newly created Model.</returns>
        protected internal static T Create <T> () where T : ModelRoot, new ()
        {
            // Create a new model
            T model = new T();

            // Get the contents and hash
            model.diskSyncHash = ModelRoot.GetHash(model);

            model.OnAfterCreate();

            // Return the model
            return(model);
        }
Example #2
0
 internal bool HashEquals(ModelRoot model)
 {
     return(ModelRoot.GetHash(this).Equals(ModelRoot.GetHash(model)));
 }