public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
 {
     if (server == null)
         server = new WfGroupResourceDescriptor((IGroup)((WfClientGroupResourceDescriptor)client).Group.ToOguObject());
     else
         ((WfGroupResourceDescriptor)server).Group = (IGroup)((WfClientGroupResourceDescriptor)client).Group.ToOguObject();
 }
        public override object Deserialize(IDictionary <string, object> dictionary, Type type, JavaScriptSerializer serializer)
        {
            WfGroupResourceDescriptor groupResourceDesp = (WfGroupResourceDescriptor)base.Deserialize(dictionary, type, serializer);
            IGroup group = JSONSerializerExecute.Deserialize <OguGroup>(dictionary["Group"]);

            groupResourceDesp.Group = group;

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

            IDictionary <string, object> dictionary = base.Serialize(obj, serializer);

            dictionary.Add("Group", groupResourceDesp.Group);

            return(dictionary);
        }
		public void WfGroupResourceDescriptorConverterTest()
		{
			WfConverterHelper.RegisterConverters();

			IUser user = (IUser)OguObjectSettings.GetConfig().Objects["requestor"].Object;

			OguObjectCollection<IGroup> groupColl = user.MemberOf;

			foreach (var group in groupColl)
			{
				WfGroupResourceDescriptor groupDesp = new WfGroupResourceDescriptor(group);

				string result = JSONSerializerExecute.Serialize(groupDesp);

				Console.WriteLine(result);

				WfGroupResourceDescriptor deserializedGroupDesp = JSONSerializerExecute.Deserialize<WfGroupResourceDescriptor>(result);

				string reSerialized = JSONSerializerExecute.Serialize(deserializedGroupDesp);

				Assert.AreEqual(result, reSerialized);

				ResourceConverterTest(groupDesp);
			}

		}