コード例 #1
0
        public override bool execute(CommandInterface ci)
        {
            Form pf = parent;
            if (parent == null)
                pf = MainProgram.theApplication.getAnchorForm();

            QuestionDialog qd = new QuestionDialog();
            qd.modalPost(pf, dialogQuestion, dialogTitle,
                this, ok_Click, null, null, null, null,
                null, 2);

            return false;
        }
コード例 #2
0
        /// <summary>
        /// Overrides the supperclass execute() function:
        /// First posts a dialog to ask for user confirmation before
        /// actually executing the command.
        /// </summary>
        /// <param name="ci"></param>
        /// <returns></returns>
        public override bool execute(CommandInterface ci)
        {
            this.ci = ci;

            Form fp = parent;
            if (fp == null)
                fp = MainProgram.theApplication.getAnchorForm();

            QuestionDialog qd = new QuestionDialog();
            qd.modalPost(parent, dialogQuestion, dialogTitle, this,
                yes_Click, no_Click, cancel_Click, "Yes", "No", "Cancel", 3);

            return false;
        }
コード例 #3
0
        public override bool doIt(CommandInterface ci)
        {
            String message = "Do you want to save macro " + md.getNetwork().NameString;
            message += " as file: " + md.FileName;

            QuestionDialog qd = new QuestionDialog();
            qd.modalPost(
                DXApplication.theDXApplication.getAnchor(),
                message, "Save Confirmation",
                this,
                SaveMacro,
                DiscardMacro,
                null, "Yes", "No", null, 2);

            return true;
        }
コード例 #4
0
        public int connectToServer(int port, DXChild c)
        {
            bool wasQueued = false;
            String server;

            if (c != null)
            {
                server = c.getServer();
                if (!c.IsQueued)
                {
                    serverInfo.children.Remove(c);
                    c.unQueue();
                }
            }
            else
            {
                server = serverInfo.server;
            }
            DXPacketIF p = new DXPacketIF(server, port, DXChild.HostIsLocal(server));
            if (DXApplication.resource.debugMode)
                p.setEchoCallback(DXApplication.DebugEchoCallback, "need to get stderr");

            if (p.Error)
            {
                ErrorDialog ed = new ErrorDialog();
                ed.post("Connection to {0} failed.", server);
                p = null;
                return 0;
            }

            clearErrorList();
            if (serverInfo.packet == null)
            {
                if (wasQueued)
                {
                    InfoDialog id = new InfoDialog();
                    id.post("Your connection to {0} has been accepted.", server);
                }
                packetIFAccept(p);
            }
            else
            {
                serverInfo.queuedPackets.Insert(0, p);
                QuestionDialog qd = new QuestionDialog();
                String s = String.Format("Your connection to server {0} has been accepted. Do you want to disconnect from {0} and connect to it?",
                    server, serverInfo.server);
                qd.modalPost(this.getAnchorForm(), s, null, p, DXApplication.QueuedPacketAccept,
                    DXApplication.QueuedPacketCancel, null, "Yes", "No", null, 2);

            }
            return 1;
        }