Esempio n. 1
0
 private void Authenticating()
 {
     Receive <AuthenticationFailed>(failed => BecomeUnauthenticated());
     Receive <AuthenticationCancelled>(cancelled => BecomeUnauthenticated());
     Receive <AuthenticationSuccess>(success =>
     {
         var launcherForm = new LauncherForm();
         launcherForm.Show();
         _form.Hide();
     });
 }
 private void Authenticating()
 {
     Receive<AuthenticationFailed>(failed => BecomeUnauthenticated("Authentication failed."));
     Receive<AuthenticationCancelled>(cancelled => BecomeUnauthenticated("Authentication timed out."));
     Receive<AuthenticationSuccess>(success =>
     {
         var launcherForm = new LauncherForm();
         launcherForm.Show();
         _form.Hide();
     });
 }
Esempio n. 3
0
        static void Main()
        {
            Application.SetCompatibleTextRenderingDefault(false);
            LauncherForm launcherForm = new LauncherForm();

            Application.Run(launcherForm);
            if (launcherForm.ShowMainForm)
            {
                Application.Run(new MainForm());
            }
        }
 /// <summary>
 ///     The authenticating.
 /// </summary>
 private void Authenticating()
 {
     this.Receive <AuthenticationFailed>(failed => this.BecomeUnauthenticated("Authentication failed."));
     this.Receive <AuthenticationCancelled>(cancelled => this.BecomeUnauthenticated("Authentication timed out."));
     this.Receive <AuthenticationSuccess>(
         success =>
     {
         var launcherForm = new LauncherForm();
         launcherForm.Show();
         this.form.Hide();
     });
 }
Esempio n. 5
0
    static void Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);

        LauncherForm launcher = new LauncherForm();
        Client       client   = new Client("test");

        launcher.SetClient(client);

        Application.Run(new LauncherForm());
    }
Esempio n. 6
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var launcher = new LauncherForm();

            Application.Run(launcher);

            if (launcher.DialogResult == DialogResult.OK)
            {
                Application.Run(new MainForm(launcher.Blueprint, launcher.BlueprintEntity));
            }
        }
Esempio n. 7
0
		/// <summary>
		///     Edits an existing entry
		/// </summary>
		/// <param name="entry">The LauncherEntry to edit</param>
		public void EditEntry(LauncherEntry entry)
		{
			if (!m_Entries.Contains(entry))
				return;

			var form = new LauncherForm();
			form.SelectedEntry = entry;

			if (form.ShowDialog() == DialogResult.OK)
			{
				if (OnEntriesChanged != null)
				{
					OnEntriesChanged(this, new EventArgs());
				}
			}
		}
Esempio n. 8
0
		/// <summary>
		///     Creates a new launcher entry
		/// </summary>
		public void CreateNewEntry()
		{
			var form = new LauncherForm();

			if (form.ShowDialog() == DialogResult.OK)
			{
				var entry = form.SelectedEntry;

				m_Entries.Add(entry);

				if (OnEntriesChanged != null)
				{
					OnEntriesChanged(this, new EventArgs());
				}
			}
		}
Esempio n. 9
0
        public UpdateForm(GitHubRelease release, Configuration configuration, LauncherForm f)
        {
            rls            = release;
            _configuration = configuration;
            InitializeComponent();
            LoadLocalization();
            update_url  = new Uri(@"https://github.com/dommilosz/MLauncher/releases/download/" + rls.Tag + "/MLauncher.exe");
            newpatch    = Application.ExecutablePath.Replace(".exe", "_" + rls.Tag + ".exe");
            update_size = GetUpdateSize();
            batchURL    = new Uri(@"https://github.com/dommilosz/MLauncher/releases/download/v0.2.0/Update.bat");
            autocheckCheckBox.Checked = _configuration.ApplicationConfiguration.CheckLauncherUpdates;
            Text = $"Found update: {release.Name}";

            changelogBox.Text  = $"Installed Version : {Application.ProductVersion}" + Environment.NewLine;
            changelogBox.Text += $"Latest Version : {rls.Tag}" + Environment.NewLine;
            changelogBox.Text += $"Update Size : {update_size.MB}MB  ({update_size.B} bytes)" + Environment.NewLine;
            changelogBox.Text += $"{release.Description}";
            form = f;
        }
Esempio n. 10
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            List <LanguageService> services = LanguageService.GetAvailables();

            if (services.Count > 1)
            {
                using (LauncherForm launcher = new LauncherForm(services))
                {
                    launcher.StartPosition = FormStartPosition.CenterScreen;
                    launcher.ShowDialog();
                    language = launcher.Language;
                }
            }
            else
            {
                language = services[0];
            }
            Application.Run(new MainForm(language));
        }
