예제 #1
0
파일: UnitSet.cs 프로젝트: ikvm/test
        public string toString(string delim)
        {
            StringBuilder builder    = new StringBuilder(300);
            IEnumerator   enumerator = new SupportClass.SetSupport(this.hashtable_0.Keys).GetEnumerator();

            while (enumerator.MoveNext())
            {
                string key = ((string)enumerator.Current).Trim();
                builder.Append(delim).Append(key).Append("=").Append(this[key]);
            }
            if (builder.Length <= 0)
            {
                return(null);
            }
            return(builder.ToString(delim.Length, builder.Length - delim.Length));
        }
예제 #2
0
 private void method_9(Env env_0)
 {
     try
     {
         IDbConnection connection = env_0.getConnection();
         if (connection != null)
         {
             try
             {
                 connection.Close();
             }
             catch (Exception)
             {
             }
         }
         StringMap connections = env_0.Connections;
         if ((connections != null) && (connections.Count > 0))
         {
             IEnumerator enumerator = new SupportClass.SetSupport(connections.Keys).GetEnumerator();
             while (enumerator.MoveNext())
             {
                 string        current     = (string)enumerator.Current;
                 IDbConnection connection2 = (IDbConnection)connections[current];
                 try
                 {
                     connection2.Close();
                     continue;
                 }
                 catch (Exception)
                 {
                     continue;
                 }
             }
         }
     }
     catch (Exception)
     {
     }
 }
예제 #3
0
        private void preapareArgs(ReportDefine reportDefine_0, Hashtable hashtable_0, Env env_0)
        {
            Args arguments = reportDefine_0.Arguments;

            if (arguments.size() > 0)
            {
                int num2 = arguments.size();
                for (int i = 0; i < num2; i++)
                {
                    Arg    arg = arguments[i];
                    string val = null;
                    if (hashtable_0 != null)
                    {
                        val = (string)hashtable_0[arg.enName];
                    }
                    if (((val == null) && (arg.value_Renamed != null)) && (arg.value_Renamed.Trim().Length > 0))
                    {
                        val = arg.value_Renamed;
                    }
                    int    num3       = int.Parse(arg.type);
                    object paramValue = null;
                    try
                    {
                        paramValue = ArgDataType.getProperData(num3, val);
                    }
                    catch (Exception)
                    {
                        throw new Exception(new StringBuilder("参数\"").Append(arg.chName).Append("\"的值").Append(val).Append("与其类型不匹配!").ToString().ToString());
                    }
                    env_0.putParam(arg.enName, paramValue);
                    _builder.Append("<arg><name>" + arg.enName + "</name><value>" + Convert.ToString(paramValue) + "</value></arg>");
                }
            }
            StringMap macros = reportDefine_0.Macros;

            if ((macros != null) && (macros.Count > 0))
            {
                IEnumerator enumerator = new SupportClass.SetSupport(macros.Keys).GetEnumerator();
                while (enumerator.MoveNext())
                {
                    string current = (string)enumerator.Current;
                    string str4    = null;
                    if (hashtable_0 != null)
                    {
                        str4 = (string)hashtable_0[current];
                    }
                    if (str4 == null)
                    {
                        str4 = (string)macros[current];
                    }
                    _builder.Append("<macro><name>" + current + "</name><value>" + str4 + "</value></macro>");
                    env_0.putMacro(current, str4);
                }
            }
            string str      = null;
            string rootPath = null;

            if (env_0.Request == null)
            {
                str      = env_0.getParameter("e_setparammacro");
                rootPath = FileAction.rootPath;
            }
            else
            {
                str      = env_0.Request["e_setparammacro"];
                rootPath = env_0.Request.PhysicalApplicationPath;
            }
            if ((str != null) && (str.Length > 0))
            {
                Type type = Assembly.LoadFrom(rootPath + @"bin\LoadEbiao.dll").GetType("LoadEbiao.IParamMacro");
                if (type != null)
                {
                    object[]     args       = new object[0];
                    object       obj2       = Activator.CreateInstance(type, args);
                    BindingFlags invokeAttr = BindingFlags.Public | BindingFlags.Instance;
                    object[]     parameters = new object[] { env_0 };
                    try
                    {
                        type.GetMethod("setParams").Invoke(obj2, invokeAttr, Type.DefaultBinder, parameters, null);
                    }
                    catch (Exception exception)
                    {
                        throw new Exception(exception.InnerException.Message);
                    }
                    try
                    {
                        type.GetMethod("setMacros").Invoke(obj2, invokeAttr, Type.DefaultBinder, parameters, null);
                    }
                    catch (Exception exception2)
                    {
                        throw new Exception(exception2.InnerException.Message);
                    }
                }
            }
        }