Esempio n. 1
0
    public bool ParseNodeAppAttr(string attr, TdirNodeAttrType attrType, ref object param)
    {
        if (!string.IsNullOrEmpty(attr))
        {
            attr = attr.ToLower();
            char[]   separator = new char[] { ';' };
            string[] strArray  = attr.Split(separator);
            if (strArray == null)
            {
                return(false);
            }
            string str = attrType.ToString().ToLower();
            for (int i = 0; i < strArray.Length; i++)
            {
                char[] chArray4;
                Dictionary <string, int> dictionary;
                string[]  strArray3;
                int       num2;
                IPAddress address;
                char[]    chArray2  = new char[] { ':' };
                string[]  strArray2 = strArray[i].Split(chArray2);
                if ((((strArray2 != null) && (strArray2.Length == 2)) && (!string.IsNullOrEmpty(strArray2[0]) && !string.IsNullOrEmpty(strArray2[1]))) && (strArray2[0].ToLower() == str))
                {
                    switch (attrType)
                    {
                    case TdirNodeAttrType.recommond:
                    case TdirNodeAttrType.enableTSS:
                    case TdirNodeAttrType.backTime:
                    case TdirNodeAttrType.msdkLogMem:
                    case TdirNodeAttrType.tdirTimeOut:
                    case TdirNodeAttrType.tdirSyncTimeOut:
                    case TdirNodeAttrType.waitHurtActionDone:
                    case TdirNodeAttrType.unloadValidCnt:
                    case TdirNodeAttrType.checkdevice:
                    case TdirNodeAttrType.authorParam:
                    case TdirNodeAttrType.autoReplaceActorParam:
                    case TdirNodeAttrType.socketRecvBuffer:
                    case TdirNodeAttrType.reconnectMaxCnt:
                    case TdirNodeAttrType.LogicWorldID:
                    case TdirNodeAttrType.UseDeviceIDChooseSvr:
                    case TdirNodeAttrType.IOSX:
                    {
                        int num4 = 0;
                        if (!int.TryParse(strArray2[1], out num4))
                        {
                            break;
                        }
                        param = num4;
                        return(true);
                    }

                    case TdirNodeAttrType.ISPChoose:
                    {
                        dictionary = new Dictionary <string, int>();
                        char[] chArray3 = new char[] { '*' };
                        strArray3 = strArray2[1].Split(chArray3);
                        num2      = 0;
                        goto Label_018A;
                    }

                    case TdirNodeAttrType.versionDown:
                    case TdirNodeAttrType.versionUp:
                    case TdirNodeAttrType.versionOnlyExcept:
                        IPAddress address2;
                        if (!IPAddress.TryParse(strArray2[1], out address2))
                        {
                            break;
                        }
                        param = BitConverter.ToInt32(address2.GetAddressBytes(), 0);
                        return(true);
                    }
                }
                continue;
Label_0120:
                chArray4 = new char[] { '$' };
                string[] strArray4 = strArray3[num2].Split(chArray4);
                DebugHelper.Assert(strArray4.Length == 2, "后台大爷把用于ISP解析的字符串配错了");
                int result = 0;
                int.TryParse(strArray4[0], out result);
                if (!IPAddress.TryParse(strArray4[1], out address))
                {
                    DebugHelper.Assert(false, "后台大爷把用于ISP解析的字符串配错了,ip解析不了");
                }
                dictionary.Add(strArray4[1], result);
                num2++;
Label_018A:
                if (num2 < strArray3.Length)
                {
                    goto Label_0120;
                }
                param = dictionary;
                return(true);
            }
        }
        return(false);
    }
Esempio n. 2
0
 public bool GetTreeNodeAttr(TdirTreeNode node, TdirNodeAttrType attrType, ref object param)
 {
     return(this.ParseNodeAppAttr(node.staticInfo.appAttr, attrType, ref param));
 }