private void ButtonLogin_Click(object sender, EventArgs e)
 {
     if (radioButtonAdmin.Checked)
     {
         AdminForm adminForm = new AdminForm();
         adminForm.ShowDialog();
     }
     if (radioButtonUser.Checked)
     {
         RegistrationForm regForm = new RegistrationForm();
         regForm.ShowDialog();
     }
 }
Exemplo n.º 2
0
        //if register link is clicked, reset any information input my user and show the registration form
        private void linkRegister_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Hide();
            CenterToScreen();
            txtUsername.Clear();
            txtPassword.Clear();
            TextBoxStyle.TextBoxEmpty(txtUsername, "username");
            TextBoxStyle.TextBoxEmpty(txtPassword, "password");

            var registrationForm = new RegistrationForm(this);

            registrationForm.ShowDialog();
        }
Exemplo n.º 3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            RegistrationForm kupto = new RegistrationForm();
            kupto.ShowDialog();
            //return;

            TextInputForm tif = new TextInputForm();
            tif.Question = "Pitanje je sad?";
            tif.Answer = "Ponuđeni odgovor";
            DialogResult dialogResult = tif.ShowDialog();
            if (dialogResult == DialogResult.OK) MessageBox.Show("Upisano: "+tif.Answer);
            else MessageBox.Show("Pritisnut je Cancel");

            FormFast ff = new FormFast();
            ff.Show();

            Application.Run(new FormHyperlinks());
        }
Exemplo n.º 4
0
        /// <summary>
        /// Register a device with cloud infrastructure.
        /// </summary>
        public async Task RegisterCloudScanner()
        {
            try
            {
                var client = new TwainCloudClient(CloudManager.GetCloudApiRoot());
                var registrationManager = new RegistrationManager(client);

                var scannerInfo = new RegistrationRequest
                {
                    Name        = GetTwainLocalTy(),
                    Description = GetTwainLocalNote()
                };

                var result = await registrationManager.Register(scannerInfo);

                var registrationDialog = new RegistrationForm(registrationManager, result);
                registrationDialog.ShowDialog();

                var pollResult = registrationDialog.PollResponse;
                if (pollResult != null)
                {
                    var cloudScanner = new CloudScanner
                    {
                        Id   = result.ScannerId,
                        Name = $"{scannerInfo.Name} ({scannerInfo.Description})",
                        AuthorizationToken = pollResult.AuthorizationToken,
                        RefreshToken       = pollResult.RefreshToken
                    };

                    SaveScannerRegistration(cloudScanner);
                    SetCurrentCloudScanner(cloudScanner);
                }
            }
            catch (Exception exception)
            {
                Log.Error("RegisterCloudScanner exception - " + exception.Message);
            }
        }
Exemplo n.º 5
0
        //if create is clicked then display registration form
        private void btnCreateUser_Click(object sender, System.EventArgs e)
        {
            var userForm = new RegistrationForm(AccessLevel);

            userForm.ShowDialog();
        }
Exemplo n.º 6
0
        private void RegistrationBtn_Click(object sender, EventArgs e)
        {
            RegistrationForm form = new RegistrationForm();

            form.ShowDialog();
        }
Exemplo n.º 7
0
 private void RegisterButton_Click(object sender, EventArgs e)
 {
     this.Close();
     RegistrationForm regForm = new RegistrationForm();
     regForm.ShowDialog();
 }
        public void OpenRegitrationForm()
        {
            RegistrationForm registrationForm = new RegistrationForm();

            registrationForm.ShowDialog();
        }
        public void Button_Handler(object sender, RoutedEventArgs e)
        {
            var button = sender;

            if (sender == null)
            {
                return;
            }

            if (button == ButtonOpenFile || button == ToolButtonOpenFile)
            {
                var fd = new OpenFileDialog
                {
                    DefaultExt = ".md",
                    Filter     = "Markdown files (*.md)|*.md|" +
                                 "Html files (*.htm,*.html)|*.htm;*.html|" +
                                 "Javascript files (*.js)|*.js|" +
                                 "Json files (*.json)|*.json|" +
                                 "Css files (*.css)|*.css|" +
                                 "Xml files (*.xml,*.config)|*.xml;*.config|" +
                                 "C# files (*.cs)|*.cs|" +
                                 "Foxpro files (*.prg)|*.prg|" +
                                 "All files (*.*)|*.*",
                    CheckFileExists  = true,
                    RestoreDirectory = true,
                    Multiselect      = true,
                    Title            = "Open Markdown File"
                };

                if (!string.IsNullOrEmpty(mmApp.Configuration.LastFolder))
                {
                    fd.InitialDirectory = mmApp.Configuration.LastFolder;
                }

                var res = fd.ShowDialog();
                if (res == null || !res.Value)
                {
                    return;
                }

                OpenTab(fd.FileName);

                AddRecentFile(fd.FileName);
            }
            else if (button == ButtonNewFile)
            {
                OpenTab("untitled");
            }
            else if (button == ButtonExit)
            {
                Close();
            }
            else if (button == MenuOpenConfigFolder)
            {
                ShellUtils.GoUrl(mmApp.Configuration.CommonFolder);
            }
            else if (button == MenuOpenPreviewFolder)
            {
                ShellUtils.GoUrl(Path.Combine(Environment.CurrentDirectory, "PreviewThemes", mmApp.Configuration.RenderTheme));
            }
            else if (button == MenuMarkdownMonsterSite)
            {
                ShellUtils.GoUrl("http://markdownmonster.west-wind.com");
            }
            else if (button == MenuBugReport)
            {
                ShellUtils.GoUrl("https://github.com/RickStrahl/MarkdownMonster/issues");
            }
            else if (button == MenuCheckNewVersion)
            {
                if (!CheckForNewVersion(true))
                {
                    MessageBox.Show("Your version of Markdown Monster is up to date.",
                                    mmApp.ApplicationName, MessageBoxButton.OK, MessageBoxImage.Information);
                }
            }
            else if (button == MenuRegister)
            {
                Window rf = new RegistrationForm();
                rf.Owner = this;
                rf.ShowDialog();
            }
            else if (button == ButtonAbout)
            {
                Window about = new About();
                about.Owner = this;
                about.Show();
            }
            else if (button == ButtonScrollBrowserDown)
            {
                var editor = GetActiveMarkdownEditor();
                if (editor == null)
                {
                    return;
                }
                editor.SpecialKey("ctrl-shift-down");
            }
            else if (button == ButtonScrollBrowserUp)
            {
                var editor = GetActiveMarkdownEditor();
                if (editor == null)
                {
                    return;
                }
                editor.SpecialKey("ctrl-shift-d");
            }
            else if (button == MenuDocumentation)
            {
                ShellUtils.GoUrl("http://markdownmonster.west-wind.com/docs");
            }
            else if (button == MenuCreateAddinDocumentation)
            {
                ShellUtils.GoUrl("http://markdownmonster.west-wind.com/docs/_4ne0s0qoi.htm");
            }
            else if (button == MenuShowErrorLog)
            {
                string logFile = Path.Combine(mmApp.Configuration.CommonFolder, "MarkdownMonsterErrors.txt");
                if (File.Exists(logFile))
                {
                    ShellUtils.GoUrl(logFile);
                }
                else
                {
                    MessageBox.Show("There are no errors in your log file.",
                                    mmApp.ApplicationName,
                                    MessageBoxButton.OK,
                                    MessageBoxImage.Information);
                }
            }
        }