Exemple #1
0
        public void SaveToMemento(ILQHsmMemento memento)
        {
            ModelInformation modelInformation = this.ModelInformation;

            memento.ModelVersion = modelInformation.ModelVersion;
            memento.ModelGuid    = modelInformation.Guid;

            memento.Id           = this.Id;
            memento.GroupId      = this.GroupId;
            memento.CurrentState = this.CurrentState;

            SaveHistoryStates(memento);
            SaveFields(memento);
        }
Exemple #2
0
        public void RestoreFromMemento(ILQHsmMemento memento)
        {
            ModelInformation modelInformation = this.ModelInformation;

            if (modelInformation.Guid != memento.ModelGuid)
            {
                string msg = string.Format("Hsm Guid [{0}] is not the same as contained by the Memento [{1}]", modelInformation.Guid, memento.ModelGuid);
                throw new InvalidOperationException(msg);
            }

            _UniqueName       = memento.Id;
            _GroupId          = memento.GroupId;
            this.CurrentState = memento.CurrentState;

            RestoreHistoryStates(memento);
            RestoreFields(memento);

            LogRestored();
        }
 public ModelInformationAttribute(string fileName, string guid, string modelVersion)
 {
     _ModelInformation = new ModelInformation(fileName, guid, modelVersion);
 }
 public ModelInformationAttribute(string fileName, string guid, string modelVersion)
 {
     _ModelInformation = new ModelInformation (fileName, guid, modelVersion);
 }