Esempio n. 1
0
 public override void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName];
         xProperty.RegisterCallback(handler);
     }
 }
Esempio n. 2
0
 public override void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName];
         xProperty.RegisterCallback(handler);
     }
 }
Esempio n. 3
0
        public override Int64 QueryPropertyInt(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            return(0);
        }
Esempio n. 4
0
        public override float QueryPropertyFloat(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            return(0.0f);
        }
Esempio n. 5
0
        public override double QueryPropertyDouble(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            return(0.0);
        }
Esempio n. 6
0
        public override NFIDENTID QueryObject(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

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

            return(new NFIDENTID());
        }
Esempio n. 7
0
        public override double QueryDouble(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

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

            return(0f);
        }
Esempio n. 8
0
        public override string QueryString(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

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

            return("");
        }
Esempio n. 9
0
        public override float QueryFloat(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

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

            return(0f);
        }
Esempio n. 10
0
        public override Int64 QueryInt(string strName)
        {
            NFIProperty xProperty = GetPropertyManager().GetProperty(strName);

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

            return(0);
        }
Esempio n. 11
0
        public override string QueryPropertyString(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            return("");
        }
Esempio n. 12
0
        public override NFIDENTID QueryPropertyObject(string strPropertyName)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            return(new NFIDENTID());
        }
Esempio n. 13
0
        public override NFIProperty AddProperty(string strPropertyName, NFIDataList varData)
        {
            NFIProperty xProperty = null;

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

            return(xProperty);
        }
Esempio n. 14
0
        public override NFIProperty GetProperty(string strPropertyName)
        {
            NFIProperty xProperty = null;

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

            return(xProperty);
        }
Esempio n. 15
0
 public override bool SetProperty(string strPropertyName, NFIDataList varData)
 {
     if (mhtProperty.ContainsKey(strPropertyName))
     {
         NFIProperty xProperty = (NFCProperty)mhtProperty[strPropertyName];
         if (null != xProperty)
         {
             xProperty.SetValue(varData);
         }
     }
     return(true);
 }
Esempio n. 16
0
        public override bool SetPropertyString(string strPropertyName, string strValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            property.SetString(strValue);
            return(true);
        }
Esempio n. 17
0
        public override bool SetPropertyObject(string strPropertyName, NFIDENTID obj)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddObject(new NFIDENTID());
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetObject(obj);
            return(true);
        }
Esempio n. 18
0
        public override bool SetPropertyDouble(string strPropertyName, double dwValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            property.SetDouble(dwValue);
            return(true);
        }
Esempio n. 19
0
        public override bool SetPropertyFloat(string strPropertyName, float fValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

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

            property.SetFloat(fValue);
            return(true);
        }
Esempio n. 20
0
        public override bool SetPropertyInt(string strPropertyName, Int64 nValue)
        {
            NFIProperty property = mPropertyManager.GetProperty(strPropertyName);

            if (null == property)
            {
                NFIDataList valueList = new NFCDataList();
                valueList.AddInt(0);
                property = mPropertyManager.AddProperty(strPropertyName, valueList);
            }

            property.SetInt(nValue);
            return(true);
        }
Esempio n. 21
0
        void AddBasePropertyFormOther(string strName, string strOther)
        {
            NFILogicClass xOtherClass = GetElement(strOther);
            NFILogicClass xLogicClass = GetElement(strName);

            if (null != xLogicClass && null != xOtherClass)
            {
                NFIDataList xValue = xOtherClass.GetPropertyManager().GetPropertyList();
                for (int i = 0; i < xValue.Count(); ++i)
                {
                    NFIProperty xProperty = xOtherClass.GetPropertyManager().GetProperty(xValue.StringVal(i));
                    xLogicClass.GetPropertyManager().AddProperty(xValue.StringVal(i), xProperty.GetValue());
                }
            }
        }
Esempio n. 22
0
        void InitProperty(NFIDENTID self, string strClassName)
        {
            NFILogicClass xLogicClass = NFCLogicClassManager.Instance.GetElement(strClassName);
            NFIDataList   xDataList   = xLogicClass.GetPropertyManager().GetPropertyList();

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

                NFIObject          xObject          = GetObject(self);
                NFIPropertyManager xPropertyManager = xObject.GetPropertyManager();

                xPropertyManager.AddProperty(strPropertyName, xProperty.GetValue());
            }
        }
Esempio n. 23
0
        private void LoadInstanceElement(NFILogicClass xLogicClass)
        {
            string strLogicPath = mstrRootPath;

            strLogicPath += xLogicClass.GetInstance();

            XmlDocument xmldoc = new XmlDocument();

            xmldoc.Load(strLogicPath);

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

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

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

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

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

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

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

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

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

                            case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
                            {
                                NFIDataList xValue = new NFCDataList();
                                xValue.AddString(xAttribute.Value);
                                NFIProperty xTestProperty = xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                            }
                            break;

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

                            default:
                                break;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 24
0
 public override void RegisterPropertyCallback(NFIDENTID self, string strPropertyName, NFIProperty.PropertyEventHandler handler)
 {
     NFIObject xGameObject = GetObject(self);
     if (null != xGameObject)
     {
         xGameObject.GetPropertyManager().RegisterCallback(strPropertyName, handler);
     }
 }
Esempio n. 25
0
        private void LoadInstanceElement(NFILogicClass xLogicClass)
        {
            string strLogicPath = mstrRootPath;

            strLogicPath += xLogicClass.GetInstance();

            XmlDocument xmldoc = new XmlDocument();

            ///////////////////////////////////////////////////////////////////////////////////////
            if (NFCLogicClassManager.Instance.GetCepher())
            {
                StreamReader cepherReader = new StreamReader(strLogicPath);;
                string       strContent   = cepherReader.ReadToEnd();
                cepherReader.Close();

                byte[] data = Convert.FromBase64String(strContent);

                MemoryStream stream = new MemoryStream(data);
                XmlReader    x      = XmlReader.Create(stream);
                x.MoveToContent();
                string res = x.ReadOuterXml();

                xmldoc.LoadXml(res);
            }
            else
            {
                xmldoc.Load(strLogicPath);
            }
            /////////////////////////////////////////////////////////////////

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

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

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

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

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

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

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

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

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

                            case NFIDataList.VARIANT_TYPE.VTYPE_STRING:
                            {
                                NFIDataList xValue = new NFCDataList();
                                xValue.AddString(xAttribute.Value);
                                NFIProperty xTestProperty = xElement.GetPropertyManager().AddProperty(xAttribute.Name, xValue);
                            }
                            break;

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

                            default:
                                break;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 26
0
 public abstract void RegisterCallback(string strPropertyName, NFIProperty.PropertyEventHandler handler);
Esempio n. 27
0
 /////////////////////////////////////////////////////////////
 public abstract void RegisterPropertyCallback(NFIDENTID self, string strPropertyName, NFIProperty.PropertyEventHandler handler);