コード例 #1
0
ファイル: WorkSpace.cs プロジェクト: BgRva/Blob1
 public WorkSpace(Guid id, IVarMgr varMgr, IElements elementsMgr, IPipes pipesMgr, IWorkSpaceOptionsMgr optionsMgr, IWorkSpaceSettingsMgr settingsMgr)
 {
     SettingsMgr = settingsMgr;
     OptionsMgr = optionsMgr;
     VarMgr = varMgr;
     ElementsMgr = elementsMgr;
     PipesMgr = pipesMgr;
     Id = id;
     _wsProperties = new WorkSpaceProperties(Id);
 }
コード例 #2
0
ファイル: WorkSpace.cs プロジェクト: BgRva/Blob1
 public WorkSpace()
 {
     _wsProperties = new WorkSpaceProperties(Id);
 }
コード例 #3
0
        internal bool ValidateWorkSpaceProperties(IWorkSpaceProperties wsProperties, out Exception ex)
        {
            bool isValid = true;
            ex = null;
            string mssg = null;

            if (wsProperties == null)
            {
                mssg = "The settings mgr is null and cannot be persisted.";
                isValid = false;
            }

            if (!isValid)
            {
                PersistException argEx = new PersistException(mssg);
                ex = argEx;
            }
            return isValid;
        }
コード例 #4
0
 internal void WrapUp(bool isValidContinue, IWorkSpaceProperties wsProperties, Exception ex)
 {
     if (isValidContinue && !IsCancelled)
     {
         // --- set status's to completed when all is done
         WorkerStatus = WorkerStatus.Completed;
         PersistComplete(PercentProgress, false, ex, null);
     }
     else if (IsCancelled)
     {
         PersistComplete(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;
         PersistComplete(PercentProgress, IsCancelled, ex, null);
     }
 }
コード例 #5
0
 internal void PersistCore(IWorkSpaceProperties wsProperties, System.Xml.XmlWriter writer)
 {
     writer.WriteStartElement("WorkSpaceProperties");
     if (!string.IsNullOrEmpty(wsProperties.Name))
     {
         writer.WriteStartElement("Name");
         writer.WriteString(wsProperties.Name);
         writer.WriteEndElement();
     }
     if (!string.IsNullOrEmpty(wsProperties.Description))
     {
         writer.WriteStartElement("Description");
         writer.WriteString(wsProperties.Description);
         writer.WriteEndElement();
     }
     writer.WriteEndElement();
 }
コード例 #6
0
        internal void PersistWorker(IWorkSpaceProperties wsProperties, System.Xml.XmlWriter writer)
        {
            Exception ex = null;
            bool isValidContinue = false;

            // ------------------------------------------------
            UpdateProgress(1, "Persisting ...");

            try
            {
                // ---
                isValidContinue = ValidateWorkSpaceProperties(wsProperties, out ex);
                if (isValidContinue && !IsCancelled)
                {
                    PersistCore(wsProperties, writer);
                }
                WrapUp(isValidContinue, wsProperties, ex);
            }
            catch (Exception x)
            {
                // update the status if the ex is not recoverable
                PersistWorkerCleanUp(x);
            }
        }
コード例 #7
0
        public void PersistProperties(IWorkSpaceProperties wsProperties, System.Xml.XmlWriter writer)
        {
            IsAsynch = false;
            WorkerStatus = WorkerStatus.ExecutingSynch;
            CompletionCalled = false;
            PercentProgress = 0;

            PersistWorker(wsProperties, writer);
        }
コード例 #8
0
        public void PersistPropertiesAsync(IWorkSpaceProperties wsProperties, System.Xml.XmlWriter writer)
        {
            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 PersistDelegate(PersistWorker).BeginInvoke(wsProperties, writer, null, null);
        }
コード例 #9
0
ファイル: WorkSpacePersister.cs プロジェクト: BgRva/Blob1
 internal void PersistProperties(IWorkSpaceProperties props, System.Xml.XmlWriter writer)
 {
     // Nothing gets written out if it is null
     if (props!=null)
         PropertiesPersister.PersistProperties(props, writer);
 }
コード例 #10
0
        internal void UnpersistCore(IWorkSpaceProperties wsProperties, System.Xml.XmlReader reader)
        {
            // Assumes reader has started the read of element "WorkSpaceProperties"
            int startDepth = reader.Depth;

            string tmp = null;
            while (reader.Read() && reader.Depth>startDepth)
            {
                if (reader.IsStartElement() && reader.Name == "Name")
                {
                    if (!reader.IsEmptyElement)
                    {
                        tmp = null;
                        UnpersistName(reader, out tmp);
                        wsProperties.Name = string.Copy(tmp);
                    }
                }
                else if (reader.IsStartElement() && reader.Name == "Description")
                {
                    if (!reader.IsEmptyElement)
                    {
                        tmp = null;
                        UnpersistDescription(reader, out tmp);
                        wsProperties.Description = string.Copy(tmp);
                    }
                }
            }
        }
コード例 #11
0
        public void UnpersistProperties(IWorkSpaceProperties target, System.Xml.XmlReader reader)
        {
            IsAsynch = false;
            WorkerStatus = WorkerStatus.ExecutingSynch;
            CompletionCalled = false;
            PercentProgress = 0;

            UnpersistWorker(target, reader);
        }
コード例 #12
0
ファイル: WorkSpaceUnpersister.cs プロジェクト: BgRva/Blob1
 internal void UnpersistProperties(IWorkSpaceProperties properties, System.Xml.XmlReader reader)
 {
     PropertiesUnpersister.UnpersistProperties(properties, reader);
 }
コード例 #13
0
ファイル: AppPresenter.cs プロジェクト: BgRva/Blob1
 /// <summary>
 /// Sets the default values for <paramref name="wsProperties"/>.  This method should be called and applied
 /// for newly created WorkSpaces.
 /// </summary>
 /// <param name="wsProperties">A newly created <see cref="IWorkSpaceProperties"/> object.</param>
 internal void SetDefaultProperties(IWorkSpaceProperties wsProperties)
 {
     wsProperties.Name = "WorkSpace";
 }