public IOptionsMgrPresenter Create(IOptionsMgr mgr, IOptionsView view) { IOptionsMgrPresenter presenter = null; if (mgr != null && view != null) { presenter = new OptionsMgrPresenter(mgr, view); } return presenter; }
internal void WrapUp(bool isValidContinue, IOptionsMgr optionsMgr, Exception ex) { if (isValidContinue && !IsCancelled) { // --- set status's to completed when all is done WorkerStatus = WorkerStatus.Completed; UnpersistComplete(PercentProgress, false, ex, null); } else if (IsCancelled) { UnpersistComplete(PercentProgress, IsCancelled, ex, null); } else { // ex cannot be null if an error occured if (ex == null) ex = new FxExecutionErrorException("An persistance error occured."); WorkerStatus = WorkerStatus.Error; UnpersistComplete(PercentProgress, IsCancelled, ex, null); } }
internal bool ValidateOptionsMgr(IOptionsMgr optionsMgr, out Exception ex) { bool isValid = true; ex = null; string mssg = null; if (optionsMgr == null) { mssg = "The options mgr is null and cannot be persisted."; isValid = false; } if (!isValid) { PersistException argEx = new PersistException(mssg); ex = argEx; } return isValid; }
internal void UnpersistWorker(IOptionsMgr optionsMgr, System.Xml.XmlReader reader) { Exception ex = null; bool isValidContinue = false; // ------------------------------------------------ UpdateProgress(1, "Unpersisting ..."); try { // --- isValidContinue = ValidateReader(reader, out ex); if (isValidContinue && !IsCancelled) { UnpersistCore(optionsMgr, reader); } WrapUp(isValidContinue,optionsMgr, ex); } catch (Exception x) { // update the status if the ex is not recoverable UnpersistWorkerCleanUp(x); } }
internal void UnpersistCore(IOptionsMgr optionsMgr, System.Xml.XmlReader reader) { // do nothing }
public void UnpersistOptionsAsync(IOptionsMgr target, System.Xml.XmlReader reader) { throw new Exception("The method or operation is not implemented."); if (IsBusy) { CancelAsync(); Reset(); } IsAsynch = true; WorkerStatus = WorkerStatus.ExecutingAsynch; PercentProgress = 0; CompletionCalled = false; AsynchOp = AsyncOperationManager.CreateOperation(null); new UnpersistDelegate(UnpersistWorker).BeginInvoke(target, reader, null, null); }
public void UnpersistOptions(IOptionsMgr target, System.Xml.XmlReader reader) { IsAsynch = false; WorkerStatus = WorkerStatus.ExecutingSynch; CompletionCalled = false; PercentProgress = 0; UnpersistWorker(target, reader); }
internal IOptionsMgrPresenter CreateOptionsMgrPresenter(IOptionsMgr mgr, IOptionsView view) { IOptionsMgrPresenter presenter = null; using (OptionsMgrPresenterFactory fac = new OptionsMgrPresenterFactory()) { presenter = fac.Create(mgr, view); } return presenter; }
internal void PersistCore(IOptionsMgr optionsMgr, System.Xml.XmlWriter writer) { writer.WriteStartElement("Options"); writer.WriteEndElement(); }
public void PersistOptions(IOptionsMgr optionsMgr, System.Xml.XmlWriter writer) { IsAsynch = false; WorkerStatus = WorkerStatus.ExecutingSynch; CompletionCalled = false; PercentProgress = 0; PersistWorker(optionsMgr, writer); }
public OptionsMgrPresenter(IOptionsMgr mgr, IOptionsView view) { View = view; Mgr = mgr; }