コード例 #1
0
 public static StageConnectSettings getInstance()
 {
     if (instanse == null)
     {
         instanse = new StageConnectSettings();
     }
     return(instanse);
 }
コード例 #2
0
 protected override void constructPrerequres()
 {
     if (!StageConnectSettings.getInstance().isValid)
     {
         isManualRequere = true;
         return;
     }
 }
コード例 #3
0
        public string getValue(int nodeId, ConnectNodesParamsEnum enumValue)
        {
            var ret  = "";
            var node = nodeList.Item(nodeId);

            switch (enumValue)
            {
            case ConnectNodesParamsEnum.Id:
            {
                ret = node.SelectSingleNode("@ID").Value;
                break;
            }

            case ConnectNodesParamsEnum.Direction:
            {
                ret = node.SelectSingleNode("@Direction").Value;
                break;
            }

            default:
            {
                var regionSettings = StageConnectSettings.getInstance().FindId(node.SelectSingleNode("@ID").Value);
                if (regionSettings == null)
                {
                    throw new Exception("Указанного сервера не существует");
                }
                switch (enumValue)
                {
                case ConnectNodesParamsEnum.Name:
                {
                    ret = regionSettings.RegionName;
                    break;
                }

                case ConnectNodesParamsEnum.Server:
                {
                    ret = regionSettings.ServerName;
                    break;
                }

                case ConnectNodesParamsEnum.DBName:
                {
                    ret = regionSettings.StageDBName;
                    break;
                }

                default:
                {
                    break;
                }
                }
                break;
            }
            }

            return(ret);
        }