Пример #1
0
        private void OnLaunchAction(object sender, EventArgs e)
        {
            IWeSayAddin addin = (IWeSayAddin)sender;

            try
            {
                addin.Launch(ParentForm,

                             //working on fixing ws-1026, found that creating this repository just locked the
                             //file, and no existing actions appear to need it anyhow
                             WeSayWordsProject.Project.GetProjectInfoForAddin());

//                using (
//                        LexEntryRepository lexEntryRepository =
//                                new LexEntryRepository(WeSayWordsProject.Project.PathToRepository))
//                {
//                    addin.Launch(ParentForm,
//                                 WeSayWordsProject.Project.GetProjectInfoForAddin(lexEntryRepository));
//                }
            }
            catch (Exception error)
            {
                ErrorReport.NotifyUserOfProblem(error.Message);
            }
        }
Пример #2
0
        private void OnButtonClick(object sender, EventArgs e)
        {
            DashboardButton b    = (DashboardButton)sender;
            ITask           task = b.ThingToShowOnDashboard as ITask;

            if (task != null && _currentWorkTaskProvider != null)
            {
                _currentWorkTaskProvider.SetActiveTask(task);
            }
            else
            {
                IWeSayAddin addin = b.ThingToShowOnDashboard as IWeSayAddin;
                if (addin != null)
                {
                    Cursor.Current = Cursors.WaitCursor;

                    try
                    {
                        ProjectInfo projectInfo =
                            WeSayWordsProject.Project.GetProjectInfoForAddin();
                        UsageReporter.SendNavigationNotice(addin.ID);
                        addin.Launch(ParentForm, projectInfo);
                    }
                    catch (Exception error)
                    {
                        ErrorReport.NotifyUserOfProblem(error.Message);
                    }

                    Cursor.Current = Cursors.Default;
                }
            }
        }