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


C# MessageDialog.Dispose方法代码示例

本文整理汇总了C#中MessageDialog.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# MessageDialog.Dispose方法的具体用法?C# MessageDialog.Dispose怎么用?C# MessageDialog.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessageDialog的用法示例。


在下文中一共展示了MessageDialog.Dispose方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnBtnGenerateClicked

    protected void OnBtnGenerateClicked(object sender, EventArgs e)
    {
        try {
            BarcodeLib.Barcode codeBar = new BarcodeLib.Barcode ();
            codeBar.Alignment = BarcodeLib.AlignmentPositions.CENTER;
            codeBar.IncludeLabel = true;
            codeBar.LabelPosition = BarcodeLib.LabelPositions.BOTTOMCENTER;

            BarcodeLib.TYPE bCodeType = (BarcodeLib.TYPE)Enum.Parse (typeof(BarcodeLib.TYPE), cmbBarCodeType.ActiveText.ToString ());
            System.Drawing.Image imgTmpCodeBar = codeBar.Encode (bCodeType, txtData.Text.Trim (), System.Drawing.Color.Black, System.Drawing.Color.White, 300, 300);

            MemoryStream memoryStream = new MemoryStream();
            imgTmpCodeBar.Save(memoryStream, ImageFormat.Png);
            Gdk.Pixbuf pb = new Gdk.Pixbuf (memoryStream.ToArray());

            imgCodeBar.Pixbuf = pb;

        } catch (Exception err) {
            MessageDialog dlg = new MessageDialog (this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, string.Format ("Ocurrió un error \n {0}", err.Message));
            dlg.Run ();
            dlg.Destroy ();
            dlg.Dispose ();
            dlg = null;
        }
    }
开发者ID:xmalmorthen,项目名称:monoCodeBarGenerator,代码行数:25,代码来源:MainWindow.cs

示例2: AskForConfirmation

            private static bool AskForConfirmation(Window win,
								string text)
            {
                MessageDialog md = new MessageDialog (win,
                                      DialogFlags.
                                      DestroyWithParent,
                                      MessageType.
                                      Question,
                                      ButtonsType.
                                      YesNo,
                                      String.
                                      Format
                                      ("<b>{0}</b>",
                                       text));

                int res = md.Run ();
                md.Hide ();
                md.Dispose ();
                return res == (int) ResponseType.Yes;
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:20,代码来源:PlayerPage.cs

示例3: ShowChallengeDialog

            private void ShowChallengeDialog(MatchChallenge mc)
            {
                StringBuilder buf = new StringBuilder ();
                string rating;

                if (mc.OpponentsRating != 0)
                    rating = mc.OpponentsRating.
                        ToString ();
                else
                    rating = "----";
                buf.Append (String.
                        Format
                        ("<big><b>{0} ({1}) wants to play a {2} game</b></big>\n",
                         mc.Opponent, rating,
                         mc.Category));
                buf.Append (String.
                        Format
                        ("<b><u>Time:</u> {0} </b><i>mins</i>, <b><u>Increment:</u></b> {1}\n",
                         mc.Time, mc.Increment));
                if (mc.Color != null)
                    buf.Append (String.
                            Format
                            ("\n<b><u>Color:</u></b> {0}\n",
                             mc.Color));

                buf.Append
                    ("\n\n<b>Do you want to play?</b>");

                MessageDialog dlg = new MessageDialog (null,
                                       DialogFlags.
                                       Modal,
                                       MessageType.
                                       Question,
                                       ButtonsType.
                                       YesNo,
                                       true,
                                       buf.
                                       ToString
                                       ());
                dlg.Modal = false;
                dlg.GrabFocus ();
                int ret = dlg.Run ();
                if (ret == (int) ResponseType.Yes)
                    client.CommandSender.
                        SendCommand ("accept");
                else if (ret == (int) ResponseType.No)
                    client.CommandSender.
                        SendCommand ("decline");
                dlg.Hide ();
                dlg.Dispose ();
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:51,代码来源:ICSDetailsWidget.cs

示例4: OnConnectionError

            private void OnConnectionError(object o,
							string reason)
            {
                client.Stop ();
                // show error
                MessageDialog md = new MessageDialog (null,
                                      DialogFlags.
                                      DestroyWithParent,
                                      MessageType.
                                      Error,
                                      ButtonsType.
                                      Close,
                                      String.
                                      Format
                                      ("<b>{0}</b>",
                                       reason));

                md.Run ();
                md.Hide ();
                md.Dispose ();

                menubar.disconnectMenuItem.Sensitive = false;
                menubar.connectMenuItem.Sensitive = true;
                //configwidget.Sensitive = true;
                //Authenticate ();
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:26,代码来源:ICSDetailsWidget.cs

示例5: OnGameMessage

            private void OnGameMessage(object o, string user,
						    GameMessageType type)
            {
                string msg;
                switch (type)
                  {
                  case GameMessageType.Draw:
                      msg = "<big><b>{0} offers a draw</b>.\nDo you want to agree?</big>";
                      break;
                  case GameMessageType.Abort:
                      msg = "<big><b>{0} wants to abort the game</b>.\nDo you want to agree?</big>";
                      break;
                  default:
                      return;
                  }
                MessageDialog dlg = new MessageDialog (null,
                                       DialogFlags.
                                       Modal,
                                       MessageType.
                                       Question,
                                       ButtonsType.
                                       YesNo,
                                       true,
                                       msg,
                                       user);
                dlg.Modal = false;
                int ret = dlg.Run ();
                if (ret == (int) ResponseType.Yes)
                    client.CommandSender.
                        SendCommand ("accept " +
                                 user);
                else if (ret == (int) ResponseType.No)
                    client.CommandSender.
                        SendCommand ("decline " +
                                 user);
                dlg.Hide ();
                dlg.Dispose ();
            }
开发者ID:BackupTheBerlios,项目名称:csboard-svn,代码行数:38,代码来源:ICSGameObserverWidget.cs


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