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);
            }
        }
        private static WfClientActivityDescriptor CreateDynamicActivityDescriptor(WfClientActivityMatrixResourceDescriptor activityMatrix)
        {
            WfClientActivityDescriptor dynamicActivityDesp = new WfClientActivityDescriptor(WfClientActivityType.NormalActivity) { Key = "N1", Name = "审批" };

            dynamicActivityDesp.Properties.AddOrSetValue("IsDynamic", "True");

            dynamicActivityDesp.Resources.Add(activityMatrix);

            return dynamicActivityDesp;
        }
        public static WfClientActivityMatrixResourceDescriptor GetClientActivityMatrixResourceDescriptor()
        {
            WfClientActivityMatrixResourceDescriptor resource = new WfClientActivityMatrixResourceDescriptor();

            resource.PropertyDefinitions.CopyFrom(PrepareClientPropertiesDefinition());
            resource.Rows.CopyFrom(PrepareClientRows(resource.PropertyDefinitions));

            return resource;
        }
        public static void AreSame(this WfClientActivityMatrixResourceDescriptor expected, WfClientActivityMatrixResourceDescriptor actual)
        {
            AssertStringEqual(expected.ExternalMatrixID, actual.ExternalMatrixID);

            AreSame(expected.PropertyDefinitions, actual.PropertyDefinitions);
            AreSame(expected.Rows, actual.Rows);
        }