Пример #1
0
 public override void RegisterCallback(string strPropertyName, AFIProperty.PropertyEventHandler handler)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         AFIProperty xProperty = (AFCProperty)mhtProperty[strPropertyName];
         xProperty.RegisterCallback(handler);
     }
 }
Пример #2
0
        public override AFIDENTID QueryObject(string strName)
        {
            AFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryObject());
            }

            return(new AFIDENTID());
        }
Пример #3
0
        public override double QueryPropertyDouble(string strPropertyName)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryDouble());
            }

            return(0.0);
        }
Пример #4
0
        public override Int64 QueryPropertyInt(string strPropertyName)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryInt());
            }

            return(0);
        }
Пример #5
0
        public override float QueryPropertyFloat(string strPropertyName)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryFloat());
            }

            return(0.0f);
        }
Пример #6
0
        public override AFIDENTID QueryPropertyObject(string strPropertyName)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryObject());
            }

            return(new AFIDENTID());
        }
Пример #7
0
        public override string QueryString(string strName)
        {
            AFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryString());
            }

            return("");
        }
Пример #8
0
        public override string QueryPropertyString(string strPropertyName)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null != property)
            {
                return(property.QueryString());
            }

            return("");
        }
Пример #9
0
        public override double QueryDouble(string strName)
        {
            AFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryDouble());
            }

            return(0f);
        }
Пример #10
0
        public override float QueryFloat(string strName)
        {
            AFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryFloat());
            }

            return(0f);
        }
Пример #11
0
        public override Int64 QueryInt(string strName)
        {
            AFIProperty xProperty = GetPropertyManager().GetProperty(strName);

            if (null != xProperty)
            {
                return(xProperty.QueryInt());
            }

            return(0);
        }
Пример #12
0
        public override AFIProperty AddProperty(string strPropertyName, AFIDataList varData)
        {
            AFIProperty xProperty = null;

            if (!mhtProperty.ContainsKey(strPropertyName))
            {
                xProperty = new AFCProperty(mSelf, strPropertyName, varData);
                mhtProperty[strPropertyName] = xProperty;
            }

            return(xProperty);
        }
Пример #13
0
 public override bool SetProperty(string strPropertyName, AFIDataList varData)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         AFIProperty xProperty = (AFCProperty)mhtProperty[strPropertyName];
         if (null != xProperty)
         {
             xProperty.SetValue(varData);
         }
     }
     return(true);
 }
Пример #14
0
        public override AFIProperty GetProperty(string strPropertyName)
        {
            AFIProperty xProperty = null;

            if (mhtProperty.ContainsKey(strPropertyName))
            {
                xProperty = (AFCProperty)mhtProperty[strPropertyName];
                return(xProperty);
            }

            return(xProperty);
        }
Пример #15
0
        public override bool SetPropertyInt(string strPropertyName, Int64 nValue)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                AFIDataList valueList = new AFCDataList();
                valueList.AddInt64(0);
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetInt(nValue);
            return(true);
        }
Пример #16
0
        public override bool SetPropertyObject(string strPropertyName, AFIDENTID obj)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                AFIDataList valueList = new AFCDataList();
                valueList.AddObject(new AFIDENTID());
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetObject(obj);
            return(true);
        }
Пример #17
0
        public override bool SetPropertyString(string strPropertyName, string strValue)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                AFIDataList valueList = new AFCDataList();
                valueList.AddString("");
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetString(strValue);
            return(true);
        }
Пример #18
0
        public override bool SetPropertyDouble(string strPropertyName, double dwValue)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                AFIDataList valueList = new AFCDataList();
                valueList.AddDouble(0);
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetDouble(dwValue);
            return(true);
        }
Пример #19
0
        public override bool SetPropertyFloat(string strPropertyName, float fValue)
        {
            AFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                AFIDataList valueList = new AFCDataList();
                valueList.AddFloat(0.0f);
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetFloat(fValue);
            return(true);
        }
