当前位置: 首页>>代码示例>>C#>>正文


C# CustomMessageBox类代码示例

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


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


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