コード例 #1
0
ファイル: PBXDeviceObject.cs プロジェクト: chenmj201601/UMP
        public override void SetBasicPropertyValues()
        {
            //PBXDevice的Key值由CTIType,DeviceType,MonitorMode和DeviceName共同决定
            string strKey = string.Format("{0}-{1}-{2}-{3}", CTIType, DeviceType, MonitorMode, DeviceName);

            base.SetBasicPropertyValues();

            ResourceProperty propertyValue;

            for (int i = 0; i < ListProperties.Count; i++)
            {
                propertyValue = ListProperties[i];
                switch (propertyValue.PropertyID)
                {
                case S1110Consts.PROPERTYID_XMLKEY:
                    propertyValue.Value = strKey;
                    break;

                case PRO_CTITYPE:
                    propertyValue.Value = CTIType.ToString();
                    break;

                case PRO_DEVICETYPE:
                    propertyValue.Value = DeviceType.ToString();
                    break;

                case PRO_MONITORMODE:
                    propertyValue.Value = MonitorMode.ToString();
                    break;

                case PRO_DEVICENAME:
                    propertyValue.Value = DeviceName;
                    break;
                }
            }
        }
コード例 #2
0
        ///----------------------------------------------------------------------------------------------
        ///---------------------------------------UNITY EDITOR-------------------------------------------
#if UNITY_EDITOR
        protected override void OnNodeGUI()
        {
            GUILayout.Label(string.Format("<b>[On {0}]</b>", monitorMode.ToString()));
        }
コード例 #3
0
ファイル: PBXDeviceObject.cs プロジェクト: chenmj201601/UMP
        public override void GetBasicPropertyValues()
        {
            base.GetBasicPropertyValues();

            ResourceProperty propertyValue;
            int intValue;

            for (int i = 0; i < ListProperties.Count; i++)
            {
                propertyValue = ListProperties[i];
                switch (propertyValue.PropertyID)
                {
                case PRO_CTITYPE:
                    if (int.TryParse(propertyValue.Value, out intValue))
                    {
                        CTIType = intValue;

                        StrCTIType = CTIType.ToString();
                        if (ListAllBasicInfos != null)
                        {
                            var info =
                                ListAllBasicInfos.FirstOrDefault(
                                    b => b.InfoID == S1110Consts.SOURCEID_CTITYPE && b.Value == CTIType.ToString());
                            if (info != null)
                            {
                                StrCTIType =
                                    CurrentApp.GetLanguageInfo(
                                        string.Format("BID{0}{1}", S1110Consts.SOURCEID_CTITYPE, info.SortID.ToString("000")), info.Icon);
                            }
                        }
                    }
                    break;

                case PRO_DEVICETYPE:
                    if (int.TryParse(propertyValue.Value, out intValue))
                    {
                        DeviceType = intValue;

                        StrDeviceType = DeviceType.ToString();
                        if (ListAllBasicInfos != null)
                        {
                            var info =
                                ListAllBasicInfos.FirstOrDefault(
                                    b => b.InfoID == S1110Consts.SOURCEID_PBX_DEVICETYPE && b.Value == DeviceType.ToString());
                            if (info != null)
                            {
                                StrDeviceType =
                                    CurrentApp.GetLanguageInfo(
                                        string.Format("BID{0}{1}", S1110Consts.SOURCEID_PBX_DEVICETYPE, info.SortID.ToString("000")), info.Icon);
                            }
                        }
                    }
                    break;

                case PRO_MONITORMODE:
                    if (int.TryParse(propertyValue.Value, out intValue))
                    {
                        MonitorMode = intValue;

                        StrMonitorMode = MonitorMode.ToString();
                        if (ListAllBasicInfos != null)
                        {
                            var info =
                                ListAllBasicInfos.FirstOrDefault(
                                    b => b.InfoID == S1110Consts.SOURCEID_PBX_MONITORMODE && b.Value == MonitorMode.ToString());
                            if (info != null)
                            {
                                StrMonitorMode =
                                    CurrentApp.GetLanguageInfo(
                                        string.Format("BID{0}{1}", S1110Consts.SOURCEID_PBX_MONITORMODE, info.SortID.ToString("000")), info.Icon);
                            }
                        }
                    }
                    break;

                case PRO_DEVICENAME:
                    DeviceName = propertyValue.Value;
                    break;
                }
            }

            GetNameAndDescription();
        }