예제 #1
0
        private void AdjustConstForType(ReferenceNode node, TypeInfo type)
        {
            DAGNode n = node;

            while (n is ReferenceNode)
            {
                n = n.NextNodes[0];
            }
            if (n is LeafNode && n.Data.Length > 0 && (char.IsDigit(n.Data[0]) || n.Data[0] == '.' || n.Data[0] == '-'))
            {
                long   v  = 0;
                double dv = 0.0;
                if (n.Data.IndexOf('.') >= 0)
                {
                    dv = ConstUtility.ParseDouble(n.Data);
                    v  = (long)dv;
                }
                else
                {
                    v  = ConstUtility.ParseLong(n.Data);
                    dv = (double)v;
                }
                n.Data = ConstUtility.ConstToString(type, v, dv);
            }
        }
예제 #2
0
        /// <summary>
        /// 设置配置信息
        /// </summary>
        /// <param name="jobName"></param>
        public void SetConfig(string jobName)
        {
            string configName = iLog.GetConfigNameByJobName(jobName);

            if (!string.IsNullOrEmpty(configName))
            {
                iConfigMgr = DJS.SDK.DataAccess.CreateIConfigMgr(configName);

                iConfigMgr.SetConfig("DbType", "mysql");
                iConfigMgr.SetConfig("AppCode", "64bba0a26f6d48e98ab67963f74d31bd");
                iConfigMgr.SetConfig("IDBRepository", "Data Source=106.15.197.73;port=3306;Initial Catalog=cms;uid=root;password=1234567890;Charset=utf8");
            }
            else
            {
                iLog.WriteLog("获取任务配置名称错误!" + jobName, 1, true);
            }
            ConstUtility consts = new ConstUtility();
        }
예제 #3
0
        private string AdjustGoto(IlIns il, bool isDecompile)
        {
            long   lv    = IlIns.LabelToValue(il.Value);
            string label = null;

            if (switchBlocks.ContainsKey(lv))
            {
                FlowGraphNode gnode = switchBlocks[lv];
                DAGNode       dnode = switchExpressions[gnode.EndLabelValue];
                while (dnode is ReferenceNode)
                {
                    dnode = dnode.NextNodes[0];
                }
                if (dnode is LeafNode)
                {
                    DAGNode r = GetVarReference(dnode.Data);
                    if (r != null)
                    {
                        int           v        = (int)ConstUtility.ParseLong(r.Data);
                        IlIns         switchIl = ilLines[gnode.EndLabelValue];
                        SwitchOperand op       = switchIl.Operand as SwitchOperand;
                        if (v >= 0 && v < op.Labels.Count)
                        {
                            label = op.Labels[v];
                            lv    = IlIns.LabelToValue(op.Labels[v]);
                        }
                    }
                }
            }
            string label2 = AdjustGoto(il.LabelValue, lv, isDecompile);

            if (label2 != null)
            {
                return(label2);
            }
            else if (label != null)
            {
                return(label);
            }
            return(null);
        }
예제 #4
0
 public string ConstToString(TypeInfo ti)
 {
     return(ConstUtility.ConstToString(ti, IntegerVal, FloatVal));
 }