Beispiel #1
0
 public static void Output(this WfClientKeyedDescriptorBase cp)
 {
     if (cp != null)
     {
         Console.WriteLine("Key: {0}, Name: {1}, Enabled: {2}", cp.Key, cp.Name, cp.Enabled);
     }
 }
Beispiel #2
0
        public static void AreSame(this WfClientKeyedDescriptorBase c, IWfKeyedDescriptor s)
        {
            Assert.IsNotNull(c);
            Assert.IsNotNull(s);

            Assert.AreEqual(c.Key, s.Key);
            Assert.AreEqual(c.Name, s.Name);
            Assert.AreEqual(c.Description, s.Description);
        }
Beispiel #3
0
        public static void AssertCollection(this IEnumerable <WfClientKeyedDescriptorBase> cvc, IEnumerable <WfClientKeyedDescriptorBase> svc)
        {
            Assert.AreEqual(cvc.Count(), svc.Count());

            foreach (WfClientKeyedDescriptorBase c in cvc)
            {
                WfClientKeyedDescriptorBase serverObj = svc.Where(s => s.Key == c.Key).First();

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

            WfClientKeyedDescriptorBase 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);

            JSONSerializerExecute.FillDeserializedCollection <ClientPropertyValue>(dictionary.GetValue("properties", (object)null), desp.Properties);

            return(desp);
        }
        public override IDictionary <string, object> Serialize(object obj, JavaScriptSerializer serializer)
        {
            WfClientKeyedDescriptorBase desp = (WfClientKeyedDescriptorBase)obj;

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

            dictionary.AddNonDefaultValue("key", desp.Key);
            dictionary.AddNonDefaultValue("name", desp.Name);

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

            dictionary.Add("properties", desp.Properties);

            return(dictionary);
        }
Beispiel #6
0
 public WfClientExternalUserCollection(WfClientKeyedDescriptorBase owner)
 {
     this.Owner = owner;
 }
 internal WfClientConditionDescriptor(WfClientKeyedDescriptorBase owner)
 {
     _Owner = owner;
 }