コード例 #1
0
ファイル: MenuWidget.cs プロジェクト: RAOF/smuxi
        protected void OnConnectActionActivated(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            try {
                var dialog = new QuickConnectDialog(Parent);
                dialog.Load();
                int res    = dialog.Run();
                var server = dialog.Server;
                dialog.Destroy();
                if (res != (int)Gtk.ResponseType.Ok)
                {
                    return;
                }
                if (server == null)
                {
#if LOG4NET
                    f_Logger.Error("OnServerConnectButtonClicked(): server is null!");
                    return;
#endif
                }

                // do connect as background task as it might take a while
                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        Frontend.Session.Connect(server, Frontend.FrontendManager);
                    } catch (Exception ex) {
                        Frontend.ShowException(Parent, ex);
                    }
                });
            } catch (Exception ex) {
                Frontend.ShowException(Parent, ex);
            }
        }
コード例 #2
0
        protected void OnConnectActionActivated(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            try {
                var dialog = new QuickConnectDialog(Parent);
                dialog.Load();
                int res    = dialog.Run();
                var server = dialog.Server;
                dialog.Destroy();
                if (res != (int)Gtk.ResponseType.Ok)
                {
                    return;
                }
                if (server == null)
                {
#if LOG4NET
                    f_Logger.Error("OnServerConnectButtonClicked(): server is null!");
                    return;
#endif
                }

                // do connect as background task as it might take a while
                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        if (Frontend.EngineProtocolVersion < new Version(0, 8, 11))
                        {
                            // HACK: Smuxi < 0.8.11 used auto serialization for
                            // ServerModel and thus breaks on unknown fields,
                            // which we skip by setting this to null, see:
                            // ServerModel.GetObjectData()
                            server.ServerID = null;
                            server.Nickname = null;
                            server.Realname = null;
                            server.ClientCertificateFilename = null;
                        }
                        Frontend.Session.Connect(server, Frontend.FrontendManager);
                    } catch (Exception ex) {
                        Frontend.ShowException(Parent, ex);
                    }
                });
            } catch (Exception ex) {
                Frontend.ShowException(Parent, ex);
            }
        }
コード例 #3
0
ファイル: MenuWidget.cs プロジェクト: vith/smuxi
        protected void OnConnectActionActivated(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            try {
                var dialog = new QuickConnectDialog(Parent);
                dialog.Load();
                int res = dialog.Run();
                var server = dialog.Server;
                dialog.Destroy();
                if (res != (int) Gtk.ResponseType.Ok) {
                    return;
                }
                if (server == null) {
            #if LOG4NET
                    f_Logger.Error("OnServerConnectButtonClicked(): server is null!");
                    return;
            #endif
                }

                // do connect as background task as it might take a while
                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        Frontend.Session.Connect(server, Frontend.FrontendManager);
                    } catch (Exception ex) {
                        Frontend.ShowException(Parent, ex);
                    }
                });
            } catch (Exception ex) {
                Frontend.ShowException(Parent, ex);
            }
        }
コード例 #4
0
ファイル: MenuWidget.cs プロジェクト: Jaykul/smuxi
        protected void OnConnectActionActivated(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            try {
                var dialog = new QuickConnectDialog(Parent);
                dialog.Load();
                int res = dialog.Run();
                var server = dialog.Server;
                dialog.Destroy();
                if (res != (int) Gtk.ResponseType.Ok) {
                    return;
                }
                if (server == null) {
            #if LOG4NET
                    f_Logger.Error("OnServerConnectButtonClicked(): server is null!");
                    return;
            #endif
                }

                // do connect as background task as it might take a while
                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        if (Frontend.EngineVersion < new Version(0, 8, 11)) {
                            // HACK: Smuxi < 0.8.11 used auto serialization for
                            // ServerModel and thus breaks on unknown fields,
                            // which we skip by setting this to null, see:
                            // ServerModel.GetObjectData()
                            server.ServerID = null;
                            server.Nickname = null;
                            server.Realname = null;
                        }
                        Frontend.Session.Connect(server, Frontend.FrontendManager);
                    } catch (Exception ex) {
                        Frontend.ShowException(Parent, ex);
                    }
                });
            } catch (Exception ex) {
                Frontend.ShowException(Parent, ex);
            }
        }