• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# CustomMessageBox类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CustomMessageBox的典型用法代码示例。如果您正苦于以下问题:C# CustomMessageBox类的具体用法?C# CustomMessageBox怎么用?C# CustomMessageBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CustomMessageBox类属于命名空间,在下文中一共展示了CustomMessageBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Show

 public void Show(string text, string firstOption, string secondOption, Action firstAction, Action secondAction)
 {
     Mvx.Resolve<IMvxMainThreadDispatcher>().RequestMainThreadAction(() =>
     {
         _messageBox = new CustomMessageBox
         {
             AllowDrop = false,
             Message = text,
             IsLeftButtonEnabled = true,
             IsRightButtonEnabled = true,
             LeftButtonContent = firstOption,
             RightButtonContent = secondOption
         };
         _messageBox.Dismissed += (s, e) =>
         {
             if (e.Result == CustomMessageBoxResult.LeftButton && firstAction != null)
             {
                 firstAction();
             }
             else if (e.Result == CustomMessageBoxResult.RightButton && secondAction != null)
             {
                 secondAction();
             }
         };
         _messageBox.Show();
     });
 }
开发者ID:sbondini,项目名称:FriendList,代码行数:27,代码来源:WinPhoneAlertDialog.cs


示例2: RunRateAppCheck

        private void RunRateAppCheck()
        {
            var messageBox = new CustomMessageBox()
            {
                Caption = Messages.MainPage_RateHeader,
                Message = Messages.MainPage_DoYouLikeApp,
                LeftButtonContent = UILabels.Common_Yes,
                RightButtonContent = UILabels.Common_No
            };
            messageBox.Dismissed += (s1, e1) =>
            {
                switch (e1.Result)
                {
                    case CustomMessageBoxResult.LeftButton: // yes
                        InitRateRequest();                        
                        break;
                    case CustomMessageBoxResult.RightButton: // no
                        InitEmailRequest();
                        break;
                    default:
                        App.ApplicationSettings.LastCoolDownActivated = DateTime.UtcNow;
                        break;
                }
            };

            messageBox.Show();
        }
开发者ID:ravado,项目名称:Foodler,代码行数:27,代码来源:MainPage.xaml.cs


示例3: MainForm

        public MainForm(AppManager manager)
        {
            _flgLoading = true;
            InitializeComponent();

            _manager = manager;
            if (_manager == null)
            {
                CustomMessageBox cmb = new CustomMessageBox("The application manager has not been loaded for some reason.\nThe application can't work and will be closed.", "FATAL", MessageBoxDialogButtons.Ok, MessageBoxDialogIcon.Fatal, false, false);
                cmb.ShowDialog();
                cmb.Dispose();
                this.Close();
            }

            InitializeStyle();
            InitializeGUIEventsHandlers();

            categoriesTabs.Manager = _manager;

            SetupUI();
            _SelectedCategory = -1;
            _SelectedGame = -1;
            EnableMenus(false);
            if (_manager.AppSettings.ReloadLatestDB && (_manager.RecentDBs != null && _manager.RecentDBs.Count > 0))
                OpenRecentDatabase(_manager.RecentDBs.First().Value.DBPath, false);

            _flgLoading = false;
        }
开发者ID:midium,项目名称:DOSBoxManager,代码行数:28,代码来源:MainForm.cs


示例4: lstAdapters_SelectionChanged

        private void lstAdapters_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            lstAdapterItem selItem = ((lstAdapterItem)lstAdapters.SelectedItem);
            TextBox dnsBox = new TextBox() { Text = selItem.PrimaryDNS };

            TiltEffect.SetIsTiltEnabled(dnsBox, true);

            CustomMessageBox messageBox = new CustomMessageBox()
            {
                Caption = "Edit DNS for " + selItem.Name,
                Message = "Primary DNS Server:",
                Content = dnsBox,
                LeftButtonContent = "save",
                RightButtonContent = "cancel",
                IsFullScreen = false
            };

            messageBox.Dismissed += (s1, e1) =>
            {
                if (e1.Result == CustomMessageBoxResult.LeftButton)
                {
                    Registry.SetMultiStringValue(selItem.KeyRoot, selItem.KeyPath, "DNS", new string[] { dnsBox.Text });
                    //TODO: Clear the list first
                    refreshAdapters();
                }
                //TODO: Fix this
                //lstAdapters.SelectedIndex = -1;
            };

            messageBox.Show();
        }
