private void rdo_UsingPhotoId_ScrapeCommentmessage_Checked(object sender, RoutedEventArgs e) { try { UserControlScrapeCommentMessagebyPhotoId obj_UserControlScrapeCommentMessagebyPhotoId = new UserControlScrapeCommentMessagebyPhotoId(); var window = new ModernDialog { Content = obj_UserControlScrapeCommentMessagebyPhotoId }; window.MinHeight = 300; window.MinWidth = 700; // window.Topmost = true; Button customButton = new Button() { Content = "Save" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (sa, pa) => { SaveAllData(ref obj_UserControlScrapeCommentMessagebyPhotoId); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); string s1 = string.Empty; } catch(Exception ex) { GlobusLogHelper.log.Error("Error:" + ex.StackTrace); } }
private void chk_SalesNavigator_PremiumOption_Checked(object sender, RoutedEventArgs e) { try { if (chk_SalesNavigator_PremiumOption.IsChecked==true) { GlobalsScraper.chkPremiumOptionsSalesNav = true; var window = new ModernDialog { Content = new UserControl_SalesNaviagtor_PremiumOption() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } else { GlobalsScraper.chkPremiumOptionsSalesNav = false; } } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
private void Application_Startup(object sender, StartupEventArgs e) { if (!IsRunAsAdministrator()) { var processInfo = new ProcessStartInfo(Assembly.GetExecutingAssembly().CodeBase) { UseShellExecute = true, Verb = "runas" }; try { Process.Start(processInfo); } catch { var messageBox = new ModernDialog { Title = "Woops", Content = new ErrorDialog(new InvalidOperationException("Chocolatey Explorer must be run as an administrator.")) }; messageBox.ShowDialog(); } this.Shutdown(); } }
private void chkSearchByUrl_Checked(object sender, RoutedEventArgs e) { try { if (LDGlobals.listAccounts.Count>0) { var window = new ModernDialog { Content = new UserControlLISSearchByUrl() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } else { MessageBox.Show("Please upload the Accounts."); } } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
private void chk_GroupStatusUpdate_GetGroups_Checked(object sender, RoutedEventArgs e) { //try //{ // if (LDGlobals.listAccounts.Count > 0) // { // var window = new ModernDialog // { // Content = new UserControlGEtGroupsForStatusUpdate() // }; // window.MinWidth = 550; // window.MinHeight = 350; // window.Title = "Upload Follow Details"; // window.ShowDialog(); // } // else // { // MessageBox.Show("Please upload accounts."); // return; // } //} //catch (Exception ex) //{ // // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); //} try { UserControlGEtGroupsForStatusUpdate obj = new UserControlGEtGroupsForStatusUpdate(); var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; Button customButton = new Button() { Content = "Save" }; customButton.Click += (ss, ee) => { closeEvent(); window.Close(); }; window.Buttons = new Button[] { customButton }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error("Error : 55" + ex.Message); } }
private void rdoBtn_HashTagsComment_SingleUser_Checked(object sender, RoutedEventArgs e) { try { ClGlobul.HashComment.Clear(); ClGlobul.HashCommentMessage.Clear(); } catch { } try { btn_HashTags_Comment_BrowseUsers.Visibility = Visibility.Hidden; btn_HashTags_Comment_messagebrwer.Visibility = Visibility.Hidden; txt_HashTags_Comment_Message.Visibility = Visibility.Hidden; txt_HashTags_Comment_UserName.Visibility = Visibility.Hidden; Username_Copy.Visibility = Visibility.Hidden; Message.Visibility = Visibility.Hidden; } catch { }; try { txt_HashTags_Comment_Message.IsReadOnly = false; txt_HashTags_Comment_UserName.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Hash Key Here "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (ss, ee) => { SaveAllDataHashkey(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private void CommonDialog_Click(object sender, RoutedEventArgs e) { var dlg = new ModernDialog { Title = "Common dialog", Content = new LoremIpsum() }; dlg.Buttons = new Button[] { dlg.OkButton, dlg.CancelButton}; dlg.ShowDialog(); this.dialogResult.Text = dlg.DialogResult.HasValue ? dlg.DialogResult.ToString() : "<null>"; this.dialogMessageBoxResult.Text = dlg.MessageBoxResult.ToString(); }
void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { var messageBox = new ModernDialog { Title = "Woops", Content = new ErrorDialog(e.Exception) }; messageBox.ShowDialog(); e.Handled = true; }
private void rdoBtn_LikeBy_Username_SingleUser_Checked(object sender, RoutedEventArgs e) { try { ClGlobul.PhotoList.Clear(); } catch { } try { btn_LikePhoto_Username_BrowseUsers.Visibility = Visibility.Hidden; txt_LikePhoto_Username_LoadUsersPath.Visibility = Visibility.Hidden; Likeby_Username.Visibility = Visibility.Hidden; } catch { }; try { txt_LikePhoto_Username_LoadUsersPath.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Username Here : "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (ss, ee) => { SaveAllData2(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private void rdoBtn_commentMessage_SingleId_Checked(object sender, RoutedEventArgs e) { try { ClGlobul.lst_ScrapeCommentMessagePhotoId.Clear(); txt_PhotoId_Commentmessage.Text = string.Empty; } catch { } try { btn_PhotoId_Commentmessage.Visibility = Visibility.Hidden; txt_PhotoId_Commentmessage.Visibility = Visibility.Hidden; Photo_ID.Visibility = Visibility.Hidden; } catch { }; try { txt_PhotoId_Commentmessage.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Photo ID here to Scrape there Comment Message : "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "Save" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (sa, pa) => { SaveAllData(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
/// <summary>Simple input dialog box</summary> /// <returns>null if the dialog box was closed with "cancel", /// otherwise the user input<returns> public static string ShowInputDialog(string initialTitle = "", string initialText = "", string initialInput = null) { // create the dialog content TextBox content = new TextBox() { VerticalAlignment = VerticalAlignment.Bottom, TabIndex = 0 }; content.Text = initialInput; Label lbl = new Label() { Content = initialText, VerticalAlignment = VerticalAlignment.Top, Focusable = false }; Grid g = new Grid() { Height = 50, Focusable = false }; g.Children.Add(content); g.Children.Add(lbl); // create the ModernUI dialog component with the buttons var dlg = new ModernDialog { Title = initialTitle, ShowInTaskbar = false, Content = g, MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, }; FocusManager.SetFocusedElement(g, content); content.SelectAll(); dlg.Buttons = new Button[] { dlg.OkButton, dlg.CancelButton }; // register the event to retrieve the result of the dialog box string result = null; dlg.OkButton.Click += (object sender, RoutedEventArgs e) => { result = content.Text; }; dlg.ShowDialog(); return result; }
public bool? ShowOkMessage(string message, string title) { var dlg = new ModernDialog { Title = title, Content = new BBCodeBlock { BBCode = message, Margin = new Thickness(0, 0, 0, 8) }, MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, }; // Localize buttons dlg.OkButton.Content = LocalizationService.Localize("Ok"); dlg.Buttons = new List<Button> { dlg.OkButton }; return dlg.ShowDialog(); }
private void CheckBox_Checked_2(object sender, RoutedEventArgs e) { try { var window = new ModernDialog { Content = new UserControlMessageInputForGroups() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
private async void UserControl_Initialized(object sender, EventArgs e) { this.mpr.IsActive = true; try { this._sent = await Task.Run(() => getSent()); displayMails(); } catch (Exception ex) { ModernDialog md = new ModernDialog(); md.Title = "Error"; md.Content = ex.Message; md.Buttons = new List<Button>() { md.OkButton }; md.ShowDialog(); } this.mpr.IsActive = false; }
private void CheckBox_Checked_1(object sender, RoutedEventArgs e) { try { GlobalsAddConn.selectedManageConnKeyword = true; var window = new ModernDialog { Content = new UserControlAddConnectionByKeyword() }; window.MinWidth = 550; window.MinHeight = 350; // window.Title = "Upload Follow Details"; window.ShowDialog(); } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } }
private void CheckBox_Checked(object sender, RoutedEventArgs e) { try { var window = new ModernDialog { Content = new UserControlGetFirstConnectionForMessageSending() }; window.MinWidth = 550; window.MinHeight = 350; window.Title = "Get The First Connection"; window.ShowDialog(); } catch (Exception ex) { // GlobusLogHelper.log.Error("Error : " + ex.StackTrace); } // new UserControlGetFirstConnectionForMessageSending() }
public static ModernInputDialogMessageBoxResult ShowInputMessage(string text, string title, MessageBoxButton button, Window owner = null) { var dlg = new ModernDialog { Title = title, Content = CreateContent(text), MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, }; if (owner != null) { dlg.Owner = owner; } dlg.Buttons = GetButtons(dlg, button); dlg.ShowDialog(); return new ModernInputDialogMessageBoxResult() { MessageBoxResult = dlg.MessageBoxResult, Input = textBox.Text}; }
private async void initMails() { this.mpr.IsActive = true; try { this._sent = await Task.Run(() => getSent()); displayMails(); } catch (Exception ex) { ModernDialog md = new ModernDialog(); md.Title = "Error"; md.Content = ex.Message; md.Buttons = new List<Button>() { md.OkButton }; md.ShowDialog(); } MailManager.GetInstance().SentAlreadyLoaded = true; this.mpr.IsActive = false; this.btnRefresh.IsEnabled = true; }
private void OnShowMiniSpecialDialog(object sender, ExecutedRoutedEventArgs e) { var dlg = new ModernDialog { Title = "Help & code window", Content = new SpecialWindowControl(e.Parameter), ResizeMode = ResizeMode.CanResize, MaxWidth = 1920, MaxHeight = 1080, MinWidth = 700, MinHeight = 500, Width = 700, Height = 500, SizeToContent = SizeToContent.Manual, }; dlg.OkButton.Content = "OK"; dlg.OkButton.VerticalContentAlignment = VerticalAlignment.Center; //dlg.OkButton.FontWeight = FontWeights.Bold; dlg.Buttons = new[] { dlg.OkButton }; dlg.ShowDialog(); }
public static string ShowMessage(string text, string title, Window owner, params ButtonDef[] buttons) { string result = null; var dialog = new ModernDialog { Title = title, Content = new BBCodeBlock {BBCode = text, Margin = new Thickness(0, 0, 0, 8)}, MinHeight = 0, MinWidth = 0, MaxHeight = 480, MaxWidth = 640, Owner = owner }; dialog.Buttons = buttons.Select(def => CreateButton(def, () => { result = def.Name; dialog.Close(); })); dialog.ShowDialog(); return result; }
private void btnSelectEmail_Click(object sender, RoutedEventArgs e) { try { bool? asdf = new SelectEmailWindow().ShowDialog(); if (gmap.Markers.Count > 0) { initializeMap(); } this.txtCanvas.Visibility = System.Windows.Visibility.Visible; initializeMarkers(); } catch (Exception ex) { ModernDialog mde = new ModernDialog(); mde.Title = "Error"; mde.Content = ex.Message; mde.Buttons = new List<Button>() { mde.OkButton }; mde.ShowDialog(); } }
private async void btnRefresh_Click(object sender, RoutedEventArgs e) { this.mpr.IsActive = true; this.btnRefresh.IsEnabled = false; this.EmailList.SelectedIndex = -1; this.deleteFileContent(); try { this._inbox = await Task.Run(() => getInbox()); displayMails(); } catch (Exception ex) { ModernDialog md = new ModernDialog(); md.Title = "Error"; md.Content = ex.Message; md.Buttons = new List<Button>() { md.OkButton }; md.ShowDialog(); } this.mpr.IsActive = false; this.btnRefresh.IsEnabled = true; }
public void rdbSingleUserComment() { try { objCommentManagers.rdbSingleUserComment = true; objCommentManagers.rdbMultipleUserComment = false; btnMessage_Comment_Browse.Visibility = Visibility.Hidden; txtCommentMessage.Visibility = Visibility.Hidden; lbMsg_Comment.Visibility = Visibility.Hidden; ClGlobul.CommentMessagesList.Clear(); try { UserControl_SingleUser obj = new UserControl_SingleUser(); obj.UserControlHeader.Text = "Enter Message Here "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; customButton.Click += (ss, ee) => { closeEvent(); window.Close(); }; window.Buttons = new Button[] { customButton }; window.ShowDialog(); MessageBoxButton btnC = MessageBoxButton.YesNo; var result = ModernDialog.ShowMessage("Are you sure want to save ?", "Message Box", btnC); if (result == MessageBoxResult.Yes) { TextRange textRange = new TextRange(obj.txtEnterSingleMessages.Document.ContentStart, obj.txtEnterSingleMessages.Document.ContentEnd); if (!string.IsNullOrEmpty(textRange.Text)) { string enterText = textRange.Text; string[] arr = Regex.Split(enterText, "\r\n"); foreach (var arr_item in arr) { if (!string.IsNullOrEmpty(arr_item) || !arr_item.Contains("")) { ClGlobul.CommentMessagesList.Add(arr_item); } } } GlobusLogHelper.log.Info(" => [ Message Loaded : " + ClGlobul.CommentMessagesList.Count + " ]"); GlobusLogHelper.log.Debug("Message : " + ClGlobul.CommentMessagesList.Count); } } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private JobDownloadViewModel ShowAddJobDialog(JobDownloadViewModel newJob, String title = "Add Job", String message = "") { var ctx = new NijieDownloader.UI.Main.Popup.AddJob(newJob, message); var d = new ModernDialog(); d.Buttons = ctx.Buttons; d.Content = ctx; d.Title = title; d.ShowDialog(); return ctx.NewJob; }
private void ExecuteStartCommand(object sender, ExecutedRoutedEventArgs e) { cancelToken = new CancellationTokenSource(); _jobRunner.BatchStatus = JobStatus.Running; foreach (var job in ViewData) { if (job.Status != JobStatus.Completed) { _jobRunner.DoJob(job, cancelToken); job.PauseEvent.Set(); } } // notify when all done _jobRunner.NotifyAllCompleted(() => { ModernDialog d = new ModernDialog(); var sb = new StringBuilder(); sb.Append("Jobs Completed!"); sb.Append(Environment.NewLine); int completed = 0; int error = 0; int cancelled = 0; foreach (var job in ViewData) { if (job.Status == JobStatus.Completed) ++completed; else if (job.Status == JobStatus.Error) ++error; else if (job.Status == JobStatus.Cancelled) ++cancelled; } sb.Append("\tCompleted : " + completed); sb.Append(Environment.NewLine); sb.Append("\tError : " + error); sb.Append(Environment.NewLine); sb.Append("\tCancelled : " + cancelled); d.Content = sb.ToString(); d.ShowDialog(); _jobRunner.BatchStatus = JobStatus.Completed; //txtStatus.Text = _jobRunner.BatchStatus.ToString(); }); //txtStatus.Text = _jobRunner.BatchStatus.ToString(); }
private void rdo_SingleUser_Unfollower(object sender, RoutedEventArgs e) { txt_UnfollowerUser.Clear(); ClGlobul.lstUnfollowerList.Clear(); try { ClGlobul.lstUnfollowerList.Clear(); } catch { } try { Unfollower_browser.Visibility = Visibility.Hidden; txt_UnfollowerUser.Visibility = Visibility.Hidden; lbe_Userunfollow.Visibility = Visibility.Hidden; } catch { }; try { txt_UnfollowerUser.IsReadOnly = false; } catch { }; try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Unsername To Unfollow Here "; //obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (ss, ee) => { SaveAllData(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private void showSuccessDialog() { ModernDialog msgbox = new ModernDialog(); msgbox.Title = "Success"; msgbox.Content = "You are now registered!"; msgbox.Buttons = new[] { msgbox.OkButton }; msgbox.ShowDialog(); }
private void showSpecialsDialog() { ModernDialog msgbox = new ModernDialog(); msgbox.Title = "Error"; msgbox.Content = "Passwords must be letters and digits only."; msgbox.Buttons = new[] { msgbox.OkButton }; msgbox.ShowDialog(); }
private void showMisMatchDialog() { ModernDialog msgbox = new ModernDialog(); msgbox.Title = "Error"; msgbox.Content = "Passwords do not match."; msgbox.Buttons = new[] { msgbox.OkButton }; msgbox.ShowDialog(); }
private void chkBox_Scraper_ScrapeUserFollowing_SingleUsername_Checked(object sender, RoutedEventArgs e) { GlobalDeclration.objScrapeUser.listOfFollowing.Clear(); try { btn_ScrapeUserFollowing_Browse.Visibility = Visibility.Hidden; lblLoadUsername.Visibility = Visibility.Hidden; Txt_ScrapeFollowing.Visibility = Visibility.Hidden; } catch(Exception ex) { } try { UsercontrolSingleUser obj = new UsercontrolSingleUser(); obj.UserControlHeader.Text = "Enter Username Here "; // obj.txtEnterSingleMessages.ToolTip = "Format :- Niche::BoardName::BoardUrl"; var window = new ModernDialog { Content = obj }; window.ShowInTaskbar = true; window.MinWidth = 100; window.MinHeight = 300; Button customButton = new Button() { Content = "SAVE" }; Button customButton1 = new Button() { Content = "Close" }; customButton1.Click += (ss, ee) => { closeEvent(); window.Close(); }; customButton.Click += (ss, ee) => { SaveAllData(ref obj); window.Close(); }; window.Buttons = new Button[] { customButton, customButton1 }; window.ShowDialog(); } catch (Exception ex) { GlobusLogHelper.log.Error(" Error :" + ex.StackTrace); } }
private static MessageBoxResult ShowMessageInner(string text, string title, MessageBoxButton button, ShowMessageCallbacks doNotAskAgainLoadSave, Window owner = null) { var value = doNotAskAgainLoadSave?.Item1?.Invoke(); if (value != null) { return(value.Value); } FrameworkElement content = new SelectableBbCodeBlock { BbCode = text, Margin = new Thickness(0, 0, 0, 8) }; CheckBox doNotAskAgainCheckbox; if (doNotAskAgainLoadSave != null) { doNotAskAgainCheckbox = new CheckBox { Content = new Label { Content = "Don’t ask again" } }; content = new SpacingStackPanel { Spacing = 8, Children = { content, doNotAskAgainCheckbox } }; } else { doNotAskAgainCheckbox = null; } var dlg = new ModernDialog { Title = title.ToTitle(), Content = new ScrollViewer { Content = content, MaxWidth = 640, MaxHeight = 520, VerticalScrollBarVisibility = ScrollBarVisibility.Auto, HorizontalScrollBarVisibility = ScrollBarVisibility.Disabled }, MinHeight = 0, MinWidth = 0, MaxHeight = 640, MaxWidth = 800 }; if (owner != null) { dlg.Owner = owner; } dlg.Buttons = GetButtons(dlg, button); dlg.ShowDialog(); if (doNotAskAgainCheckbox != null) { doNotAskAgainLoadSave.Item2.Invoke(doNotAskAgainCheckbox.IsChecked == true ? dlg.MessageBoxResult : (MessageBoxResult?)null); } return(dlg.MessageBoxResult); }