void PersistSettings(SaveDebugTO workflow)
 {
     if (!string.IsNullOrEmpty(workflow?.ServiceName))
     {
         var tmp = new DebugTO();
         tmp.CopyFromSaveDebugTO(workflow);
         _debugPersistSettings[workflow.WorkflowID] = tmp;
     }
 }
Example #2
0
 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;
 }
Example #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;
 }
Example #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);
        }
        /// <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);
        }
Example #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;
        }