开发者ID:Digiex,项目名称:DNSChangerWP7,代码行数:31,代码来源:MainPage.xaml.cs


示例5: CheckForPreviousException

        internal static void CheckForPreviousException(bool isFirstRun)
        {
            try
            {
                string contents = null;
                using (var store = IsolatedStorageFile.GetUserStoreForApplication())
                {
                    if (store.FileExists(filename))
                    {
                        using (TextReader reader = new StreamReader(store.OpenFile(filename, FileMode.Open, FileAccess.Read, FileShare.None)))
                        {
                            contents = reader.ReadToEnd();
                        }
                        SafeDeleteFile(store);
                    }
                }

                if (contents != null)
                {
                    string messageBoxText = null;
                    if (isFirstRun)
                        messageBoxText = "An unhandled error occurred the last time you ran this application. Would you like to send an email to report it?";
                    else
                        messageBoxText = "An unhandled error has just occurred. Would you like to send an email to report it?";

                    CustomMessageBox messageBox = new CustomMessageBox()
                    {
                        Caption = "Error Report",
                        Message = messageBoxText,
                        LeftButtonContent = "yes",
                        RightButtonContent = "no",
                        IsFullScreen = false
                    };

                    messageBox.Dismissed += (s1, e1) =>
                    {
                        switch (e1.Result)
                        {
                            case CustomMessageBoxResult.LeftButton:
                                FeedbackHelper.Default.Feedback(contents, true);

                                SafeDeleteFile(IsolatedStorageFile.GetUserStoreForApplication());

                                break;
                            default:
                                break;
                        }
                    };

                    messageBox.Show();
                }
            }
            catch (Exception)
            {
            }
            finally
            {
                SafeDeleteFile(IsolatedStorageFile.GetUserStoreForApplication());
            }
        }
开发者ID:cglong,项目名称:HackerNews,代码行数:60,代码来源:LittleWatson.cs


示例6: appbar_buttonAdd_Click

        //添加商家
        private void appbar_buttonAdd_Click(object sender, EventArgs e)
        {
            TextBox txtBox = new TextBox();
            CustomMessageBox msgBox = new CustomMessageBox()
            {
                Caption = "添加商家",
                LeftButtonContent = "保存",
                RightButtonContent = "取消",
                Content = txtBox
            };

            msgBox.Dismissing += (s1, e1) =>
            {
                switch (e1.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                        SaveStore(txtBox.Text.Trim());
                        StoreListBox.ItemsSource = Common.GetAllStore();
                        break;
                    case CustomMessageBoxResult.RightButton:
                        break;
                    case CustomMessageBoxResult.None:
                        break;
                    default: break;
                }
            };
            msgBox.Show();
        }
开发者ID:TomHGTang,项目名称:AccountBook,代码行数:29,代码来源:StoreSetting.xaml.cs


示例7: appbar_buttonDelete_Click

        private void appbar_buttonDelete_Click(object sender, EventArgs e)
        {
            CustomMessageBox msgBox = new CustomMessageBox()
            {
                Caption = "删除流水",
                Message = "确定要删除这条流水吗?",
                LeftButtonContent = "确定",
                RightButtonContent = "取消"
            };

            msgBox.Dismissing += (s1, e1) =>
            {
                switch (e1.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                        App.voucherHelper.Remove(item);
                        App.voucherHelper.SaveToFile();
                        //删掉就相当于转回去
                        App.accountHelper.UpdateBalanceTrans(item.Account2, item.Account1, item.Money);
                        App.accountHelper.SaveToFile();
                        NavigationService.GoBack();
                        break;
                    case CustomMessageBoxResult.RightButton:
                        break;
                    case CustomMessageBoxResult.None:
                        break;
                    default: break;
                }
            };
            msgBox.Show();    
        }
开发者ID:TomHGTang,项目名称:AccountBook,代码行数:31,代码来源:Edit3.xaml.cs


示例8: ShowDialogBox

        public void ShowDialogBox(string caption, string message, string leftbuttonContent, string rightButtonContent, Action leftButtonAction, Action rightButtonAction)
        {
            var messagebox = new CustomMessageBox()
            {
                Caption = caption,
                Message = message,
                LeftButtonContent = leftbuttonContent,
                RightButtonContent = rightButtonContent
            };

            messagebox.Dismissed += (s,e) =>
            {
                switch (e.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                        leftButtonAction();
                        break;
                    case CustomMessageBoxResult.RightButton:
                        rightButtonAction();
                        break;
                    case CustomMessageBoxResult.None:
                        break;
                };
            };

            messagebox.Show();
        }
