コード例 #1
0
 void PersistSettings(SaveDebugTO workflow)
 {
     if (!string.IsNullOrEmpty(workflow?.ServiceName))
     {
         var tmp = new DebugTO();
         tmp.CopyFromSaveDebugTO(workflow);
         _debugPersistSettings[workflow.WorkflowID] = tmp;
     }
 }
コード例 #2
0
ファイル: DebugTO.cs プロジェクト: Warewolf-ESB/Warewolf
 public void CopyFromSaveDebugTO(SaveDebugTO that)
 {
     DataList       = that.DataList;
     ServiceName    = that.ServiceName;
     IsDebugMode    = that.IsDebugMode;
     RememberInputs = that.RememberInputs;
     XmlData        = that.XmlData;
     WorkflowID     = that.WorkflowID;
     DataListHash   = that.DataListHash;
 }
コード例 #3
0
 public void CopyFromSaveDebugTO(SaveDebugTO that)
 {
     DataList = that.DataList;
     ServiceName = that.ServiceName;
     IsDebugMode = that.IsDebugMode;
     RememberInputs = that.RememberInputs;
     XmlData = that.XmlData;
     WorkflowID = that.WorkflowID;
     RememberInputs = that.RememberInputs;
     DataListHash = that.DataListHash;
 }
コード例 #4
0
        public SaveDebugTO CopyToSaveDebugTO()
        {
            SaveDebugTO that = new SaveDebugTO {
                DataList = DataList, ServiceName = ServiceName, IsDebugMode = IsDebugMode, RememberInputs = RememberInputs, XmlData = XmlData, WorkflowID = WorkflowID
            };

            that.RememberInputs = RememberInputs;
            that.DataListHash   = DataListHash;

            return(that);
        }
コード例 #5
0
        /// <summary>
        ///     Save the debug session data
        /// </summary>
        /// <param name="to"></param>
        /// <returns></returns>
        public DebugTO PersistDebugSession(DebugTO to)
        {
            lock (SettingsLock)
            {
                if (to.DataList != null)
                {
                    to.DataListHash = to.DataList.GetHashCode();
                }
                // set incoming hash //2013.01.22: Ashley Lewis - Added condition for Bug 7837
                to.Error = string.Empty;

                if (to.RememberInputs)
                {
                    // update the current TO
                    _debugPersistSettings[to.WorkflowID] = to;
                }
                else
                {
                    // no longer relavent, remove it
                    DebugTO tmp;

                    if (_debugPersistSettings.TryGetValue(to.WorkflowID, out tmp))
                    {
                        _debugPersistSettings[to.WorkflowID].CleanUp();
                        _debugPersistSettings.Remove(to.WorkflowID);
                    }
                }

                var settingList = new List <SaveDebugTO>();

                // build the list
                foreach (string key in _debugPersistSettings.Keys)
                {
                    DebugTO tmp;

                    if (key.Length > 0 && _debugPersistSettings.TryGetValue(key, out tmp))
                    {
                        SaveDebugTO that = tmp.CopyToSaveDebugTO();
                        settingList.Add(that);
                    }
                }

                // push to disk
                using (Stream s = File.Open(_debugPersistPath, FileMode.Truncate))
                {
                    var bf = new XmlSerializer(typeof(List <SaveDebugTO>));
                    bf.Serialize(s, settingList);
                }
            }

            return(to);
        }
コード例 #6
0
        public SaveDebugTO CopyToSaveDebugTO()
        {
            var that = new SaveDebugTO
            {
                DataList = DataList,
                ServiceName = ServiceName,
                IsDebugMode = IsDebugMode,
                RememberInputs = RememberInputs,
                XmlData = XmlData,
                WorkflowID = WorkflowID
            };

            that.RememberInputs = RememberInputs;
            that.DataListHash = DataListHash;

            return that;
        }