Esempio n. 11
0
        private static void Main()
        {
            bool   createdNew = false;
            string name       = "";

            foreach (char ch in (Launcher.GetRootDirectory() + nameof(Launcher)).ToLower())
            {
                name += (string)(object)(char)(ch == '\\' || ch == ':' ? 45 : (int)ch);
            }
            Mutex mutex = new Mutex(true, name, out createdNew);

            if (!createdNew)
            {
                NativeMethods.PostMessage((IntPtr)(int)ushort.MaxValue, NativeMethods.WM_SHOWME, IntPtr.Zero, IntPtr.Zero);
            }
            else
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run((Form)(Launcher.TheLauncherForm = new LauncherForm()));
            }
        }
Esempio n. 12
0
        public static void Initialize(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("Usage PSXPrev folder filter(optional) -tmd(optional) -vdf(optional) -pmd(optional) -tim(optional) -tod(optional) -an(optional) -hmd(optional) -croc(optional) -psx(optional) -log(optional) -noverbose(optional) -debug(optional) -ignoretmdversion(optional) -bff(optional)");
                LauncherForm = new LauncherForm();
                var thread = new Thread(new ThreadStart(delegate
                {
                    Application.EnableVisualStyles();
                    Application.Run(LauncherForm);
                }));
                thread.SetApartmentState(ApartmentState.STA);
                thread.Start();
                return;
            }

            var path = args[0];
            //if (!Directory.Exists(path) && !File.Exists(path))
            //{
            //    Program.Logger.WriteErrorLine("Directory/File not found");
            //    return;
            //}

            var filter = args.Length > 1 ? args[1] : "*.*";

            var checkTmd         = false;
            var checkVdf         = false;
            var checkTim         = false;
            var checkPmd         = false;
            var checkTod         = false;
            var checkAn          = false;
            var checkHmdModels   = false;
            var checkCrocModels  = false;
            var checkPsx         = false;
            var checkBff         = false;
            var log              = false;
            var noVerbose        = false;
            var debug            = false;
            var ignoreTmdVersion = false;

            for (var a = 2; a < args.Length; a++)
            {
                switch (args[a])
                {
                case "-tmd":
                    checkTmd = true;
                    break;

                case "-vdf":
                    checkVdf = true;
                    break;

                case "-pmd":
                    checkPmd = true;
                    break;

                case "-tim":
                    checkTim = true;
                    break;

                case "-tod":
                    checkTod = true;
                    break;

                case "-an":
                    checkAn = true;
                    break;

                case "-hmd":
                    checkHmdModels = true;
                    break;

                case "-log":
                    log = true;
                    break;

                case "-noverbose":
                    noVerbose = true;
                    break;

                case "-debug":
                    debug = true;
                    break;

                case "-croc":
                    checkCrocModels = true;
                    break;

                case "-psx":
                    checkPsx = true;
                    break;

                case "-ignoretmdversion":
                    ignoreTmdVersion = true;
                    break;

                case "-bff":
                    checkBff = true;
                    break;
                }
            }
            DoScan(path, filter, checkTmd, checkVdf, checkTim, checkPmd, checkTod, checkHmdModels, log, noVerbose, debug, checkCrocModels, checkPsx, checkAn, ignoreTmdVersion, checkBff);
        }
Esempio n. 13
0
        private static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine("Usage PSXPrev folder filter(optional) -tmd(optional) -tmdAlt(optional) -pmd(optional) -tim(optional) -timAlt(optional) -tod(optional) -hmdmodels(optional) -log(optional) -noverbose(optional)");
                LauncherForm = new LauncherForm();
                var thread = new Thread(new ThreadStart(delegate
                {
                    Application.EnableVisualStyles();
                    Application.Run(LauncherForm);
                }));
                thread.SetApartmentState(ApartmentState.STA);
                thread.Start();
                return;
            }

            var path = args[0];

            if (!Directory.Exists(path) && !File.Exists(path))
            {
                Logger.WriteLine("Directory/File not found");
                return;
            }

            var filter = args.Length > 1 ? args[1] : "*.*";

            var checkTmd       = false;
            var checkTmdAlt    = false;
            var checkTim       = false;
            var checkTimAlt    = false;
            var checkPmd       = false;
            var checkTod       = false;
            var checkHmdModels = false;
            var log            = false;
            var noVerbose      = false;
            var debug          = false;

            for (var a = 2; a < args.Length; a++)
            {
                switch (args[a])
                {
                case "-tmd":
                    checkTmd = true;
                    break;

                case "-tmdAlt":
                    checkTmdAlt = true;
                    break;

                case "-pmd":
                    checkPmd = true;
                    break;

                case "-tim":
                    checkTim = true;
                    break;

                case "-timAlt":
                    checkTimAlt = true;
                    break;

                case "-tod":
                    checkTod = true;
                    break;

                case "-hmdmodels":
                    checkHmdModels = true;
                    break;

                case "-log":
                    log = true;
                    break;

                case "-noverbose":
                    noVerbose = true;
                    break;

                case "-debug":
                    debug = true;
                    break;
                }
            }

            DoScan(path, filter, checkTmd, checkTmdAlt, checkTim, checkTimAlt, checkPmd, checkTod, checkHmdModels, log, noVerbose, debug);
        }