public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
        {
            client.NullCheck("client");

            if (server == null)
                server = new WfActivityMatrixResourceDescriptor();

            WfActivityMatrixResourceDescriptor amr = (WfActivityMatrixResourceDescriptor)server;
            WfClientActivityMatrixResourceDescriptor cmr = (WfClientActivityMatrixResourceDescriptor)client;

            amr.ExternalMatrixID = cmr.ExternalMatrixID;

            foreach (WfClientRolePropertyDefinition cpd in cmr.PropertyDefinitions)
            {
                SOARolePropertyDefinition spd = null;

                WfClientRolePropertyDefinitionConverter.Instance.ClientToServer(cpd, ref spd);

                amr.PropertyDefinitions.Add(spd);
            }

            foreach (WfClientRolePropertyRow cRow in cmr.Rows)
            {
                SOARolePropertyRow sRow = null;

                WfClientRolePropertyRowConverter.Instance.ClientToServer(cRow, amr.PropertyDefinitions, ref sRow);

                amr.Rows.Add(sRow);
            }
        }
Ejemplo n.º 2
0
        public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
        {
            client.NullCheck("client");

            if (server == null)
            {
                server = new WfActivityMatrixResourceDescriptor();
            }

            WfActivityMatrixResourceDescriptor       amr = (WfActivityMatrixResourceDescriptor)server;
            WfClientActivityMatrixResourceDescriptor cmr = (WfClientActivityMatrixResourceDescriptor)client;

            amr.ExternalMatrixID = cmr.ExternalMatrixID;

            foreach (WfClientRolePropertyDefinition cpd in cmr.PropertyDefinitions)
            {
                SOARolePropertyDefinition spd = null;

                WfClientRolePropertyDefinitionConverter.Instance.ClientToServer(cpd, ref spd);

                amr.PropertyDefinitions.Add(spd);
            }

            foreach (WfClientRolePropertyRow cRow in cmr.Rows)
            {
                SOARolePropertyRow sRow = null;

                WfClientRolePropertyRowConverter.Instance.ClientToServer(cRow, amr.PropertyDefinitions, ref sRow);

                amr.Rows.Add(sRow);
            }
        }
 public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
 {
     if (client == null)
         client = new WfClientGroupResourceDescriptor((WfClientGroup)((WfGroupResourceDescriptor)server).Group.ToClientOguObject());
     else
         ((WfClientGroupResourceDescriptor)client).Group = (WfClientGroup)((WfGroupResourceDescriptor)server).Group.ToClientOguObject();
 }
 public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
 {
     if (client == null)
         client = new WfClientDepartmentResourceDescriptor((WfClientOrganization)((WfDepartmentResourceDescriptor)server).Department.ToClientOguObject());
     else
         ((WfClientDepartmentResourceDescriptor)client).Department = (WfClientOrganization)((WfDepartmentResourceDescriptor)server).Department.ToClientOguObject();
 }
 public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
 {
     if (server == null)
         server = new WfDepartmentResourceDescriptor((IOrganization)((WfClientDepartmentResourceDescriptor)client).Department.ToOguObject());
     else
         ((WfDepartmentResourceDescriptor)server).Department = (IOrganization)((WfClientDepartmentResourceDescriptor)client).Department.ToOguObject();
 }
 public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
 {
     if (client == null)
         client = new WfClientUserResourceDescriptor((WfClientUser)((WfUserResourceDescriptor)server).User.ToClientOguObject());
     else
         ((WfClientUserResourceDescriptor)client).User = (WfClientUser)((WfUserResourceDescriptor)server).User.ToClientOguObject();
 }
 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 void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
 {
     if (server == null)
         server = new WfUserResourceDescriptor((IUser)((WfClientUserResourceDescriptor)client).User.ToOguObject());
     else
         ((WfUserResourceDescriptor)server).User = (IUser)((WfClientUserResourceDescriptor)client).User.ToOguObject();
 }
