internal void CopyPropertiesTo(WfKeyedDescriptorBase destObject)
        {
            WfProcessDescriptor actDesp = (WfProcessDescriptor)destObject;

            base.CloneProperties(destObject);

            this.CloneCollectionProperties(actDesp);
        }
Example #2
0
        internal protected virtual void CloneProperties(WfKeyedDescriptorBase destObject)
        {
            destObject.NullCheck("destObject");

            destObject.Properties.Clear();

            destObject.Properties.CopyFrom(this.Properties, p => p.Clone());

            destObject.ProcessInstance = this.ProcessInstance;
        }
Example #3
0
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            string key = DictionaryHelper.GetValue(dictionary, "Key", string.Empty);

            WfKeyedDescriptorBase desp = CreateInstance(key, dictionary, type, serializer);

            desp.Name        = DictionaryHelper.GetValue(dictionary, "Name", string.Empty);
            desp.Enabled     = DictionaryHelper.GetValue(dictionary, "Enabled", false);
            desp.Description = DictionaryHelper.GetValue(dictionary, "Description", string.Empty);

            return(desp);
        }
Example #4
0
        public override IDictionary <string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            WfKeyedDescriptorBase desp = (WfKeyedDescriptorBase)obj;

            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("Key", desp.Key);
            dictionary.Add("Name", desp.Name);

            DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "Description", desp.Description);
            DictionaryHelper.AddNonDefaultValue <string, object>(dictionary, "Enabled", desp.Enabled);

            return(dictionary);
        }
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            string key = DictionaryHelper.GetValue(dictionary, "Key", string.Empty);

            WfKeyedDescriptorBase desp = CreateInstance(key, dictionary, type, serializer);

            desp.Name        = DictionaryHelper.GetValue(dictionary, "Name", string.Empty);;
            desp.Enabled     = DictionaryHelper.GetValue(dictionary, "Enabled", false);
            desp.Description = DictionaryHelper.GetValue(dictionary, "Description", string.Empty);

            if (dictionary.ContainsKey("Properties"))
            {
                PropertyValueCollection properties = JSONSerializerExecute.Deserialize <PropertyValueCollection>(dictionary["Properties"]);

                desp.Properties.Clear();
                desp.Properties.CopyFrom(properties);
            }

            return(desp);
        }
        internal protected override void CloneProperties(WfKeyedDescriptorBase destObject)
        {
            string originalKey = destObject.Key;

            base.CloneProperties(destObject);

            WfForwardTransitionDescriptor transition = (WfForwardTransitionDescriptor)destObject;

            if (originalKey.IsNullOrEmpty() && this.ProcessInstance != null)
            {
                transition.Key = this.ProcessInstance.Descriptor.FindNotUsedTransitionKey();
            }
            else
            {
                transition.Key = originalKey;
            }

            transition.Condition = this.Condition.Clone();
            transition.Variables.CopyFrom(this.Variables, v => v.Clone());
        }
        internal protected override void CloneProperties(WfKeyedDescriptorBase destObject)
        {
            base.CloneProperties(destObject);

            WfBranchProcessTemplateDescriptor template = (WfBranchProcessTemplateDescriptor)destObject;

            template.Resources.Clear();
            template.Resources.CopyFrom(this.Resources);

            template.CancelSubProcessNotifier.Clear();
            template.CancelSubProcessNotifier.CopyFrom(this.CancelSubProcessNotifier);

            template.Condition = this.Condition.Clone();

            if (this._OperationDefinition != null)
            {
                template._OperationDefinition = this._OperationDefinition.Clone();
            }

            template.RelativeLinks.Clear();
            template.RelativeLinks.CopyFrom(this.RelativeLinks);
        }