Ejemplo n.º 1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        protected bool OnMainViewOpened(object args)
        {
            try
            {
                if (args is PaMainWnd)
                {
                    m_adapter = PaApp.TMAdapter;

                    m_adapter.AddCommandItem("CmdBackupProject", "BackupProject",
                                             Properties.Resources.kstidBackupMenuText, null, null, null, null,
                                             null, Keys.None, null, Properties.Resources.kimidBackup);

                    m_adapter.AddCommandItem("CmdRestoreProject", "RestoreProject",
                                             Properties.Resources.kstidRestoreMenuText, null, null, null, null,
                                             null, Keys.None, null, null);

                    TMItemProperties itemProps = new TMItemProperties();
                    itemProps.CommandId = "CmdBackupProject";
                    itemProps.Name      = "mnuBackupProject";
                    itemProps.Text      = null;
                    m_adapter.AddMenuItem(itemProps, "mnuFile", "mnuPlayback");

                    itemProps           = new TMItemProperties();
                    itemProps.CommandId = "CmdRestoreProject";
                    itemProps.Name      = "mnuRestoreProject";
                    itemProps.Text      = null;
                    m_adapter.AddMenuItem(itemProps, "mnuFile", "mnuPlayback");

                    AddOnHelper.AddSeparatorBeforeMenuItem("mnuPlayback");
                }
            }
            catch { }

            return(false);
        }
Ejemplo n.º 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);
        }
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        private void SetupFilterMenu()
        {
            try
            {
                if (m_adapter == null)
                {
                    return;
                }

                m_adapter.AddCommandItem("CmdFilters", "DisplayFilterDlg",
                                         Properties.Resources.kstidFiltersMenuText, null, null, null, null,
                                         null, Keys.None, null, Properties.Resources.kimidDefineFilters);

                TMItemProperties itemProps = new TMItemProperties();
                itemProps.CommandId = "CmdFilters";
                itemProps.Name      = "mnuFilters";
                itemProps.Text      = null;
                m_adapter.AddMenuItem(itemProps, "mnuFile", "mnuUndefinedCharacters");
            }
            catch { }
        }