Ejemplo n.º 9
0
        public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
        {
            server.NullCheck("server");

            if (client == null)
            {
                client = new WfClientActivityMatrixResourceDescriptor();
            }

            WfClientActivityMatrixResourceDescriptor cmr = (WfClientActivityMatrixResourceDescriptor)client;
            WfActivityMatrixResourceDescriptor       amr = (WfActivityMatrixResourceDescriptor)server;

            cmr.ExternalMatrixID = amr.ExternalMatrixID;

            foreach (SOARolePropertyDefinition spd in amr.PropertyDefinitions)
            {
                WfClientRolePropertyDefinition cpd = null;

                WfClientRolePropertyDefinitionConverter.Instance.ServerToClient(spd, ref cpd);

                cmr.PropertyDefinitions.Add(cpd);
            }

            foreach (SOARolePropertyRow sRow in amr.Rows)
            {
                WfClientRolePropertyRow cRow = null;

                WfClientRolePropertyRowConverter.Instance.ServerToClient(sRow, cmr.PropertyDefinitions, ref cRow);

                cmr.Rows.Add(cRow);
            }
        }
        public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
        {
            server.NullCheck("server");

            if (client == null)
                client = new WfClientActivityMatrixResourceDescriptor();

            WfClientActivityMatrixResourceDescriptor cmr = (WfClientActivityMatrixResourceDescriptor)client;
            WfActivityMatrixResourceDescriptor amr = (WfActivityMatrixResourceDescriptor)server;

            cmr.ExternalMatrixID = amr.ExternalMatrixID;

            foreach (SOARolePropertyDefinition spd in amr.PropertyDefinitions)
            {
                WfClientRolePropertyDefinition cpd = null;

                WfClientRolePropertyDefinitionConverter.Instance.ServerToClient(spd, ref cpd);

                cmr.PropertyDefinitions.Add(cpd);
            }

            foreach (SOARolePropertyRow sRow in amr.Rows)
            {
                WfClientRolePropertyRow cRow = null;

                WfClientRolePropertyRowConverter.Instance.ServerToClient(sRow, cmr.PropertyDefinitions, ref cRow);

                cmr.Rows.Add(cRow);
            }
        }
Ejemplo n.º 11
0
        private static void ResourceConverterTest(WfResourceDescriptor resDesp)
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptor();

            processDesp.Activities[1].Resources.Add(resDesp);
            string re = JSONSerializerExecute.Serialize(processDesp);
            WfProcessDescriptor reProcessDesp = JSONSerializerExecute.Deserialize <WfProcessDescriptor>(re);
        }
Ejemplo n.º 12
0
        public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
        {
            if (client == null)
            {
                client = new TClient();
            }

            ((TClient)client).ActivityKey = ((TServer)server).ActivityKey;
        }
        public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
        {
            //client.NullCheck("client");

            //WfClientAURoleResourceDescriptor clientAURes = (WfClientAURoleResourceDescriptor)client;

            ////这里覆盖传入的对象
            //server = new WfAURoleResourceDescriptor(clientAURes.FullCodeName);
        }
Ejemplo n.º 14
0
        public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
        {
            if (server == null)
            {
                server = new TServer();
            }

            ((TServer)server).ActivityKey = ((TClient)client).ActivityKey;
        }
Ejemplo n.º 15
0
        public void SimpleClientActivityMatrixResourceDescriptorToServer()
        {
            WfClientActivityMatrixResourceDescriptor client = ProcessDescriptorHelper.GetClientActivityMatrixResourceDescriptor();

            WfResourceDescriptor server = null;

            WfClientActivityMatrixResourceDescriptorConverter.Instance.ClientToServer(client, ref server);

            client.AreSame((WfActivityMatrixResourceDescriptor)server);
        }
        public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
        {
            //server.NullCheck("server");

            //WfAURoleResourceDescriptor serverAURes = (WfAURoleResourceDescriptor)server;

            //if (serverAURes.AUSchemaRole != null)
            //    client = new WfClientAURoleResourceDescriptor(serverAURes.AUSchemaRole.)
            //client = new WfClientAURoleResourceDescriptor(serverAURes.RoleFullCodeName);
        }
 public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
 {
     if (client == null)
     {
         client = new WfClientDepartmentResourceDescriptor((WfClientOrganization)((WfDepartmentResourceDescriptor)server).Department.ToClientOguObject());
     }
     else
     {
         ((WfClientDepartmentResourceDescriptor)client).Department = (WfClientOrganization)((WfDepartmentResourceDescriptor)server).Department.ToClientOguObject();
     }
 }
Ejemplo n.º 18
0
 public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
 {
     if (client == null)
     {
         client = new WfClientUserResourceDescriptor((WfClientUser)((WfUserResourceDescriptor)server).User.ToClientOguObject());
     }
     else
     {
         ((WfClientUserResourceDescriptor)client).User = (WfClientUser)((WfUserResourceDescriptor)server).User.ToClientOguObject();
     }
 }
