Example #1
0
        private void EGMI_ACK_OBJECT_PROPERTY_ENTRY(MsgHead head, MemoryStream stream)
        {
            AFMsg.MultiEntityDataNodeList xMultiObjectPropertyList = MultiEntityDataNodeList.Parser.ParseFrom(stream);
            // ReceiveMsg(stream, ref xMultiObjectPropertyList);

            for (int i = 0; i < xMultiObjectPropertyList.MultiEntityDataNodeList_.Count; i++)
            {
                AFMsg.EntityDataNodeList xPropertyData = xMultiObjectPropertyList.MultiEntityDataNodeList_[i];
                AFIObject          go = AFCKernel.Instance.GetObject(PBToAF(xPropertyData.EntityId));
                AFIPropertyManager xPropertyManager = go.GetPropertyManager();

                for (int j = 0; j < xPropertyData.DataNodeList.Count; j++)
                {
                    string strPropertyName = xPropertyData.DataNodeList[j].NodeName;

                    AFCoreEx.AFIDataList.Var_Data xPropertyValue = PBPropertyToData(xPropertyData.DataNodeList[j]);
                    AFIProperty xProperty = xPropertyManager.GetProperty(strPropertyName);
                    if (null == xProperty)
                    {
                        AFIDataList varList = new AFCDataList();
                        varList.AddDataObject(ref xPropertyValue);

                        xProperty = xPropertyManager.AddProperty(strPropertyName, varList);
                    }

                    xProperty.SetDataObject(ref xPropertyValue);
                }
            }
        }
Example #2
0
        /////////////////////////////////////////////////////////////////////
        private void EGMI_ACK_PROPERTY_DATA(MsgHead head, MemoryStream stream)
        {
            AFMsg.EntityDataNode propertyData = ReceiveMsg(stream, EntityDataNode.Parser) as EntityDataNode;


            AFIObject          go = AFCKernel.Instance.GetObject(PBToAF(propertyData.EntityId));
            AFIPropertyManager propertyManager = go.GetPropertyManager();

            for (int i = 0; i < propertyData.DataNodeList.Count; i++)
            {
                AFCoreEx.AFIDataList.Var_Data xData = PBPropertyToData(propertyData.DataNodeList[i]);
                AFIProperty property = propertyManager.GetProperty(propertyData.DataNodeList[i].NodeName);
                if (null == property)
                {
                    AFIDataList varList = new AFCDataList();
                    varList.AddDataObject(ref xData);

                    property = propertyManager.AddProperty(propertyData.DataNodeList[i].NodeName, varList);
                }

                property.SetDataObject(ref xData);
            }
        }