开发者ID:TheAngryByrd,项目名称:MetroPass,代码行数:27,代码来源:DialogService.cs


示例9: MainPage

        public MainPage()
        {
            InitializeComponent();

            messageBox = new CustomMessageBox()
            {
                Message = "Приложение может использовать данные о вашем местоположении для отображения их на карте (эти данные никуда не передаются и не хранятся). Вы можете отключить это в настройках программы.",
                Caption = "Разрешить использовать сведения о местоположении?",
                LeftButtonContent = "Разрешить",
                RightButtonContent = "Запретить",
            };

            messageBox.Dismissed += (s1, e1) =>
            {
                switch (e1.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                        Settings.IsNavigationEnabled = true;
                        break;
                    case CustomMessageBoxResult.RightButton:
                    case CustomMessageBoxResult.None:
                        Settings.IsNavigationEnabled = false;
                        break;
                    default:
                        break;
                }
            };

            this.Loaded += (s, e) =>
            {
                if(!IsolatedStorageSettings.ApplicationSettings.Contains("IsNavigationEnabled"))
                    messageBox.Show();
            };
        }
开发者ID:e-novikov,项目名称:SpbBridge2013,代码行数:34,代码来源:MainPage.xaml.cs


示例10: appbar_buttonAdd_Click

        //添加分类
        private void appbar_buttonAdd_Click(object sender, EventArgs e)
        {
            string kind = pivot.SelectedIndex > 0 ? "收入" : "支出";
            TextBox txtBox = new TextBox();
            CustomMessageBox msgBox = new CustomMessageBox()
            {
                Caption = "添加" + kind + "分类",
                LeftButtonContent = "保存",
                RightButtonContent = "取消",
                Content = txtBox
            };

            msgBox.Dismissing += (s1, e1) =>
            {
                switch(e1.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                        SaveCategory(txtBox.Text.Trim());
                        FreshList();
                        break;
                    case CustomMessageBoxResult.RightButton:
                        break;
                    case CustomMessageBoxResult.None:
                        break;
                    default: break;
                }
            };
            msgBox.Show();
        }
开发者ID:TomHGTang,项目名称:AccountBook,代码行数:30,代码来源:CategorySetting.xaml.cs


示例11: ShowDialogBox

        public Task<bool> ShowDialogBox(string caption, string message, string leftbuttonContent, string rightButtonContent, Func<Task> leftButtonAction, Func<Task> rightButtonAction)
        {
            var messagebox = new CustomMessageBox()
            {
                Caption = caption,
                Message = message,
                LeftButtonContent = leftbuttonContent,
                RightButtonContent = rightButtonContent
            };

            var tcs = new TaskCompletionSource<bool>();
            messagebox.Dismissed += async (s, e) =>
            {
                switch (e.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                         await leftButtonAction();
                        tcs.SetResult(true);
                        break;
                    case CustomMessageBoxResult.RightButton:
                        await rightButtonAction();

                        tcs.SetResult(true);
                        break;
                    case CustomMessageBoxResult.None:

                        tcs.SetResult(false);
                        break;
                };
            };

            messagebox.Show();

            return tcs.Task;
        }
开发者ID:TheAngryByrd,项目名称:ThePaperWallApps,代码行数:35,代码来源:DialogService.cs


示例12: btSelecionarCliente_Click

 private void btSelecionarCliente_Click(object sender, RoutedEventArgs e)
 {
     UCSelecaoCliente ucsc = new UCSelecaoCliente();
     CustomMessageBox cmb = new CustomMessageBox()
     {
         Content = ucsc,
         LeftButtonContent = "Selecionar",
         RightButtonContent = "Cancelar"
     };
     cmb.Dismissing += (s1, e1) =>
     {
         switch (e1.Result)
         {
             case CustomMessageBoxResult.LeftButton:
                 if (ucsc.listClientes.SelectedItem == null)
                     e1.Cancel = true;
                 if (ucsc.listClientes.SelectedItem != null)
                 {
                     novoPedido.IdCliente = (ucsc.listClientes.SelectedItem as Cliente).Id;
                     btSelecionarCliente.Content = (ucsc.listClientes.SelectedItem as Cliente).Nome;
                 }
                 break;
         }
     };
     cmb.Show();
 }
开发者ID:rafaelkds,项目名称:TCCWP,代码行数:26,代码来源:Cadastro.xaml.cs


