Inheritance: DeOps.Interface.CustomIconForm
示例#1
0
文件: LoginForm.cs 项目: swax/DeOps
        public OpComboItem(LoginForm login, string path)
        {
            Login = login;
            Fullpath = path;

            Name = Path.GetFileNameWithoutExtension(path);
        }
示例#2
0
        public void ShowLogin(string[] args)
        {
            // either c:\... or deops://...
            string arg = "";
            if (args != null && args.Length > 0)
                arg = args[0];

            // find if login exists with same arg
            foreach (LoginForm login in Logins)
                if (login.Arg == arg)
                {
                    login.WindowState = FormWindowState.Normal;
                    login.Activate(); // bring windows on top of other apps
                    return;
                }

            // try pre-process link
            if (arg.StartsWith(@"deops://"))
                if (PreProcessLink(arg)) // public links
                    return;

            LoginForm form = new LoginForm(this, arg);
            form.FormClosed += new FormClosedEventHandler(Window_FormClosed);
            form.Show();
            form.Activate();

            Logins.Add(form);

            // do here because process link can close form and we want all the events already hooked up for it
            if (arg.StartsWith(@"deops://"))
                if (!form.ProcessLink()) // new op links
                    MessageBox.Show("Could not process link:\n" + arg);
        }