static Properties GetMemento(IViewContent viewContent) { IMementoCapable mementoCapable = viewContent as IMementoCapable; if (mementoCapable == null) { return(null); } else { return(mementoCapable.CreateMemento()); } }
private static VelerSoftware.SZC.Debugger.Core.Properties GetMemento(IViewContent viewContent) { IMementoCapable mementoCapable = viewContent as IMementoCapable; if (mementoCapable == null) { return(null); } else { return(mementoCapable.CreateMemento()); } }
/// <summary> /// Stores the memento for the view content. /// Such mementos are automatically loaded in ShowView(). /// </summary> public void StoreMemento(IViewContent viewContent) { IMementoCapable mementoCapable = viewContent as IMementoCapable; if (mementoCapable != null && LoadDocumentProperties) { if (viewContent.PrimaryFileName == null) { return; } string key = GetMementoKeyName(viewContent); LoggingService.Debug("Saving memento of '" + viewContent.ToString() + "' to key '" + key + "'"); Properties memento = mementoCapable.CreateMemento(); Properties p = this.LoadOrCreateViewContentMementos(); p.Set(key, memento); FileUtility.ObservedSave(new NamedFileOperationDelegate(p.Save), this.ViewContentMementosFileName, FileErrorPolicy.Inform); } }