Пример #20
0
        void AddBasePropertyFormOther(string strName, string strOther)
        {
            AFILogicClass xOtherClass = GetElement(strOther);
            AFILogicClass xLogicClass = GetElement(strName);

            if (null != xLogicClass && null != xOtherClass)
            {
                AFIDataList xValue = xOtherClass.GetPropertyManager().GetPropertyList();
                for (int i = 0; i < xValue.Count(); ++i)
                {
                    AFIProperty xProperty = xOtherClass.GetPropertyManager().GetProperty(xValue.StringVal(i));
                    xLogicClass.GetPropertyManager().AddProperty(xValue.StringVal(i), xProperty.GetValue());
                }
            }
        }
Пример #21
0
        void InitProperty(AFIDENTID self, string strClassName)
        {
            AFILogicClass xLogicClass = AFCLogicClassManager.Instance.GetElement(strClassName);

            if (null == xLogicClass)
            {
                return;
            }

            AFIDataList xDataList = xLogicClass.GetPropertyManager().GetPropertyList();

            for (int i = 0; i < xDataList.Count(); ++i)
            {
                string      strPropertyName = xDataList.StringVal(i);
                AFIProperty xProperty       = xLogicClass.GetPropertyManager().GetProperty(strPropertyName);

                AFIObject          xObject          = GetObject(self);
                AFIPropertyManager xPropertyManager = xObject.GetPropertyManager();

                xPropertyManager.AddProperty(strPropertyName, xProperty.GetValue());
            }
        }
Пример #22
0
        private void LoadInstanceElement(AFILogicClass xLogicClass)
        {
            string strLogicPath = mstrRootPath;

            strLogicPath += xLogicClass.GetInstance();

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(strLogicPath);
            /////////////////////////////////////////////////////////////////

            XmlNode xRoot = xmldoc.SelectSingleNode("XML");

            XmlNodeList xNodeList = xRoot.SelectNodes("Entry");

            for (int i = 0; i < xNodeList.Count; ++i)
            {
                //AFCLog.Instance.Log("Class:" + xLogicClass.GetName());

                XmlNode      xNodeClass = xNodeList.Item(i);
                XmlAttribute strID      = xNodeClass.Attributes["Id"];

                //AFCLog.Instance.Log("ClassID:" + strID.Value);

                AFIElement xElement = GetElement(strID.Value);
                if (null == xElement)
                {
                    xElement = new AFCElement();
                    AddElement(strID.Value, xElement);
                    xLogicClass.AddConfigName(strID.Value);

                    XmlAttributeCollection xCollection = xNodeClass.Attributes;
                    for (int j = 0; j < xCollection.Count; ++j)
                    {
                        XmlAttribute xAttribute = xCollection[j];
                        AFIProperty  xProperty  = xLogicClass.GetPropertyManager().GetProperty(xAttribute.Name);
                        if (null != xProperty)
                        {
                            AFIDataList.VARIANT_TYPE eType = xProperty.GetDataType();
                            switch (eType)
                            {
                            case AFIDataList.VARIANT_TYPE.VTYPE_INT:
                            {
                                AFIDataList xValue = new AFCDataList();
                                xValue.AddInt64(int.Parse(xAttribute.Value));
                                xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                            }
                            break;

                            case AFIDataList.VARIANT_TYPE.VTYPE_FLOAT:
                            {
                                AFIDataList xValue = new AFCDataList();
                                xValue.AddFloat(float.Parse(xAttribute.Value));
                                xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                            }
                            break;

                            case AFIDataList.VARIANT_TYPE.VTYPE_DOUBLE:
                            {
                                AFIDataList xValue = new AFCDataList();
                                xValue.AddDouble(double.Parse(xAttribute.Value));
                                xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                            }
                            break;

                            case AFIDataList.VARIANT_TYPE.VTYPE_STRING:
                            {
                                AFIDataList xValue = new AFCDataList();
                                xValue.AddString(xAttribute.Value);
                                AFIProperty xTestProperty = xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                            }
                            break;

                            case AFIDataList.VARIANT_TYPE.VTYPE_OBJECT:
                            {
                                AFIDataList xValue = new AFCDataList();
                                xValue.AddObject(new AFIDENTID(0, int.Parse(xAttribute.Value)));
                                xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                            }
                            break;

                            default:
                                break;
                            }
                        }
                    }
                }
            }
        }