/// ------------------------------------------------------------------------------------
 private void HandleFilterStatusStripLabelPaint(object sender, PaintEventArgs e)
 {
     if (App.Project != null && App.Project.CurrentFilter != null)
     {
         PaMainWnd.PaintFilterStatusStripLabel(sender as ToolStripStatusLabel,
                                               App.Project.CurrentFilter.Name, e);
     }
 }
예제 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected bool OnMainViewOpened(object args)
        {
            try
            {
                if (args is PaMainWnd)
                {
                    m_mainWnd = args as PaMainWnd;
                    m_adapter = PaApp.TMAdapter;

                    m_adapter.AddCommandItem("CmdSendFeedback", "SendFeedback",
                                             Properties.Resources.kstidFeedbackMenuText, null, null, null, null,
                                             null, Keys.None, null, Properties.Resources.kimidSendFeedback);

                    m_feedbackItemProps            = new TMItemProperties();
                    m_feedbackItemProps.BeginGroup = true;
                    m_feedbackItemProps.CommandId  = "CmdSendFeedback";
                    m_feedbackItemProps.Name       = "mnuSendFeedback";
                    m_feedbackItemProps.Text       = null;
                    m_adapter.AddMenuItem(m_feedbackItemProps, "mnuHelp", "mnuHelpAbout");

                    // Get the number of times PA has been launched.
                    int launchCount = PaApp.SettingsHandler.GetIntSettingsValue(
                        "feedbackaddon", "launchcount", 0);

                    // Increase the launch count by one and save it.
                    PaApp.SettingsHandler.SaveSettingsValue(
                        "feedbackaddon", "launchcount", ++launchCount);

                    // If we've reached the tenth time PA has been run, then show
                    // the user the dialog requesting feedback.
                    if (launchCount == 10)
                    {
                        using (RequestDlg dlg = new RequestDlg())
                        {
                            if (dlg.ShowDialog(m_mainWnd) == DialogResult.Yes)
                            {
                                OnSendFeedback(null);
                            }
                        }
                    }
                }
            }
            catch { }

            return(false);
        }
예제 #3
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Ask the user if he would like to load the project just restored. If yes, then
 /// load it.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 private void LoadRestoredProject()
 {
     if (File.Exists(m_papPath))
     {
         string msg = Properties.Resources.kstidLoadPrjMsg;
         msg = msg.Replace("\\n", "\n");
         if (MessageBox.Show(msg, Application.ProductName,
                             MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             PaMainWnd mainWnd = PaApp.MainForm as PaMainWnd;
             if (mainWnd != null)
             {
                 ReflectionHelper.CallMethod(mainWnd, "LoadProject", m_papPath);
             }
         }
     }
 }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected bool OnViewOpened(object args)
        {
            try
            {
                if (args.GetType() == typeof(PaMainWnd))
                {
                    m_mainWnd = args as PaMainWnd;
                }
                else if (args.GetType() == typeof(DataCorpusVw))
                {
                    m_dataCorpusVw = args as DataCorpusVw;
                }
                else if (args.GetType() == typeof(SearchVw))
                {
                    m_findPhoneWnd = args as SearchVw;
                }
                else if (args.GetType() == typeof(ConsonantChartVw))
                {
                    m_consonantChartWnd = args as ConsonantChartVw;
                }
                else if (args.GetType() == typeof(VowelChartVw))
                {
                    m_vowelChartWnd = args as VowelChartVw;
                }
                else if (args.GetType() == typeof(XYChartVw))
                {
                    m_xyChartWnd = args as XYChartVw;
                }
                else if (args.GetType() == typeof(PhoneInventoryVw))
                {
                    m_phoneInventoryWnd = args as PhoneInventoryVw;
                }
            }
            catch { }

            return(false);
        }