Esempio n. 1
0
        public void compiledNewest()
        {
            // Ensure we are actually running the expected version. But what
            // is actually our intent here? Why do we have this test?

            string presumedNewest = "1.1.49a3";

            {
                // For the main application
                string version_mainApplication =
                    EditorOverflowApplication.versionString();

                Assert.AreEqual(presumedNewest, version_mainApplication, "XYZ");
            }
        } //compiledNewest
Esempio n. 2
0
        //****************************************************************************
        //*    <placeholder for header>                                              *
        //****************************************************************************
        private void generate()
        {
            updateOutputs();

            string toClipboard = "";

            if (rbnClipboardDontChange.Checked)
            {
                toClipboard = "";
            }

            //Short inline form. Example:
            //
            //
            //
            if (rbnClipboardShort.Checked)
            {
                toClipboard        = txtShortMarkdown_text.Text;
                this.ActiveControl = txtShortMarkdown_reference; //Note: not the
                //  same as where the clipboard content comes from. This is to
                //  get ready for copying the reference section (by the user).
            }

            if (rbnClipboardInline.Checked)
            {
                toClipboard        = txtInlineMarkdown.Text;
                this.ActiveControl = txtInlineMarkdown; //Change focus, to be
                //  consistent with the behaviour for the short form (above).
            }

            if (rbnClipboardHTML.Checked)
            {
                toClipboard        = txtHTML.Text;
                this.ActiveControl = txtHTML; //Change focus, to be
                //  consistent with the behaviour for the short form (above).
            }

            if (toClipboard != "")
            {
                ////toClipboard = "\n" + toClipboard + "\n";
                //System.Windows.Forms.Clipboard.SetText(toClipboard);

                EditorOverflowApplication.setClipboard3(toClipboard, null);

                //Later: add clipboard retry info to GUI (e.g. by reusing
                //       something.
            }
        } //generate()
        //****************************************************************************
        //*    <placeholder for header>                                              *
        //****************************************************************************
        public frmMarkdown(string aTerm,
                           string aURL,
                           LinkRef aLinkRefGenerator,
                           EditorOverflowApplication anApplication)
        {
            InitializeComponent();

            mTerm2 = aTerm;
            mURL2  = aURL;

            mLinkRefGenerator = aLinkRefGenerator;

            mApplication = anApplication;


            mURLparseInfo = new Dictionary <string, URLparseInfoStruct>(2);
            addURLparseInfo("wikipedia.org/wiki", "wikipedia:");
            addURLparseInfo("wiktionary.org/wiki", "wiktionary:");
        }
Esempio n. 4
0
        //****************************************************************************
        //*    <placeholder for header>                                              *
        //****************************************************************************
        public frmRandomFileOpen(EditorOverflowApplication anApplication)
        {
            InitializeComponent();

            mApplication = anApplication;
        }
Esempio n. 5
0
        }         //keepHardDiskDrivesAlive()

        /****************************************************************************
        *    <placeholder for header>                                              *
        ****************************************************************************/
        private void MyTimer_Tick(object aSender, EventArgs anEvent)
        {
            mCountDown--;

            double timeLeftSecs = TIMERINTERVAL_SECS * mCountDown;
            double timeLeftMins = timeLeftSecs * 0.016666666;


            //For now: direct write back to a user interface element provided
            //         by the client. But this creates tight coupling. A better
            //         way could be to send an event and let the client
            //         handle it (if it choses to.)
            //
            ////lblTimeLeft.Text = timeLeftMins.ToString("0.00") + " secs";
            //lblTimeLeft.Text = timeLeftMins.ToString("0.00") + " mins";
            mLabelForTimeOutput.Text = timeLeftMins.ToString("0.00") + " mins";

            //Send event (e.g. to the main form) that something interesting
            //happend. E.g. in order to update the screeen.

            if (mCountDown == 0)
            {
                //mCountDown = EDITCOUNTDOWN; No, we no longer restart. Instead
                //  wait for the user to reset timer.

                //mPlayer.PlaySync();
                //mPlayer.PlaySync();
                //mPlayer.PlaySync();
                //mPlayer.PlaySync();
                //mPlayer.PlaySync();

                //mPlayer.PlaySync();
                //mPlayer.PlaySync();
                //mPlayer.PlaySync();
                //mPlayer.PlaySync();
                //mPlayer.PlaySync();

                bool useSpeech = false;

                string speechLoc = "D:\\temp2\\MetteEditereMono.wav";
                if (File.Exists(speechLoc))
                {
                    try
                    {
                        //mPlayer.SoundLocation = "file://D/temp2/MetteEditere.wav";
                        mPlayer.SoundLocation = speechLoc;
                        //mPlayer.Load();
                        mPlayer.Play();
                        useSpeech = true;
                    }
                    catch (Exception exceptionObject)
                    {
                        //Use something else than speech to get attention.
                    }
                    finally
                    {
                        //Clean up.
                    }
                }
                else
                {
                    //Use something else than speech to get attention.
                }

                if (!useSpeech)
                {
                    string msg = "Time is up!";
                    System.Windows.Forms.MessageBox.Show(
                        msg,
                        EditorOverflowApplication.applicationName());
                }
            }

            if (mCountDown < 0)
            {
                //We are waiting for user reset...

                const int MINUS_LIMIT = -3000;
                if (mCountDown < MINUS_LIMIT) //Limit to about -1 hours
                {
                    mCountDown = MINUS_LIMIT;
                }
            }


            mDividerForHDD_KeepAlive--;
            if (mDividerForHDD_KeepAlive == 0)
            {
                keepHardDiskDrivesAlive();

                mDividerForHDD_KeepAlive = kDividerForHDD_KeepAlive;
            }
        } //MyTimer_Tick()
Esempio n. 6
0
        //****************************************************************************
        //*    <placeholder for header>                                              *
        //****************************************************************************
        private void btnCopyToClipboard_Click(object aSender, EventArgs anEvent)
        {
            string currentFile = txtCurrentFile.Text;

            EditorOverflowApplication.setClipboard3(currentFile, null);
        }