Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            LookingGlassBase LGB = new LookingGlassBase();

            try {
                m_Parameters = ParseArguments(args, false);
            }
            catch (Exception e) {
                throw new Exception("Could not parse command line parameters: " + e.ToString());
            }
            foreach (KeyValuePair <string, string> kvp in m_Parameters)
            {
                switch (kvp.Key)
                {
                case FIRST_PARAM:
                    break;

                case "-first":
                case "--first":
                    LGB.AppParams.AddOverrideParameter("User.Firstname", kvp.Value);
                    break;

                case "-last":
                case "--last":
                    LGB.AppParams.AddOverrideParameter("User.Lastname", kvp.Value);
                    break;

                case "-password":
                case "--password":
                    LGB.AppParams.AddOverrideParameter("User.Password", kvp.Value);
                    break;

                case "--grid":
                    LGB.AppParams.AddOverrideParameter("User.Grid", kvp.Value);
                    break;

                case "--loginuri":
                    LGB.AppParams.AddOverrideParameter("User.LoginURI", kvp.Value);
                    break;

                case "--configFile":
                    LGB.AppParams.AddOverrideParameter("Settings.File", kvp.Value);
                    break;

                case "--modulesFile":
                    LGB.AppParams.AddOverrideParameter("Settings.Modules", kvp.Value);
                    break;

                case "--cache":
                    LGB.AppParams.AddOverrideParameter("Comm.Assets.CacheDir", kvp.Value);
                    break;

                case "--param":
                    int splitPlace = kvp.Value.IndexOf(':');
                    if (splitPlace > 0)
                    {
                        LGB.AppParams.AddOverrideParameter(
                            kvp.Value.Substring(0, splitPlace - 1).Trim(),
                            kvp.Value.Substring(splitPlace).Trim());
                    }
                    else
                    {
                        Console.Out.WriteLine("ERROR: Could not parse param value: " + kvp.Value);
                        Invocation();
                        return;
                    }
                    break;

                case "--debug":
                    break;

                case ERROR_PARAM:
                    // if we get here, the parser found an error
                    Console.WriteLine("Parameter error: " + kvp.Value);
                    Console.Write(Invocation());
                    return;

                default:
                    Console.WriteLine("ERROR: UNKNOWN PARAMETER: " + kvp.Key);
                    Console.Write(Invocation());
                    return;
                }
            }

            LookingGlassMain LGApplicationInstance = new LookingGlassMain();

            LGApplicationInstance.LGApplicationInstance = LGApplicationInstance;

            Application.Run(LGApplicationInstance);
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            LookingGlassBase LGB = new LookingGlassBase();

            try {
            m_Parameters = ParseArguments(args, false);
            }
            catch (Exception e) {
            throw new Exception("Could not parse command line parameters: " + e.ToString());
            }
            foreach (KeyValuePair<string, string> kvp in m_Parameters)
            {
            switch (kvp.Key)
            {
                case FIRST_PARAM:
                    break;
                case "-first":
                case "--first":
                    LGB.AppParams.AddOverrideParameter("User.Firstname", kvp.Value);
                    break;
                case "-last":
                case "--last":
                    LGB.AppParams.AddOverrideParameter("User.Lastname", kvp.Value);
                    break;
                case "-password":
                case "--password":
                    LGB.AppParams.AddOverrideParameter("User.Password", kvp.Value);
                    break;
                case "--grid":
                    LGB.AppParams.AddOverrideParameter("User.Grid", kvp.Value);
                    break;
                case "--loginuri":
                    LGB.AppParams.AddOverrideParameter("User.LoginURI", kvp.Value);
                    break;
                case "--configFile":
                    LGB.AppParams.AddOverrideParameter("Settings.File", kvp.Value);
                    break;
                case "--modulesFile":
                    LGB.AppParams.AddOverrideParameter("Settings.Modules", kvp.Value);
                    break;
                case "--cache":
                    LGB.AppParams.AddOverrideParameter("Comm.Assets.CacheDir", kvp.Value);
                    break;
                case "--param":
                    int splitPlace = kvp.Value.IndexOf(':');
                    if (splitPlace > 0) {
                        LGB.AppParams.AddOverrideParameter(
                                kvp.Value.Substring(0, splitPlace - 1).Trim(),
                                kvp.Value.Substring(splitPlace).Trim());
                    }
                    else {
                        Console.Out.WriteLine("ERROR: Could not parse param value: " + kvp.Value);
                        Invocation();
                        return;
                    }
                    break;
                case "--debug":
                    break;
                case ERROR_PARAM:
                    // if we get here, the parser found an error
                    Console.WriteLine("Parameter error: " + kvp.Value);
                    Console.Write(Invocation());
                    return;
                default:
                    Console.WriteLine("ERROR: UNKNOWN PARAMETER: " + kvp.Key);
                    Console.Write(Invocation());
                    return;
            }
            }

            LookingGlassMain LGApplicationInstance = new LookingGlassMain();
            LGApplicationInstance.LGApplicationInstance = LGApplicationInstance;

            Application.Run(LGApplicationInstance);
        }