Ejemplo n.º 19
0
 public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
 {
     if (server == null)
     {
         server = new WfUserResourceDescriptor((IUser)((WfClientUserResourceDescriptor)client).User.ToOguObject());
     }
     else
     {
         ((WfUserResourceDescriptor)server).User = (IUser)((WfClientUserResourceDescriptor)client).User.ToOguObject();
     }
 }
 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 void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
 {
     if (server == null)
     {
         server = new WfDepartmentResourceDescriptor((IOrganization)((WfClientDepartmentResourceDescriptor)client).Department.ToOguObject());
     }
     else
     {
         ((WfDepartmentResourceDescriptor)server).Department = (IOrganization)((WfClientDepartmentResourceDescriptor)client).Department.ToOguObject();
     }
 }
        public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
        {
            SOARole role = new SOARole(((WfClientRoleResourceDescriptor)client).FullCodeName);

            if (server == null)
            {
                server = new WfRoleResourceDescriptor(role);
            }
            else
            {
                ((WfRoleResourceDescriptor)server).Role = role;
            }
        }
        public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
        {
            WfRoleResourceDescriptor roleDesp = (WfRoleResourceDescriptor)server;

            if (roleDesp.Role != null)
            {
                if (client == null)
                {
                    client = new WfClientRoleResourceDescriptor(roleDesp.Role.FullCodeName);
                }
                else
                {
                    ((WfClientRoleResourceDescriptor)client).FullCodeName = roleDesp.Role.FullCodeName;
                }
            }
        }
        public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
        {
            server.NullCheck("server");

            WfDynamicResourceDescriptor serverDynRes = (WfDynamicResourceDescriptor)server;

            if (client == null)
                client = new WfClientDynamicResourceDescriptor(serverDynRes.Name, serverDynRes.Condition.Expression);
            else
            {
                WfClientDynamicResourceDescriptor clientDynRes = (WfClientDynamicResourceDescriptor)client;

                clientDynRes.Name = serverDynRes.Name;
                clientDynRes.Condition.Expression = serverDynRes.Condition.Expression;
            }
        }
        public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
        {
            client.NullCheck("client");

            WfClientDynamicResourceDescriptor clientDynRes = (WfClientDynamicResourceDescriptor)client;

            if (server == null)
                server = new WfDynamicResourceDescriptor(clientDynRes.Name, clientDynRes.Condition.Expression);
            else
            {
                WfDynamicResourceDescriptor serverDynRes = (WfDynamicResourceDescriptor)server;

                serverDynRes.Name = clientDynRes.Name;
                serverDynRes.Condition.Expression = clientDynRes.Condition.Expression;
            }
        }
        public override void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server)
        {
            client.NullCheck("client");

            WfClientDynamicResourceDescriptor clientDynRes = (WfClientDynamicResourceDescriptor)client;

            if (server == null)
            {
                server = new WfDynamicResourceDescriptor(clientDynRes.Name, clientDynRes.Condition.Expression);
            }
            else
            {
                WfDynamicResourceDescriptor serverDynRes = (WfDynamicResourceDescriptor)server;

                serverDynRes.Name = clientDynRes.Name;
                serverDynRes.Condition.Expression = clientDynRes.Condition.Expression;
            }
        }
        public override void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client)
        {
            server.NullCheck("server");

            WfDynamicResourceDescriptor serverDynRes = (WfDynamicResourceDescriptor)server;

            if (client == null)
            {
                client = new WfClientDynamicResourceDescriptor(serverDynRes.Name, serverDynRes.Condition.Expression);
            }
            else
            {
                WfClientDynamicResourceDescriptor clientDynRes = (WfClientDynamicResourceDescriptor)client;

                clientDynRes.Name = serverDynRes.Name;
                clientDynRes.Condition.Expression = serverDynRes.Condition.Expression;
            }
        }
Ejemplo n.º 28
0
        public void ClientToServer(WfClientResourceDescriptorCollection client, WfResourceDescriptorCollection server)
        {
            client.NullCheck("client");
            server.NullCheck("server");

            server.Clear();

            foreach (WfClientResourceDescriptor clientRes in client)
            {
                WfClientResourceDescriptorConverterBase converter = WfClientResourceDescriptorConverterFactory.Instance.GetConverterByClientType(clientRes.GetType());

                if (converter != null)
                {
                    WfResourceDescriptor serverRes = null;

                    converter.ClientToServer(clientRes, ref serverRes);

                    if (serverRes != null)
                    {
                        server.Add(serverRes);
                    }
                }
            }
        }
		private static void ResourceConverterTest(WfResourceDescriptor resDesp)
		{
			IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptor();
			processDesp.Activities[1].Resources.Add(resDesp);
			string re = JSONSerializerExecute.Serialize(processDesp);
			WfProcessDescriptor reProcessDesp = JSONSerializerExecute.Deserialize<WfProcessDescriptor>(re);
		}
 public abstract void ClientToServer(WfClientResourceDescriptor client, ref WfResourceDescriptor server);
 public abstract void ServerToClient(WfResourceDescriptor server, ref WfClientResourceDescriptor client);