private void cancelButton_Click(object sender, RoutedEventArgs e)
        {
            Visibility = Visibility.Hidden;
            var callback = doneCallback;

            doneCallback = null;
            if (callback != null)
            {
                callback(MessageOverlayResults.Cancel);
            }
        }
        private void okButton_Click(object sender, RoutedEventArgs e)
        {
            optionChecked = optionCheckBox.IsChecked == true;

            Visibility = Visibility.Hidden;
            var callback = doneCallback;

            doneCallback = null;
            if (callback != null)
            {
                callback(MessageOverlayResults.Ok);
            }
        }
        public void Setup(string title, string message, string option, MessageOverlayTypes type, DoneCallbackMethod doneCallback)
        {
            // cancel pending message
            if (this.doneCallback != null)
            {
                doneCallback(MessageOverlayResults.Cancel);
            }
            this.doneCallback = doneCallback;

            // setup
            titleTextBox.Text = title;
            messageLabel.Text = message;
            if (option != null)
            {
                optionCheckBox.IsChecked  = true;
                optionCheckBox.Content    = option;
                optionCheckBox.Visibility = Visibility.Visible;
            }
            else
            {
                optionCheckBox.IsChecked  = false;
                optionCheckBox.Visibility = Visibility.Hidden;
            }

            if (type == MessageOverlayTypes.Ok)
            {
                okButton.Content        = "Ok";
                cancelButton.Visibility = Visibility.Hidden;
            }
            else if (type == MessageOverlayTypes.OkCancel)
            {
                okButton.Content        = "Ok";
                cancelButton.Content    = "Cancel";
                cancelButton.Visibility = Visibility.Visible;
            }
            else
            {
                okButton.Content        = "Yes";
                cancelButton.Content    = "No";
                cancelButton.Visibility = Visibility.Visible;
            }
        }
        public void Setup(string currentName, bool showRemotesOption, DoneCallbackMethod doneCallback)
        {
            this.doneCallback         = doneCallback;
            nameTextBox.Text          = currentName;
            remoteLabel.Visibility    = showRemotesOption ? Visibility.Visible : Visibility.Hidden;
            remoteComboBox.Visibility = showRemotesOption ? Visibility.Visible : Visibility.Hidden;
            if (showRemotesOption)
            {
                remoteComboBox.Items.Clear();
                var item = new ComboBoxItem();
                item.Content = "[Local Branch]";
                item.ToolTip = "This branch will only be tracked by your computer";
                remoteComboBox.Items.Add(item);
                foreach (var remote in RepoScreen.singleton.repoManager.remoteStates)
                {
                    item         = new ComboBoxItem();
                    item.Content = remote.name;
                    item.ToolTip = "URL: " + remote.url;
                    remoteComboBox.Items.Add(item);
                }

                remoteComboBox.SelectedIndex = 0;
            }
        }
 public void Setup(string filePath, bool isBinaryMode, DoneCallbackMethod doneCallback)
 {
     this.doneCallback = doneCallback;
     this.isBinaryMode = isBinaryMode;
     WaitMode(filePath, string.IsNullOrEmpty(filePath));
 }