示例13: ActionSheet

 public override void ActionSheet(ActionSheetConfig config) {
     var sheet = new CustomMessageBox {
         Caption = config.Title,
         IsLeftButtonEnabled = false,
         IsRightButtonEnabled = false
     };
     var list = new ListBox {
         FontSize = 36,
         Margin = new Thickness(12.0),
         SelectionMode = SelectionMode.Single,
         ItemsSource = config.Options
             .Select(x => new TextBlock {
                 Text = x.Text,
                 Margin = new Thickness(0.0, 12.0, 0.0, 12.0),
                 DataContext = x
             })
     };
     list.SelectionChanged += (sender, args) => sheet.Dismiss();
     sheet.Content = list;
     sheet.Dismissed += (sender, args) => {
         var txt = (TextBlock)list.SelectedValue;
         var action = (ActionSheetOption)txt.DataContext;
         if (action.Action != null)
             action.Action();
     };
     this.Dispatch(sheet.Show);
 }
开发者ID:robbie99,项目名称:acr-xamarin-forms,代码行数:27,代码来源:UserDialogService.cs


示例14: BasicMessageBox_Click

        private void BasicMessageBox_Click(object sender, RoutedEventArgs e)
        {
            CustomMessageBox messageBox = new CustomMessageBox()
            {
                Caption = "Pregunta?",
                Message = "Mensaje del CustomMessageBox.",
                LeftButtonContent = "Si",
                RightButtonContent = "No",
                IsFullScreen = (bool)FullScreenCheckBox.IsChecked
            };

            messageBox.Dismissed += (s1, e1) =>
            {
                switch (e1.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                        // Acción.
                        break;
                    case CustomMessageBoxResult.RightButton:
                        // Acción.
                        break;
                    case CustomMessageBoxResult.None:
                        // Acción.
                        break;
                    default:
                        break;
                }
            };

            messageBox.Show();
        }
开发者ID:rwecho,项目名称:Windows-Phone-Samples,代码行数:31,代码来源:MainPage.xaml.cs


示例15: Accept

		/// <summary>
		/// Makes sure a message box is managed by this manager.
		/// </summary>
		/// <param name="wmb"></param>
		private CustomMessageBox Accept(WF.Player.Core.MessageBox wmb)
		{
			CustomMessageBox cmb = null;
			
			// Checks if this instance already manages this message box.
			// If not, starts to manage the box.
			KeyValuePair<CustomMessageBox, WF.Player.Core.MessageBox> pair = _WherigoMessageBoxes.SingleOrDefault(kv => kv.Value == wmb);
			if (pair.Value == wmb)
			{
				// The target message box exists already.
				cmb = pair.Key;
			}
			else
			{
				// Creates a target message box.
				cmb = new CustomMessageBox()
				{
					Caption = App.Current.Model.Core.Cartridge.Name,
					//Message = wmb.Text,
					Content = new Controls.WherigoMessageBoxContentControl() { MessageBox = wmb },
					LeftButtonContent = wmb.FirstButtonLabel ?? "OK",
					RightButtonContent = wmb.SecondButtonLabel
				};

				// Registers events.
				RegisterEventHandlers(cmb);

				// Adds the pair to the dictionary.
				_WherigoMessageBoxes.Add(cmb, wmb);
			}

			return cmb;
		}
开发者ID:kamaelyoung,项目名称:WF.Player.WinPhone,代码行数:37,代码来源:MessageBoxManager.cs


示例16: CreateTaskList_Click

        void CreateTaskList_Click(object sender, EventArgs e)
        {
            CustomMessageBox messageBox = new CustomMessageBox()
            {
                Caption = "Create tasklist?",
                Message = "Give a name of a new list.",
                LeftButtonContent = "OK",
                RightButtonContent = "Cancel",
                ContentTemplate = (DataTemplate)Resources["CreateTaskListContentTemplate"]
            };

            messageBox.Dismissed += (s1, e1) =>
                {
                    switch (e1.Result)
                    {
                        case CustomMessageBoxResult.LeftButton:
                        {
                            if (_vm.CreateTaskListCommand.CanExecute(null))
                            {
                                _vm.CreateTaskListCommand.Execute(null);
                            }
                            break;
                        }
                    }
                };
            messageBox.Show();
        }
开发者ID:roosi,项目名称:done,代码行数:27,代码来源:MainPage.xaml.cs


示例17: Use_Zip_Code

        private void Use_Zip_Code(object sender, System.Windows.RoutedEventArgs e)
        {
            TextBox textBox = new TextBox();
            // restrict input to digits:
            InputScope inputScope = new InputScope();
            InputScopeName inputScopeName = new InputScopeName();
            inputScopeName.NameValue = InputScopeNameValue.Digits;
            inputScope.Names.Add(inputScopeName);
            textBox.InputScope = inputScope;

            CustomMessageBox messageBox = new CustomMessageBox()
            {
                Message = "Enter your US zip code:",
                LeftButtonContent = "okay",
                RightButtonContent = "cancel",
                Content = textBox
            };
            messageBox.Loaded += (a, b) =>
            {
                textBox.Focus();
            };
            messageBox.Show();
            messageBox.Dismissed += (s, args) =>
            {
                if (args.Result == CustomMessageBoxResult.LeftButton)
                {
                    if (textBox.Text.Length >= 5)
                    {
                        geocodeUsingString(textBox.Text);
                    }
                }
            };
        }
开发者ID:nate-parrott,项目名称:weatherping,代码行数:33,代码来源:Location.xaml.cs


示例18: BasicMessageBox_Click

        /// <summary>
        /// Displays a CustomMessageBox with no content.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event information.</param>
        private void BasicMessageBox_Click(object sender, RoutedEventArgs e)
        {
            CustomMessageBox messageBox = new CustomMessageBox()
            {                
                Caption = "Do you like this sample?",
                Message = "There are tons of things you can do using custom message boxes. To learn more, be sure to check out the source code at Codeplex.",
                LeftButtonContent = "yes",
                RightButtonContent = "no",
                IsFullScreen = (bool)FullScreenCheckBox.IsChecked
            };

            messageBox.Dismissed += (s1, e1) =>
                {
                    switch (e1.Result)
                    {
                        case CustomMessageBoxResult.LeftButton:
                            // Do something.
                            break;
                        case CustomMessageBoxResult.RightButton:
                            // Do something.
                            break;
                        case CustomMessageBoxResult.None:
                            // Do something.
                            break;
                        default:
                            break;
                    }
                };

            messageBox.Show();
        }
开发者ID:sanjayasl,项目名称:WPtoolkit,代码行数:36,代码来源:CustomMessageBoxSample.xaml.cs


示例19: msgBuy

        public static void msgBuy()
        {
            CustomMessageBox messageBox = new CustomMessageBox()
            {
                Caption = "Хотите приобрести расширенную версию?",
                Message = "Функции: словарь, озвучка слов и аудиролвание предоставляются только в расширенной версии приложения. Хотите приобрести (цена: 34 руб.)? Покупая расширенную версию, Вы поддерживаете дальнейшее создание уроков.",
                LeftButtonContent = "нет",
                RightButtonContent = "да",
                IsFullScreen = false
            };

            messageBox.Dismissed += (s1, e1) =>
            {
                switch (e1.Result)
                {
                    case CustomMessageBoxResult.LeftButton:
                        // Do something.
                        break;
                    case CustomMessageBoxResult.RightButton:
                        BuyPro();
                        break;
                    case CustomMessageBoxResult.None:
                        // Do something.
                        break;
                    default:
                        break;
                }
            };

            messageBox.Show();
        }
开发者ID:Malanin,项目名称:EnglishWithFriends,代码行数:31,代码来源:ProManager.cs


示例20: Prompt

 public void Prompt(string message, string title, Action<string> onPrompt, Action onCancel = null)
 {
     var textBox = new TextBox();
     var messageBox = new CustomMessageBox()
     {
         Caption = title,
         LeftButtonContent = "Подтвердить",
         RightButtonContent = "Отмена",
         Message = message,
         Content = textBox
     };
     messageBox.Dismissed += (sender, args) =>
     {
         switch (args.Result)
         {
             case CustomMessageBoxResult.LeftButton:
                 onPrompt(textBox.Text);
                 // Do something.
                 break;
             case CustomMessageBoxResult.RightButton:
                 // Do something.
                 if (onCancel != null) onCancel();
                 break;
             case CustomMessageBoxResult.None:
                 // Do something.
                 if (onCancel != null) onCancel();
                 break;
             default:
                 if (onCancel != null) onCancel();
                 break;
         }
     };
     messageBox.Show();
 }
开发者ID:raveclassic,项目名称:icontowp8,代码行数:34,代码来源:BasePage.cs



注:本文中的CustomMessageBox类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CustomModifiers类代码示例发布时间:2022-05-24
下一篇:
C# CustomList类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap