Exemplo n.º 1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Make one.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="app">The app.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// <param name="makeRootAutomatically">if set to <c>true</c> [make root automatically].</param>
		/// <param name="filterInstance">The filter instance.</param>
		/// ------------------------------------------------------------------------------------
		public VerticalDraftView(FdoCache cache, IApp app, IHelpTopicProvider helpTopicProvider,
			bool makeRootAutomatically, int filterInstance)
			: base(cache, filterInstance, app, "vertical draft view", true, false,
			makeRootAutomatically, TeViewType.VerticalView, -1, helpTopicProvider)
		{
			AutoScroll = true;
		}
Exemplo n.º 2
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="EmptyScripture"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public EmptyScripture(ITMAdapter adapter, FdoCache fdoCache, IHelpTopicProvider helpTopicProvider)
		{
			InitializeComponent();

			m_helpTopicProvider = helpTopicProvider;

			if (adapter == null || adapter.MessageMediator == null)
				btnBook.Enabled = false;
			else
			{
				m_tmAdapter = adapter;

				// Save the adapter's message mediator so it can be restored when the
				// dialog closes.
				m_savMsgMediator = adapter.MessageMediator;

				// Create a new mediator for this dialog and set
				// the adapter's mediator to it.
				Mediator mediator = new Mediator();
				mediator.AddColleague(this);
				m_tmAdapter.MessageMediator = mediator;
			}

			string projectName = fdoCache.ProjectId.Name;
			lblTopLabel.Text = string.Format(lblTopLabel.Text,projectName);
		}
Exemplo n.º 3
0
		internal AdvancedMTDialog(FdoCache cache, bool fPrepose, CChartSentenceElements ccSentElem, IHelpTopicProvider helpTopicProvidor)
		{
			InitializeComponent();

			SuspendLayout();

			m_helpTopicProvider = helpTopicProvidor;
			if (m_helpTopicProvider != null)
			{
				helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
				helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
				helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
				helpProvider.SetShowHelp(this, true);
			}
			m_AMTDLogic = new AdvancedMTDialogLogic(cache, fPrepose, ccSentElem);
			m_bottomStuff.SuspendLayout();
			m_bottomStuff.Controls.AddRange(new Control[] { m_AMTDLogic.DlgRibbon });

			m_bottomStuff.ResumeLayout();

			// Setup localized dialog
			SetCaption(fPrepose ? DiscourseStrings.ksAdvDlgPreposeCaption : DiscourseStrings.ksAdvDlgPostposeCaption);
			SetMainText(fPrepose ? DiscourseStrings.ksAdvDlgMainPreText : DiscourseStrings.ksAdvDlgMainPostText);
			SetPartialText(fPrepose ? DiscourseStrings.ksAdvDlgPartialPre : DiscourseStrings.ksAdvDlgPartialPost);

			ResumeLayout();

			InitLogicAndDialog();
		}
Exemplo n.º 4
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Show a help topic.
		/// </summary>
		/// <param name="helpTopicProvider"></param>
		/// <param name="helpFileKey">string key to get the help file name</param>
		/// <param name="helpTopicKey">string key to get the help topic</param>
		/// ------------------------------------------------------------------------------------
		public static void ShowHelpTopic(IHelpTopicProvider helpTopicProvider, string helpFileKey,
			string helpTopicKey)
		{
			string helpFile;

			// sanity check
			if (helpTopicProvider == null || helpFileKey == null || helpTopicKey == null ||
				string.Empty.Equals(helpFileKey) || string.Empty.Equals(helpTopicKey))
				return;

			// try to get a path to the help file.
			try
			{
				helpFile = FwDirectoryFinder.CodeDirectory +
					helpTopicProvider.GetHelpString(helpFileKey);
			}
			catch
			{
				MessageBox.Show(FwUtilsStrings.ksCannotFindHelp);
				return;
			}

			// try to get a topic to show
			string helpTopic = helpTopicProvider.GetHelpString(helpTopicKey);

			if (string.IsNullOrEmpty(helpTopic))
			{
				MessageBox.Show(String.Format(FwUtilsStrings.ksNoHelpTopicX, helpTopicKey));
				return;
			}

			// Show the help. We have to use a label because without it the help is always on top of the window
			Help.ShowHelp(new Label(), helpFile, helpTopic);
		}
		/// <summary>
		/// Shows the new writing system properties dialog.
		/// </summary>
		/// <param name="owner">The owner.</param>
		/// <param name="cache">The cache.</param>
		/// <param name="wsManager">The ws manager.</param>
		/// <param name="wsContainer">The ws container.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// <param name="app">The app.</param>
		/// <param name="stylesheet">The stylesheet.</param>
		/// <param name="displayRelatedWss">if set to <c>true</c> related writing systems will be displayed.</param>
		/// <param name="defaultName">The default language name for the new writing system.</param>
		/// <param name="newWritingSystems">The new writing systems.</param>
		/// <returns></returns>
		public static bool ShowNewDialog(Form owner, FdoCache cache, IWritingSystemManager wsManager,
			IWritingSystemContainer wsContainer, IHelpTopicProvider helpTopicProvider, IApp app,
			IVwStylesheet stylesheet, bool displayRelatedWss, string defaultName,
			out IEnumerable<IWritingSystem> newWritingSystems)
		{
			newWritingSystems = null;
			LanguageSubtag languageSubtag;

			using (new WaitCursor(owner))
			using (var dlg = new LanguageSelectionDlg(wsManager, helpTopicProvider))
			{
				dlg.Text = FwCoreDlgs.kstidLanguageSelectionNewWsCaption;
				dlg.DefaultLanguageName = defaultName;

				if (dlg.ShowDialog(owner) != DialogResult.OK)
					return false;

				languageSubtag = dlg.LanguageSubtag;
			}

			using (new WaitCursor(owner))
			using (var wsPropsDlg = new WritingSystemPropertiesDialog(cache, wsManager, wsContainer, helpTopicProvider, app, stylesheet))
			{
				wsPropsDlg.SetupDialog(languageSubtag, displayRelatedWss);

				if (wsPropsDlg.ShowDialog(owner) == DialogResult.OK)
				{
					newWritingSystems = wsPropsDlg.NewWritingSystems;
					return true;
				}
			}
			return false;
		}
Exemplo n.º 6
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the ChooseScriptureDialog class.
		/// WARNING: this constructor is called by reflection, at least in the Interlinear
		/// Text DLL. If you change its parameters be SURE to find and fix those callers also.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="objList">A list of texts and books to check as an array of hvos</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// <param name="importer">The Paratext book importer.</param>
		/// ------------------------------------------------------------------------------------
		public FilterTextsDialogTE(FdoCache cache, IStText[] objList,
			IHelpTopicProvider helpTopicProvider, IBookImporter importer)
			: base(cache, objList, helpTopicProvider)
		{
			m_bookImporter = importer;
			using (var progressDlg = new ProgressDialogWithTask(this))
			{
				// This somewhat duplicates some logic in FieldWorks.GetHelpTopicProvider, but it feels
				// wrong to reference the main exe even though I can't find an actual circular dependency.
				// As far as I can discover, the help topic provider is only used if the user has modified
				// TE styles and TE needs to display a dialog about it (possibly because it has loaded a
				// new version of the standard ones?). Anyway, I don't think it will be used at all if TE
				// is not installed, so it should be safe to use the regular FLEx one.
				IHelpTopicProvider helpProvider;
				if (FwUtils.FwUtils.IsTEInstalled)
				{
					helpProvider = (IHelpTopicProvider) DynamicLoader.CreateObject(FwDirectoryFinder.TeDll,
						"SIL.FieldWorks.TE.TeHelpTopicProvider");
				}
				else
				{
					helpProvider = (IHelpTopicProvider)DynamicLoader.CreateObject(FwDirectoryFinder.FlexDll,
						"SIL.FieldWorks.XWorks.LexText.FlexHelpTopicProvider");
				}
				NonUndoableUnitOfWorkHelper.Do(cache.ActionHandlerAccessor, () =>
				TeScrInitializer.EnsureMinimalScriptureInitialization(cache, progressDlg,
					helpProvider));
			}
		}
Exemplo n.º 7
0
		public void Initialize(FdoCache cache, IHelpTopicProvider helpTopicProvider,
			IApp app, IVwStylesheet stylesheet, NotebookImportWiz.CharMapping charMapping)
		{
			m_cache = cache;
			m_helpTopicProvider = helpTopicProvider;
			m_app = app;
			m_stylesheet = stylesheet;
			if (charMapping == null)
			{
				m_tbBeginMkr.Text = String.Empty;
				m_tbEndMkr.Text = String.Empty;
				m_rbEndOfWord.Checked = false;
				m_rbEndOfField.Checked = true;
				FillWritingSystemCombo(null);
				FillStylesCombo(null);
				m_chkIgnore.Checked = false;
			}
			else
			{
				m_tbBeginMkr.Text = charMapping.BeginMarker;
				m_tbEndMkr.Text = charMapping.EndMarker;
				m_rbEndOfWord.Checked = charMapping.EndWithWord;
				m_rbEndOfField.Checked = !charMapping.EndWithWord;
				FillWritingSystemCombo(charMapping.DestinationWritingSystemId);
				FillStylesCombo(charMapping.DestinationStyle);
				m_chkIgnore.Checked = charMapping.IgnoreMarkerOnImport;
			}
		}
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="T:MultipleFilterDlg"/> class.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public MultipleFilterDlg(FdoCache cache, IHelpTopicProvider helpTopicProviderp,
                                 ICmFilter filter) : this()
        {
            m_helpTopicProvider = helpTopicProviderp;
            m_cache             = cache;
            m_cellFactory       = m_cache.ServiceLocator.GetInstance <ICmCellFactory>();
            m_scr    = m_cache.LangProject.TranslatedScriptureOA;
            m_filter = filter;

            // Initialize the enabled status of the group boxes.
            chkStatus_CheckedChanged(null, null);
            chkType_CheckedChanged(null, null);
            chkScrRange_CheckedChanged(null, null);

            // Initialize the beginning and ending default Scripture references.
            int firstBook = 1;
            int lastBook  = BCVRef.LastBook;

            if (m_scr.ScriptureBooksOS.Count > 0)
            {
                firstBook = m_scr.ScriptureBooksOS[0].CanonicalNum;
                lastBook  = m_scr.ScriptureBooksOS[m_scr.ScriptureBooksOS.Count - 1].CanonicalNum;
            }

            scrBookFrom.Initialize(new ScrReference(firstBook, 1, 1, m_scr.Versification));
            scrBookTo.Initialize(new ScrReference(lastBook, 1, 0, m_scr.Versification).LastReferenceForBook);

            // Update the controls from the filter in the database.
            InitializeFromFilter();
            chkCategory.Checked = tvCatagories.Load(m_cache, m_filter, null);
            chkCategory_CheckedChanged(null, null);
        }
Exemplo n.º 9
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:MultipleFilterDlg"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public MultipleFilterDlg(FdoCache cache, IHelpTopicProvider helpTopicProviderp,
			ICmFilter filter) : this()
		{
			m_helpTopicProvider = helpTopicProviderp;
			m_cache = cache;
			m_cellFactory = m_cache.ServiceLocator.GetInstance<ICmCellFactory>();
			m_scr = m_cache.LangProject.TranslatedScriptureOA;
			m_filter = filter;

			// Initialize the enabled status of the group boxes.
			chkStatus_CheckedChanged(null, null);
			chkType_CheckedChanged(null, null);
			chkScrRange_CheckedChanged(null, null);

			// Initialize the beginning and ending default Scripture references.
			int firstBook = 1;
			int lastBook = BCVRef.LastBook;
			if (m_scr.ScriptureBooksOS.Count > 0)
			{
				firstBook = m_scr.ScriptureBooksOS[0].CanonicalNum;
				lastBook = m_scr.ScriptureBooksOS[m_scr.ScriptureBooksOS.Count - 1].CanonicalNum;
			}

			scrBookFrom.Initialize(new ScrReference(firstBook, 1, 1, m_scr.Versification));
			scrBookTo.Initialize(new ScrReference(lastBook, 1, 0, m_scr.Versification).LastReferenceForBook);

			// Update the controls from the filter in the database.
			InitializeFromFilter();
			chkCategory.Checked = tvCatagories.Load(m_cache, m_filter, null);
			chkCategory_CheckedChanged(null, null);
		}
Exemplo n.º 10
0
		public MergeWritingSystemDlg(FdoCache cache, IWritingSystem ws, IEnumerable<IWritingSystem> wss, IHelpTopicProvider helpTopicProvider)
		{
			m_cache = cache;
			m_ws = ws;

			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			Icon infoIcon = SystemIcons.Information;
			m_infoPictureBox.Image = infoIcon.ToBitmap();
			m_infoPictureBox.Size = infoIcon.Size;

			foreach (IWritingSystem curWs in wss.Except(new[] { ws }))
				m_wsListBox.Items.Add(curWs);
			m_wsListBox.SelectedIndex = 0;

			m_helpTopicProvider = helpTopicProvider;

			if (m_helpTopicProvider != null) // m_helpTopicProvider could be null for testing
			{
				m_helpProvider = new HelpProvider();
				m_helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
				m_helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(HelpTopic));
				m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
			}
		}
Exemplo n.º 11
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="BookPropertiesDialog"/> class.
		/// </summary>
		/// <param name="book">the current book</param>
		/// <param name="stylesheet">The stylesheet.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public BookPropertiesDialog(IScrBook book, IVwStylesheet stylesheet, IHelpTopicProvider helpTopicProvider)
		{
			m_currentBook = book;
			m_helpTopicProvider = helpTopicProvider;
			// TE-5663: make sure the book's name and abbreviation are updated if some were added
			IScrRefSystem scrRefSystem = book.Cache.ServiceLocator.GetInstance<IScrRefSystemRepository>().AllInstances().FirstOrDefault();
			book.Name.MergeAlternatives(scrRefSystem.BooksOS[book.CanonicalNum - 1].BookName);
			book.Abbrev.MergeAlternatives(scrRefSystem.BooksOS[book.CanonicalNum - 1].BookAbbrev);

			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			// Put the book name in the dialog caption
			Text = string.Format(Text, book.Name.UserDefaultWritingSystem.Text);

			m_listBookInfo.Cache = book.Cache;
			m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
				ScrBookTags.kflidName, TeResourceHelper.GetResourceString("kstidBookNameColHeader"), 60));
			m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
				ScrBookTags.kflidAbbrev, TeResourceHelper.GetResourceString("kstidBookAbbrevColHeader"), 40));
			m_listBookInfo.RootObject = book.Hvo;

			foreach (IWritingSystem ws in book.Cache.ServiceLocator.WritingSystems.AllWritingSystems)
				m_listBookInfo.WritingSystemsToDisplay.Add(ws.Handle);

			// Initialize the ID textbox.
			m_txtScrBookIdText.Text = m_currentBook.IdText;
		}
Exemplo n.º 12
0
		public void SetDlgInfo(FdoCache cache, Mediator mediator, ICmObject owner)
		{
			CheckDisposed();

			m_cache = cache;
			m_owner = owner;

			m_helpTopic = "khtpDataNotebook-InsertRecordDlg";

			m_helpTopicProvider = mediator.HelpTopicProvider;
			if (m_helpTopicProvider != null) // Will be null when running tests
			{
				m_helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
				m_helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(m_helpTopic));
				m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
			}

			IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(mediator);
			m_titleTextBox.StyleSheet = stylesheet;
			m_titleTextBox.WritingSystemFactory = m_cache.WritingSystemFactory;
			m_titleTextBox.WritingSystemCode = m_cache.DefaultAnalWs;
			AdjustControlAndDialogHeight(m_titleTextBox, m_titleTextBox.PreferredHeight);

			m_typeCombo.StyleSheet = stylesheet;
			m_typeCombo.WritingSystemFactory = m_cache.WritingSystemFactory;
			m_typeCombo.WritingSystemCode = m_cache.DefaultAnalWs;
			AdjustControlAndDialogHeight(m_typeCombo, m_typeCombo.PreferredHeight);

			ICmPossibilityList recTypes = m_cache.LanguageProject.ResearchNotebookOA.RecTypesOA;
			m_typePopupTreeManager = new PossibilityListPopupTreeManager(m_typeCombo, m_cache, mediator,
				recTypes, cache.DefaultAnalWs, false, this);
			m_typePopupTreeManager.LoadPopupTree(m_cache.ServiceLocator.GetObject(RnResearchNbkTags.kguidRecObservation).Hvo);
			// Ensure that we start out focused in the Title text box.  See FWR-2731.
			m_titleTextBox.Select();
		}
Exemplo n.º 13
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="ExportRtfDialog"/> class.
		/// </summary>
		/// <param name="cache">The cache.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public ExportRtfDialog(FdoCache cache, IHelpTopicProvider helpTopicProvider)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			// If the current settings are for arabic digits then don't show the option
			// to export them as arabic.
			m_scr = cache.LangProject.TranslatedScriptureOA;
			m_helpTopicProvider = helpTopicProvider;

			// Set default export folder.
			m_rtfFolder = new RegistryStringSetting(
				Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
				"ExportFolderForRTF", FwSubKey.TE);
			string fileName = m_rtfFolder.Value;

			m_fileDialog = new TeImportExportFileDialog(cache.ProjectId.Name, FileType.RTF);

			// Append a filename if it was set to just a directory
			if (Directory.Exists(fileName))
				fileName = Path.Combine(fileName, m_fileDialog.DefaultFileName);
			m_txtOutputFile.Text = fileName;
		}
Exemplo n.º 14
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initialize the header and message before showing the dialog.
        /// </summary>
        /// <param name="sFilename"></param>
        /// <param name="sRootDir"></param>
        /// <param name="helpTopicProvider"></param>
        /// ------------------------------------------------------------------------------------
        public void Initialize2(string sFilename, string sRootDir,
                                IHelpTopicProvider helpTopicProvider)
        {
            CheckDisposed();
            m_msgText.Text   = String.Format(FwCoreDlgs.ksMoveOrCopyFileToExtDir);
            m_msgOldDir.Text = String.Format(FwCoreDlgs.ksExternalLinksFolder,
                                             ShortenMyDocsPath(sRootDir));

            // Adjust button locations and dialog size to conceal empty space left by invisible
            // m_msgNewDir.
            m_msgNewDir.Visible = false;
            int dy = m_msgNewDir.Height + 10;

            m_btnCopy.Location  = new Point(m_btnCopy.Location.X, m_btnCopy.Location.Y - dy);
            m_btnMove.Location  = new Point(m_btnMove.Location.X, m_btnMove.Location.Y - dy);
            m_btnLeave.Location = new Point(m_btnLeave.Location.X, m_btnLeave.Location.Y - dy);
            m_btnHelp.Location  = new Point(m_btnHelp.Location.X, m_btnHelp.Location.Y - dy);
            Size szNew = new Size(this.Size.Width, this.Size.Height - dy);

            this.MaximumSize = szNew;
            this.MinimumSize = szNew;
            this.Size        = szNew;

            // These become singular in wording instead of plural.
            this.Text       = FwCoreDlgs.ksMoveOrCopyFile;
            m_btnCopy.Text  = FwCoreDlgs.ksCopyFile;
            m_btnMove.Text  = FwCoreDlgs.ksMoveFile;
            m_btnLeave.Text = FwCoreDlgs.ksLeaveFile;

            SetupHelp(helpTopicProvider, "khtpMoveOrCopyFile");
        }
Exemplo n.º 15
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the ChooseScriptureDialog class.
 /// WARNING: this constructor is called by reflection, at least in the Interlinear
 /// Text DLL. If you change its parameters be SURE to find and fix those callers also.
 /// </summary>
 /// <param name="cache">The cache.</param>
 /// <param name="objList">A list of texts and books to check as an array of hvos</param>
 /// <param name="helpTopicProvider">The help topic provider.</param>
 /// <param name="importer">The Paratext book importer.</param>
 /// ------------------------------------------------------------------------------------
 public FilterTextsDialogTE(FdoCache cache, IStText[] objList,
                            IHelpTopicProvider helpTopicProvider, IBookImporter importer)
     : base(cache, objList, helpTopicProvider)
 {
     m_bookImporter = importer;
     using (var progressDlg = new ProgressDialogWithTask(this))
     {
         // This somewhat duplicates some logic in FieldWorks.GetHelpTopicProvider, but it feels
         // wrong to reference the main exe even though I can't find an actual circular dependency.
         // As far as I can discover, the help topic provider is only used if the user has modified
         // TE styles and TE needs to display a dialog about it (possibly because it has loaded a
         // new version of the standard ones?). Anyway, I don't think it will be used at all if TE
         // is not installed, so it should be safe to use the regular FLEx one.
         IHelpTopicProvider helpProvider;
         if (FwUtils.FwUtils.IsTEInstalled)
         {
             helpProvider = (IHelpTopicProvider)DynamicLoader.CreateObject(FwDirectoryFinder.TeDll,
                                                                           "SIL.FieldWorks.TE.TeHelpTopicProvider");
         }
         else
         {
             helpProvider = (IHelpTopicProvider)DynamicLoader.CreateObject(FwDirectoryFinder.FlexDll,
                                                                           "SIL.FieldWorks.XWorks.LexText.FlexHelpTopicProvider");
         }
         NonUndoableUnitOfWorkHelper.Do(cache.ActionHandlerAccessor, () =>
                                        TeScrInitializer.EnsureMinimalScriptureInitialization(cache, progressDlg,
                                                                                              helpProvider));
     }
 }
Exemplo n.º 16
0
        public DictionaryConfigurationManagerDlg(IHelpTopicProvider helpTopicProvider)
        {
            InitializeComponent();

            m_toolTip = new ToolTip();
            m_toolTip.SetToolTip(copyButton, xWorksStrings.DuplicateViewToolTip);
            m_toolTip.SetToolTip(removeButton, xWorksStrings.DeleteViewTooltip);
            m_toolTip.SetToolTip(resetButton, xWorksStrings.ResetViewTooltip);
            m_toolTip.SetToolTip(exportButton, xWorksStrings.ExportSelected);
            m_toolTip.SetToolTip(importButton, xWorksStrings.ImportView);

            m_helpTopicProvider = helpTopicProvider;

            // Allow renaming via the keyboard
            configurationsListView.KeyUp += ConfigurationsListViewKeyUp;
            // Make the Configuration selection more obvious when the control loses focus (LT-15450).
            configurationsListView.LostFocus += OnLostFocus;
            configurationsListView.GotFocus  += OnGotFocus;

            m_helpProvider = new HelpProvider {
                HelpNamespace = m_helpTopicProvider.HelpFile
            };
            m_helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(HelpTopic));
            m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            m_helpProvider.SetShowHelp(this, true);
        }
		public void SetupDlg(IHelpTopicProvider helpTopicProvider, IApp app, FdoCache cache,  Sfm2FlexTextMappingBase mappingToModify, IEnumerable<InterlinDestination> destinationsToDisplay)
		{
			m_helpTopicProvider = helpTopicProvider;
			m_app = app;
			m_cache = cache;
			m_mapping = mappingToModify;
			m_destinationsToDisplay = destinationsToDisplay;
			SuspendLayout();
			// Update the label to show what marker we are modifying
			m_destinationLabel.Text = String.Format(m_orginalLabel, mappingToModify.Marker);
			// Replace the Add button with a specialized add writing system button
			var loc = m_addWritingSystemButton.Location;
			var tabIndex = m_addWritingSystemButton.TabIndex;
			var text = m_addWritingSystemButton.Text;
			Controls.Remove(m_addWritingSystemButton);
			m_addWritingSystemButton = new AddWritingSystemButton();
			m_addWritingSystemButton.Location = loc;
			m_addWritingSystemButton.Anchor = AnchorStyles.Left | AnchorStyles.Bottom;
			Controls.Add(m_addWritingSystemButton);
			m_addWritingSystemButton.TabIndex = tabIndex;
			m_addWritingSystemButton.Text = text;
			var addWritingSystemButton = ((AddWritingSystemButton)m_addWritingSystemButton);
			addWritingSystemButton.Initialize(m_cache, helpTopicProvider, app, null, cache.ServiceLocator.WritingSystems.AllWritingSystems);
			addWritingSystemButton.WritingSystemAdded += SfmInterlinearMappingDlg_WritingSystemAdded;
			m_destinationsListBox.SelectedIndexChanged += new EventHandler(m_destinationsListBox_SelectedIndexChanged);
			LoadConverters(mappingToModify.Converter);
			LoadDestinations();
			ResumeLayout();
		}
Exemplo n.º 18
0
        internal AdvancedMTDialog(LcmCache cache, bool fPrepose, CChartSentenceElements ccSentElem, IHelpTopicProvider helpTopicProvidor)
        {
            InitializeComponent();

            SuspendLayout();

            m_helpTopicProvider = helpTopicProvidor;
            if (m_helpTopicProvider != null)
            {
                helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
                helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
                helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
                helpProvider.SetShowHelp(this, true);
            }
            m_AMTDLogic = new AdvancedMTDialogLogic(cache, fPrepose, ccSentElem);
            m_bottomStuff.SuspendLayout();
            m_bottomStuff.Controls.AddRange(new Control[] { m_AMTDLogic.DlgRibbon });

            m_bottomStuff.ResumeLayout();

            // Setup localized dialog
            SetCaption(fPrepose ? DiscourseStrings.ksAdvDlgPreposeCaption : DiscourseStrings.ksAdvDlgPostposeCaption);
            SetMainText(fPrepose ? DiscourseStrings.ksAdvDlgMainPreText : DiscourseStrings.ksAdvDlgMainPostText);
            SetPartialText(fPrepose ? DiscourseStrings.ksAdvDlgPartialPre : DiscourseStrings.ksAdvDlgPartialPost);

            ResumeLayout();

            InitLogicAndDialog();
        }
Exemplo n.º 19
0
        public void SetDlgInfo(LcmCache cache, Mediator mediator, PropertyTable propertyTable, ComplexConcMorphNode node)
        {
            m_cache = cache;
            m_node  = node;

            m_formTextBox.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor;
            m_formTextBox.AdjustForStyleSheet(FontHeightAdjuster.StyleSheetFromPropertyTable(propertyTable));

            m_glossTextBox.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor;
            m_glossTextBox.AdjustForStyleSheet(FontHeightAdjuster.StyleSheetFromPropertyTable(propertyTable));

            m_entryTextBox.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor;
            m_entryTextBox.AdjustForStyleSheet(FontHeightAdjuster.StyleSheetFromPropertyTable(propertyTable));

            m_categoryComboBox.WritingSystemFactory = m_cache.LanguageWritingSystemFactoryAccessor;

            foreach (CoreWritingSystemDefinition ws in m_cache.ServiceLocator.WritingSystems.CurrentVernacularWritingSystems)
            {
                m_formWsComboBox.Items.Add(ws);
                m_entryWsComboBox.Items.Add(ws);
            }

            foreach (CoreWritingSystemDefinition ws in m_cache.ServiceLocator.WritingSystems.CurrentAnalysisWritingSystems)
            {
                m_glossWsComboBox.Items.Add(ws);
            }

            m_inflModel = new InflFeatureTreeModel(m_cache.LangProject.MsFeatureSystemOA, m_node.InflFeatures, m_imageList.Images[0], m_imageList.Images[1]);
            m_inflFeatsTreeView.Model = m_inflModel;
            m_inflFeatsTreeView.ExpandAll();

            SetTextBoxValue(m_node.Form, m_formTextBox, m_formWsComboBox, true);
            SetTextBoxValue(m_node.Entry, m_entryTextBox, m_entryWsComboBox, true);
            SetTextBoxValue(m_node.Gloss, m_glossTextBox, m_glossWsComboBox, false);

            m_catPopupTreeManager = new PossibilityComboController(m_categoryComboBox,
                                                                   m_cache,
                                                                   m_cache.LanguageProject.PartsOfSpeechOA,
                                                                   m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Handle,
                                                                   false,
                                                                   mediator,
                                                                   propertyTable,
                                                                   propertyTable.GetValue <Form>("window"));

            if (m_node.Category != null)
            {
                m_categoryNotCheckBox.Checked = m_node.NegateCategory;
                m_catPopupTreeManager.LoadPopupTree(m_node.Category.Hvo);
            }
            else
            {
                m_catPopupTreeManager.LoadPopupTree(0);
            }

            m_helpTopicProvider = propertyTable.GetValue <IHelpTopicProvider>("HelpTopicProvider");

            m_helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
            m_helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
            m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
        }
Exemplo n.º 20
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="T:PicturePropertiesDialog"/> class.
        /// </summary>
        /// <param name="cache">The FdoCache to use</param>
        /// <param name="initialPicture">The CmPicture object to set all of the dialog
        /// properties to, or null to edit a new picture</param>
        /// <param name="helpTopicProvider">typically IHelpTopicProvider.App</param>
        /// <param name="app">The application</param>
        /// <param name="fAnalysis">true to use analysis writign system for caption</param>
        /// ------------------------------------------------------------------------------------
        public PicturePropertiesDialog(FdoCache cache, ICmPicture initialPicture,
                                       IHelpTopicProvider helpTopicProvider, IApp app, bool fAnalysis)
        {
            // ReSharper disable LocalizableElement
            if (cache == null)
            {
                throw(new ArgumentNullException("cache", "The FdoCache cannot be null"));
            }
            // ReSharper restore LocalizableElement

            Logger.WriteEvent("Opening 'Picture Properties' dialog");

            m_cache             = cache;
            m_initialPicture    = initialPicture;
            m_helpTopicProvider = helpTopicProvider;
            m_app       = app;
            m_captionWs = fAnalysis
                                ? m_cache.ServiceLocator.WritingSystems.DefaultAnalysisWritingSystem.Handle
                                : m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.Handle;

            InitializeComponent();
            AccessibleName = GetType().Name;

            if (m_helpTopicProvider != null)             // Could be null during tests
            {
                m_helpProvider = new HelpProvider();
                m_helpProvider.HelpNamespace = FwDirectoryFinder.CodeDirectory +
                                               m_helpTopicProvider.GetHelpString("UserHelpFile");
                m_helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
                m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            }
        }
Exemplo n.º 21
0
        /// <summary/>
        public void ShowSummaryDialog(IWin32Window owner, ITsString tssWf,
                                      IHelpTopicProvider helpProvider, string helpFileKey, IVwStylesheet styleSheet)
        {
            CheckDisposed();

            bool otherButtonClicked = false;

            using (SummaryDialogForm form =
                       new SummaryDialogForm(this, tssWf, helpProvider, helpFileKey, styleSheet))
            {
                form.ShowDialog(owner);
                if (form.ShouldLink)
                {
                    form.LinkToLexicon();
                }
                otherButtonClicked = form.OtherButtonClicked;
            }
            if (otherButtonClicked)
            {
                var entry = ShowFindEntryDialog(Object.Cache, Mediator, m_propertyTable, tssWf, owner);
                if (entry != null)
                {
                    using (var leuiNew = new LexEntryUi(entry))
                    {
                        leuiNew.ShowSummaryDialog(owner, entry.HeadWord, helpProvider, helpFileKey, styleSheet);
                    }
                }
                else
                {
                    // redisplay the original entry (recursively)
                    ShowSummaryDialog(owner, tssWf, helpProvider, helpFileKey, styleSheet);
                }
            }
        }
Exemplo n.º 22
0
 /// <summary>
 /// Constructor for Morph Break Helper Context Menu
 /// </summary>
 /// <param name="textbox">the textbox to insert regex characters into</param>
 /// <param name="helpTopicProvider">usually FwApp.App</param>
 /// <param name="cache">cache</param>
 /// <param name="stringTable">stringTable</param>
 public MorphBreakHelperMenu(FwTextBox textbox, IHelpTopicProvider helpTopicProvider, FdoCache cache, StringTable stringTable)
     : base(textbox, helpTopicProvider)
 {
     m_cache       = cache;
     m_stringTable = stringTable;
     Init();
 }
Exemplo n.º 23
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="T:FwApplyStyleDlg"/> class.
        /// </summary>
        /// <param name="rootSite">The root site.</param>
        /// <param name="cache">The cache.</param>
        /// <param name="hvoStylesOwner">The hvo of the object which owns the style.</param>
        /// <param name="stylesTag">The "flid" in which the styles are owned.</param>
        /// <param name="normalStyleName">Name of the normal style.</param>
        /// <param name="customUserLevel">The custom user level.</param>
        /// <param name="paraStyleName">Name of the currently selected paragraph style.</param>
        /// <param name="charStyleName">Name of the currently selected character style.</param>
        /// <param name="hvoRootObject">The hvo of the root object in the current view.</param>
        /// <param name="app">The application.</param>
        /// <param name="helpTopicProvider">The help topic provider.</param>
        /// ------------------------------------------------------------------------------------
        public FwApplyStyleDlg(IVwRootSite rootSite, FdoCache cache, int hvoStylesOwner,
                               int stylesTag, string normalStyleName, int customUserLevel, string paraStyleName,
                               string charStyleName, int hvoRootObject, IApp app,
                               IHelpTopicProvider helpTopicProvider)
        {
            m_rootSite = rootSite;
            InitializeComponent();
            m_customUserLevel   = customUserLevel;
            m_helpTopicProvider = helpTopicProvider;
            m_paraStyleName     = paraStyleName;
            m_charStyleName     = charStyleName;

            // Cache is null in tests
            if (cache == null)
            {
                return;
            }

            m_cboTypes.SelectedIndex = 1;             // All Styles

            // Load the style information
            m_styleTable = new StyleInfoTable(normalStyleName,
                                              cache.ServiceLocator.WritingSystemManager);
            m_styleSheet = new FwStyleSheet();
            m_styleSheet.Init(cache, hvoStylesOwner, stylesTag);
            m_styleListHelper = new StyleListBoxHelper(m_lstStyles);
            m_styleListHelper.ShowInternalStyles = false;
        }
Exemplo n.º 24
0
 /// <summary/>
 public AddNewVernLangWarningDlg(IHelpTopicProvider helpTopicProvider)
 {
     InitializeComponent();
     _helpTopicProvider = helpTopicProvider;
     warningIconBox.BackgroundImageLayout = ImageLayout.Center;
     warningIconBox.BackgroundImage       = System.Drawing.SystemIcons.Warning.ToBitmap();
 }
Exemplo n.º 25
0
        /// <summary>
        /// Get a new FW project from some Mercurial repository.
        /// The repo may be a lift or full FW repo, but it can be from any source source, as long as the code can create an FW project from it.
        /// </summary>
        /// <returns>Null if the operation was cancelled or otherwise did not work. The full pathname of an fwdata file, if it did work.</returns>
        public static string ObtainProjectFromAnySource(Form parent, IHelpTopicProvider helpTopicProvider, out ObtainedProjectType obtainedProjectType)
        {
            bool   dummy;
            string fwdataFileFullPathname;
            var    success = FLExBridgeHelper.LaunchFieldworksBridge(FwDirectoryFinder.ProjectsDirectory, null, FLExBridgeHelper.Obtain, null,
                                                                     FDOBackendProvider.ModelVersion, "0.13", null, null, out dummy, out fwdataFileFullPathname);

            if (!success)
            {
                ReportDuplicateBridge();
                obtainedProjectType = ObtainedProjectType.None;
                return(null);
            }
            if (string.IsNullOrWhiteSpace(fwdataFileFullPathname))
            {
                obtainedProjectType = ObtainedProjectType.None;
                return(null);                // user canceled.
            }
            obtainedProjectType = ObtainedProjectType.FieldWorks;

            if (fwdataFileFullPathname.EndsWith("lift"))
            {
                fwdataFileFullPathname = CreateProjectFromLift(parent, helpTopicProvider, fwdataFileFullPathname);
                obtainedProjectType    = ObtainedProjectType.Lift;
            }

            EnsureLinkedFoldersExist(fwdataFileFullPathname);

            return(fwdataFileFullPathname);
        }
Exemplo n.º 26
0
		/// <summary>
		/// Get a new FW project from some Mercurial repository.
		/// The repo may be a lift or full FW repo, but it can be from any source source, as long as the code can create an FW project from it.
		/// </summary>
		/// <returns>Null if the operation was cancelled or otherwise did not work. The full pathname of an fwdata file, if it did work.</returns>
		public static string ObtainProjectFromAnySource(Form parent, IHelpTopicProvider helpTopicProvider, out ObtainedProjectType obtainedProjectType)
		{
			bool dummy;
			string fwdataFileFullPathname;
			var success = FLExBridgeHelper.LaunchFieldworksBridge(FwDirectoryFinder.ProjectsDirectory, null, FLExBridgeHelper.Obtain, null,
				FDOBackendProvider.ModelVersion, "0.13", null, null, out dummy, out fwdataFileFullPathname);
			if (!success)
			{
				ReportDuplicateBridge();
				obtainedProjectType = ObtainedProjectType.None;
				return null;
			}
			if (string.IsNullOrWhiteSpace(fwdataFileFullPathname))
			{
				obtainedProjectType = ObtainedProjectType.None;
				return null; // user canceled.
			}
			obtainedProjectType = ObtainedProjectType.FieldWorks;

			if (fwdataFileFullPathname.EndsWith("lift"))
			{
				fwdataFileFullPathname = CreateProjectFromLift(parent, helpTopicProvider, fwdataFileFullPathname);
				obtainedProjectType = ObtainedProjectType.Lift;
			}

			EnsureLinkedFoldersExist(fwdataFileFullPathname);

			return fwdataFileFullPathname;
		}
Exemplo n.º 27
0
 public DictionaryConfigurationImportDlg(IHelpTopicProvider helpProvider)
 {
     InitializeComponent();
     m_helpTopicProvider = helpProvider;
     // Clear away example text
     explanationLabel.Text = string.Empty;
 }
Exemplo n.º 28
0
 public void Initialize(FdoCache cache, IHelpTopicProvider helpTopicProvider,
                        IApp app, IVwStylesheet stylesheet, NotebookImportWiz.CharMapping charMapping)
 {
     m_cache             = cache;
     m_helpTopicProvider = helpTopicProvider;
     m_app        = app;
     m_stylesheet = stylesheet;
     if (charMapping == null)
     {
         m_tbBeginMkr.Text      = String.Empty;
         m_tbEndMkr.Text        = String.Empty;
         m_rbEndOfWord.Checked  = false;
         m_rbEndOfField.Checked = true;
         FillWritingSystemCombo(null);
         FillStylesCombo(null);
         m_chkIgnore.Checked = false;
     }
     else
     {
         m_tbBeginMkr.Text      = charMapping.BeginMarker;
         m_tbEndMkr.Text        = charMapping.EndMarker;
         m_rbEndOfWord.Checked  = charMapping.EndWithWord;
         m_rbEndOfField.Checked = !charMapping.EndWithWord;
         FillWritingSystemCombo(charMapping.DestinationWritingSystemId);
         FillStylesCombo(charMapping.DestinationStyle);
         m_chkIgnore.Checked = charMapping.IgnoreMarkerOnImport;
     }
 }
Exemplo n.º 29
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="RestoreProjectDlg"/> class.
 /// </summary>
 /// <param name="defaultProjectName">Default project to show existing backups for.</param>
 /// <param name="helpTopicProvider">The help topic provider.</param>
 /// ------------------------------------------------------------------------------------
 public RestoreProjectDlg(string defaultProjectName,
                          IHelpTopicProvider helpTopicProvider) : this(helpTopicProvider)
 {
     m_presenter = new RestoreProjectPresenter(this, defaultProjectName);
     m_rdoDefaultFolder_CheckedChanged(null, null);
     PopulateProjectList(m_presenter.DefaultProjectName);
 }
Exemplo n.º 30
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:SequenceOptionsDlg"/> class.
		/// </summary>
		/// <param name="restartSequence">if set to <c>true</c> [restart sequence].</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public SequenceOptionsDlg(bool restartSequence, IHelpTopicProvider helpTopicProvider)
		{
			InitializeComponent();
			m_helpTopicProvider = helpTopicProvider;
			opnRestart.Checked = restartSequence;
			opnContinuous.Checked = !restartSequence;
		}
Exemplo n.º 31
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:SequenceOptionsDlg"/> class.
 /// </summary>
 /// <param name="restartSequence">if set to <c>true</c> [restart sequence].</param>
 /// <param name="helpTopicProvider">The help topic provider.</param>
 /// ------------------------------------------------------------------------------------
 public SequenceOptionsDlg(bool restartSequence, IHelpTopicProvider helpTopicProvider)
 {
     InitializeComponent();
     m_helpTopicProvider   = helpTopicProvider;
     opnRestart.Checked    = restartSequence;
     opnContinuous.Checked = !restartSequence;
 }
Exemplo n.º 32
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="WelcomeToFieldWorksDlg"/> class.
        /// </summary>
        /// <param name="helpTopicProvider">Help topic provider</param>
        /// <param name="exception">Exception that was thrown if the previously requested
        /// project could not be opened.</param>
        /// <param name="showReportingRow">True (usually only on the first run) when we want to show the first-time warning about
        /// sending google analytics information</param>
        /// ------------------------------------------------------------------------------------
        public WelcomeToFieldWorksDlg(IHelpTopicProvider helpTopicProvider, StartupException exception, bool showReportingRow)
        {
            InitializeComponent();
            AccessibleName = GetType().Name;
            var fullAppName = Properties.Resources.kstidFLEx;

            SetCheckboxText = fullAppName;              // Setter uses the app name in a format string.

            if (exception == null || !exception.ReportToUser)
            {
                Text = fullAppName;
                Logger.WriteEvent("Opening 'Welcome to FieldWorks' dialog");
            }
            else
            {
                m_helpTopic = "khtpUnableToOpenProject";
                Text        = Properties.Resources.kstidUnableToOpenProjectCaption;
                m_lblProjectLoadError.Text = exception.Message;
                Logger.WriteEvent("Opening 'Unable to Open Project' dialog");
            }

            if (!showReportingRow)
            {
                reportingInfoLayout.Visible = false;
            }

            m_helpTopicProvider        = helpTopicProvider;
            helpProvider               = new HelpProvider();
            helpProvider.HelpNamespace = FwDirectoryFinder.CodeDirectory + m_helpTopicProvider.GetHelpString("UserHelpFile");
            helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(m_helpTopic));
            helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            receiveButton.Enabled = FLExBridgeHelper.IsFlexBridgeInstalled();
        }
Exemplo n.º 33
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="SimpleIntegerMatchDlg"/> class.
		/// </summary>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public SimpleIntegerMatchDlg(IHelpTopicProvider helpTopicProvider) : this()
		{
			m_helpTopicProvider = helpTopicProvider;
			helpProvider1.HelpNamespace = m_helpTopicProvider.HelpFile;
			helpProvider1.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
			helpProvider1.SetHelpNavigator(this, HelpNavigator.Topic);
		}
Exemplo n.º 34
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="WelcomeToFieldWorksDlg"/> class.
		/// </summary>
		/// <param name="helpTopicProvider">Help topic provider</param>
		/// <param name="appAbbrev">Standard application abbreviation.</param>
		/// <param name="exception">Exception that was thrown if the previously requested
		/// project could not be opened.</param>
		/// <param name="showReportingRow">True (usually only on the first run) when we want to show the first-time warning about
		/// sending google analytics information</param>
		/// ------------------------------------------------------------------------------------
		public WelcomeToFieldWorksDlg(IHelpTopicProvider helpTopicProvider, string appAbbrev, StartupException exception, bool showReportingRow)
		{
			m_appAbbrev = appAbbrev;
			InitializeComponent();
			AccessibleName = GetType().Name;
			var fullAppName = AppIsFlex ? Properties.Resources.kstidFLEx : Properties.Resources.kstidTE;
			SetCheckboxText = fullAppName;  // Setter uses the app name in a format string.

			if (exception == null || !exception.ReportToUser)
			{
				Text = fullAppName;
				Logger.WriteEvent("Opening 'Welcome to FieldWorks' dialog");
			}
			else
			{
				m_helpTopic = "khtpUnableToOpenProject";
				Text = Properties.Resources.kstidUnableToOpenProjectCaption;
				m_lblProjectLoadError.Text = exception.Message;
				Logger.WriteEvent("Opening 'Unable to Open Project' dialog");
			}

			if (!showReportingRow)
			{
				reportingInfoLayout.Visible = false;
			}

			m_helpTopicProvider = helpTopicProvider;
			helpProvider = new HelpProvider();
			helpProvider.HelpNamespace = FwDirectoryFinder.CodeDirectory + m_helpTopicProvider.GetHelpString("UserHelpFile");
			helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(m_helpTopic));
			helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
			receiveButton.Enabled =
				ClientServerServices.Current.Local.DefaultBackendType != FDOBackendProviderType.kDb4oClientServer &&
					FLExBridgeHelper.IsFlexBridgeInstalled();
		}
Exemplo n.º 35
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public MergeToExistingWsDlg(IHelpTopicProvider helptopicProvider)
		{
			InitializeComponent();
			m_icon = SystemIcons.Exclamation;
			m_helptopicProvider = helptopicProvider;
			m_sHelpTopicKey = "khtpMergeToExistingWsDlg";
		}
Exemplo n.º 36
0
        private static string[] MoveCopyOrLeaveFiles(string[] files, string subFolder, string sRootDirExternalLinks,
                                                     IHelpTopicProvider helpTopicProvider)
        {
            try
            {
                if (!Directory.Exists(subFolder))
                {
                    Directory.CreateDirectory(subFolder);
                }
            }
            catch (Exception e)
            {
                Logger.WriteEvent(string.Format("Error creating the directory: '{0}'", subFolder));
                Logger.WriteError(e);
                return(files);
            }

            // Check whether the file is found within the directory.
            if (files.All(f => FileIsInExternalLinksFolder(f, sRootDirExternalLinks)))
            {
                return(files);
            }

            using (var dlg = new MoveOrCopyFilesDlg())
            {
                dlg.Initialize2(subFolder, helpTopicProvider);
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    FileLocationChoice choice = dlg.Choice;
                    return(files.Select(f => PerformMoveCopyOrLeaveFile(f, subFolder, choice)).ToArray());
                }

                return(files);
            }
        }
Exemplo n.º 37
0
        /// -----------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="PicturePropertiesDialog"/> class.
        /// </summary>
        /// <param name="cache">The FdoCache to use</param>
        /// <param name="initialPicture">The CmPicture object to set all of the dialog
        /// properties to, or null to edit a new picture</param>
        /// <param name="helpTopicProvider">typically FwApp.App</param>
        /// <param name="fAnalysis">true to use analysis writign system for caption</param>
        /// -----------------------------------------------------------------------------------
        public PicturePropertiesDialog(FdoCache cache, CmPicture initialPicture,
                                       IHelpTopicProvider helpTopicProvider, bool fAnalysis)
        {
            if (cache == null)
            {
                throw(new ArgumentNullException("cache", "The FdoCache cannot be null"));
            }

            Logger.WriteEvent("Opening 'Picture Properties' dialog");

            m_cache             = cache;
            m_initialPicture    = initialPicture;
            m_helpTopicProvider = helpTopicProvider;
            m_captionWs         = fAnalysis ? m_cache.DefaultAnalWs : m_cache.DefaultVernWs;

            InitializeComponent();

            if (m_helpTopicProvider != null)             // Could be null during tests
            {
                helpProvider = new HelpProvider();
                helpProvider.HelpNamespace = DirectoryFinder.FWCodeDirectory +
                                             m_helpTopicProvider.GetHelpString("UserHelpFile", 0);
                helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic, 0));
                helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            }
        }
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="LexImportWizardLanguage"/> class.
 /// </summary>
 /// <param name="cache">The cache.</param>
 /// <param name="helpTopicProvider">The help topic provider.</param>
 /// <param name="app">The app.</param>
 /// ------------------------------------------------------------------------------------
 public LexImportWizardLanguage(FdoCache cache, IHelpTopicProvider helpTopicProvider,
                                IApp app, IVwStylesheet stylesheet) : this(cache, new Hashtable(), helpTopicProvider, app, stylesheet)
 {
     m_LinguaLinksImport = true;
     tbLangDesc.ReadOnly = true;             // don't let them change the language name
     tbLangDesc.Enabled  = false;
 }
		/// <summary>
		/// Checks to see whether the given files are located in the given root directory (or any subfolder of it), and if not, prompts the user to
		/// allow FW to move, copy, or leave the files. If anything unexpected happens, the default is to leave the files where they are.
		/// </summary>
		/// <param name="files">The fully-specified path names of the files.</param>
		/// <param name="sRootDirLinkedFiles">The fully-specified path name of the LinkedFiles root directory.</param>
		/// <param name="isLocal">True if running on the local server: allows file not to be moved or copied</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// <returns>The fully specified path names of the files to use, which might be the same as the given path or it could be
		/// in its new location under the LinkedFiles folder if the user elected to move or copy it.</returns>
		public static string[] MoveCopyOrLeaveMediaFiles(string[] files, string sRootDirLinkedFiles, IHelpTopicProvider helpTopicProvider, bool isLocal)
		{
			return MoveCopyOrLeaveFiles(files,
				Path.Combine(sRootDirLinkedFiles, FdoFileHelper.ksMediaDir),
				sRootDirLinkedFiles,
				helpTopicProvider, isLocal);
		}
Exemplo n.º 40
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="SimpleIntegerMatchDlg"/> class.
 /// </summary>
 /// <param name="helpTopicProvider">The help topic provider.</param>
 /// ------------------------------------------------------------------------------------
 public SimpleIntegerMatchDlg(IHelpTopicProvider helpTopicProvider) : this()
 {
     m_helpTopicProvider         = helpTopicProvider;
     helpProvider1.HelpNamespace = m_helpTopicProvider.HelpFile;
     helpProvider1.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
     helpProvider1.SetHelpNavigator(this, HelpNavigator.Topic);
 }
Exemplo n.º 41
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="EmptyScripture"/> class.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public EmptyScripture(ITMAdapter adapter, FdoCache fdoCache, IHelpTopicProvider helpTopicProvider)
        {
            InitializeComponent();

            m_helpTopicProvider = helpTopicProvider;

            if (adapter == null || adapter.MessageMediator == null)
            {
                btnBook.Enabled = false;
            }
            else
            {
                m_tmAdapter = adapter;

                // Save the adapter's message mediator so it can be restored when the
                // dialog closes.
                m_savMsgMediator = adapter.MessageMediator;

                // Create a new mediator for this dialog and set
                // the adapter's mediator to it.
                Mediator mediator = new Mediator();
                mediator.AddColleague(this);
                m_tmAdapter.MessageMediator = mediator;
            }

            string projectName = fdoCache.ProjectId.Name;

            lblTopLabel.Text = string.Format(lblTopLabel.Text, projectName);
        }
Exemplo n.º 42
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:FwApplyStyleDlg"/> class.
		/// </summary>
		/// <param name="rootSite">The root site.</param>
		/// <param name="cache">The cache.</param>
		/// <param name="hvoStylesOwner">The hvo of the object which owns the style.</param>
		/// <param name="stylesTag">The "flid" in which the styles are owned.</param>
		/// <param name="normalStyleName">Name of the normal style.</param>
		/// <param name="customUserLevel">The custom user level.</param>
		/// <param name="paraStyleName">Name of the currently selected paragraph style.</param>
		/// <param name="charStyleName">Name of the currently selected character style.</param>
		/// <param name="hvoRootObject">The hvo of the root object in the current view.</param>
		/// <param name="app">The application.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public FwApplyStyleDlg(IVwRootSite rootSite, FdoCache cache, int hvoStylesOwner,
			int stylesTag, string normalStyleName, int customUserLevel, string paraStyleName,
			string charStyleName, int hvoRootObject, IApp app,
			IHelpTopicProvider helpTopicProvider)
		{
			m_rootSite = rootSite;
			InitializeComponent();
			m_customUserLevel = customUserLevel;
			m_helpTopicProvider = helpTopicProvider;
			m_paraStyleName = paraStyleName;
			m_charStyleName = charStyleName;

			// Cache is null in tests
			if (cache == null)
				return;

			m_cboTypes.SelectedIndex = 1; // All Styles

			// Load the style information
			m_styleTable = new StyleInfoTable(normalStyleName,
				cache.ServiceLocator.WritingSystemManager);
			m_styleSheet = new FwStyleSheet();
			m_styleSheet.Init(cache, hvoStylesOwner, stylesTag);
			m_styleListHelper = new StyleListBoxHelper(m_lstStyles);
			m_styleListHelper.ShowInternalStyles = false;
		}
Exemplo n.º 43
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initialize the header and message before showing the dialog.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void Initialize2(string sFilename, string sRootDir,
                                IHelpTopicProvider helpTopicProvider, bool isLocal)
        {
            CheckDisposed();
            m_msgText.Text   = String.Format(FwCoreDlgs.ksMoveOrCopyFileToLinkedFilesDir);
            m_msgOldDir.Text = String.Format(FwCoreDlgs.ksLinkedFilesFolder,
                                             ShortenMyDocsPath(sRootDir));

            // Adjust dialog size to conceal empty space left by invisible m_msgNewDir.
            // Buttons are anchored to the bottom, so they'll move automatically.
            m_msgNewDir.Visible = false;
            int  dy    = m_msgNewDir.Height;
            Size szNew = new Size(this.Size.Width, this.Size.Height - dy);

            this.MaximumSize = szNew;
            this.MinimumSize = szNew;
            this.Size        = szNew;

            // These become singular in wording instead of plural.
            this.Text          = FwCoreDlgs.ksMoveOrCopyFile;
            m_btnCopy.Text     = FwCoreDlgs.ksCopyFile;
            m_btnMove.Text     = FwCoreDlgs.ksMoveFile;
            m_btnLeave.Text    = FwCoreDlgs.ksLeaveFile;
            m_btnLeave.Enabled = isLocal;

            SetupHelp(helpTopicProvider, "khtpMoveOrCopyFile");
        }
Exemplo n.º 44
0
		public ConfigureInterlinDialog(FdoCache cache, IHelpTopicProvider helpTopicProvider,
			InterlinLineChoices choices)
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			AccessibleName = GetType().Name;

			m_helpTopicProvider = helpTopicProvider;
			helpProvider = new HelpProvider();
			helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
			helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
			helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);

			m_cachedComboBoxes = new Dictionary<ColumnConfigureDialog.WsComboContent, ComboBox.ObjectCollection>();

			m_cache = cache;
			m_choices = choices;

			InitPossibilitiesList();

			// Owner draw requires drawing the column header as well as the list items.  See LT-7007.
			currentList.DrawColumnHeader += currentList_DrawColumnHeader;
			InitCurrentList(0); // also inits WsCombo.

			currentList.SelectedIndexChanged += currentList_SelectedIndexChanged;
			optionsList.SelectedIndexChanged += optionsList_SelectedIndexChanged;
			EnableControls();
		}
Exemplo n.º 45
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Make one.
 /// </summary>
 /// <param name="cache">The cache.</param>
 /// <param name="app">The app.</param>
 /// <param name="helpTopicProvider">The help topic provider.</param>
 /// <param name="makeRootAutomatically">if set to <c>true</c> [make root automatically].</param>
 /// <param name="filterInstance">The filter instance.</param>
 /// ------------------------------------------------------------------------------------
 public VerticalDraftView(FdoCache cache, IApp app, IHelpTopicProvider helpTopicProvider,
                          bool makeRootAutomatically, int filterInstance)
     : base(cache, filterInstance, app, "vertical draft view", true, false,
            makeRootAutomatically, TeViewType.VerticalView, -1, helpTopicProvider)
 {
     AutoScroll = true;
 }
        public ConfigureInterlinDialog(FdoCache cache, IHelpTopicProvider helpTopicProvider,
                                       InterlinLineChoices choices)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            AccessibleName = GetType().Name;

            m_helpTopicProvider        = helpTopicProvider;
            helpProvider               = new HelpProvider();
            helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
            helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
            helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);

            m_cachedComboBoxes = new Dictionary <ColumnConfigureDialog.WsComboContent, ComboBox.ObjectCollection>();

            m_cache   = cache;
            m_choices = choices;

            InitPossibilitiesList();

            // Owner draw requires drawing the column header as well as the list items.  See LT-7007.
            currentList.DrawColumnHeader += currentList_DrawColumnHeader;
            InitCurrentList(0);             // also inits WsCombo.

            currentList.SelectedIndexChanged += currentList_SelectedIndexChanged;
            optionsList.SelectedIndexChanged += optionsList_SelectedIndexChanged;
            EnableControls();
        }
Exemplo n.º 47
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MergeWritingSystemDlg"/> class.
        /// </summary>
        public MergeWritingSystemDlg(FdoCache cache, IWritingSystem ws, IEnumerable <IWritingSystem> wss, IHelpTopicProvider helpTopicProvider)
        {
            m_cache = cache;
            m_ws    = ws;

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            Icon infoIcon = SystemIcons.Information;

            m_infoPictureBox.Image = infoIcon.ToBitmap();
            m_infoPictureBox.Size  = infoIcon.Size;

            foreach (IWritingSystem curWs in wss.Except(new[] { ws }))
            {
                m_wsListBox.Items.Add(curWs);
            }
            m_wsListBox.SelectedIndex = 0;

            m_helpTopicProvider = helpTopicProvider;

            if (m_helpTopicProvider != null)             // m_helpTopicProvider could be null for testing
            {
                m_helpProvider = new HelpProvider();
                m_helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
                m_helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(HelpTopic));
                m_helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            }
        }
Exemplo n.º 48
0
        private static string MoveCopyOrLeaveFile(string sFile, string subFolder, string sRootDirExternalLinks,
                                                  IHelpTopicProvider helpTopicProvider, bool isLocal)
        {
            try
            {
                if (!Directory.Exists(subFolder))
                {
                    Directory.CreateDirectory(subFolder);
                }
            }
            catch (Exception e)
            {
                Logger.WriteEvent(String.Format("Error creating the directory: '{0}'", subFolder));
                Logger.WriteError(e);
                return(sFile);
            }

            // Check whether the file is found within the directory.  If so, just return.
            if (FileIsInExternalLinksFolder(sFile, sRootDirExternalLinks))
            {
                return(sFile);
            }

            using (MoveOrCopyFilesDlg dlg = new MoveOrCopyFilesDlg())
            {
                dlg.Initialize2(sFile, subFolder, helpTopicProvider, isLocal);
                if (dlg.ShowDialog() != DialogResult.OK)
                {
                    return(null);                       // leave where it is.
                }
                return(PerformMoveCopyOrLeaveFile(sFile, subFolder, dlg.Choice));
            }
        }
Exemplo n.º 49
0
		public FwFdoUI(IHelpTopicProvider helpTopicProvider, ISynchronizeInvoke synchronizeInvoke)
		{
			m_helpTopicProvider = helpTopicProvider;
			m_synchronizeInvoke = synchronizeInvoke;
			m_activityMonitor = new UserActivityMonitor();
			m_activityMonitor.StartMonitoring();
		}
Exemplo n.º 50
0
		///-------------------------------------------------------------------------------
		/// <summary>
		/// Constructor for import dialog, requiring a language project.
		/// Use this constructor at run time.
		/// </summary>
		///-------------------------------------------------------------------------------
		public ImportDialog(FwStyleSheet styleSheet, FdoCache cache, IScrImportSet settings,
			IHelpTopicProvider helpTopicProvider, IApp app) : this()
		{
			m_StyleSheet = styleSheet;
			m_helpTopicProvider = helpTopicProvider;
			m_app = app;
			m_scr = cache.LangProject.TranslatedScriptureOA;
			m_importSettings = settings;

			//InitBookNameList();

			// Set the initial values for the controls from the static variables.
			radImportEntire.Checked = ImportEntire;
			radImportRange.Checked = !ImportEntire;
			chkTranslation.Checked = ImportTranslation;
			chkBackTranslation.Checked = ImportBackTranslation;
			chkBookIntros.Checked = ImportBookIntros;
			chkOther.Checked = ImportAnnotations;

			// Restore any saved settings.
			if (s_StartRef != null)
				StartRef = s_StartRef;
			else
				SetStartRefToFirstImportableBook();

			if (s_EndRef != null)
				EndRef = s_EndRef;
			else
				SetEndRefToLastImportableBook();

			// Finish constructing the ScrBookControl objects.
			InitializeStartAndEndRefControls();
		}
		private static string[] MoveCopyOrLeaveFiles(string[] files, string subFolder, string sRootDirExternalLinks,
			IHelpTopicProvider helpTopicProvider, bool isLocal)
		{
			try
			{
				if (!Directory.Exists(subFolder))
					Directory.CreateDirectory(subFolder);
			}
			catch (Exception e)
			{
				Logger.WriteEvent(string.Format("Error creating the directory: '{0}'", subFolder));
				Logger.WriteError(e);
				return files;
			}

			// Check whether the file is found within the directory.
			if (files.All(f => FileIsInExternalLinksFolder(f, sRootDirExternalLinks)))
				return files;

			using (var dlg = new MoveOrCopyFilesDlg())
			{
				dlg.Initialize2(subFolder, helpTopicProvider, isLocal);
				if (dlg.ShowDialog() == DialogResult.OK)
				{
					FileLocationChoice choice = dlg.Choice;
					return files.Select(f => PerformMoveCopyOrLeaveFile(f, subFolder, choice)).ToArray();
				}

				return files;
			}
		}
Exemplo n.º 52
0
		/// <summary>
		/// Constructor for Morph Break Helper Context Menu
		/// </summary>
		/// <param name="textbox">the textbox to insert regex characters into</param>
		/// <param name="helpTopicProvider">usually IHelpTopicProvider.App</param>
		/// <param name="cache">cache</param>
		/// <param name="stringTable">stringTable</param>
		public MorphBreakHelperMenu(FwTextBox textbox, IHelpTopicProvider helpTopicProvider, FdoCache cache, StringTable stringTable)
			: base(textbox, helpTopicProvider)
		{
			m_cache = cache;
			m_stringTable = stringTable;
			Init();
		}
Exemplo n.º 53
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="featSys"></param>
        /// <param name="mediator"></param>
        /// <param name="launchedFromInsertMenu"></param>
        /// <param name="sWindowKey">used to store location and size of dialog window</param>
        /// <param name="sXmlFile">file containing the XML form of the gloss list</param>
        public void SetDlginfo(IFsFeatureSystem featSys, Mediator mediator, bool launchedFromInsertMenu, string sWindowKey, string sXmlFile)
        {
            CheckDisposed();

            m_featureSystem          = featSys;
            m_featureList            = featSys.FeaturesOC;
            m_launchedFromInsertMenu = launchedFromInsertMenu;
            m_mediator = mediator;
            if (mediator != null)
            {
                m_sWindowKeyLocation = sWindowKey + "Location";
                m_sWindowKeySize     = sWindowKey + "Size";

                ResetWindowLocationAndSize();

                m_helpTopicProvider        = m_mediator.HelpTopicProvider;
                helpProvider               = new HelpProvider();
                helpProvider.HelpNamespace = m_helpTopicProvider.HelpFile;
                helpProvider.SetHelpKeyword(this, m_helpTopicProvider.GetHelpString(s_helpTopic));
                helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            }
            m_cache = featSys.Cache;
            LoadMasterFeatures(sXmlFile);
            m_tvMasterList.Cache = m_cache;
        }
Exemplo n.º 54
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Initializes a new instance of the <see cref="BookPropertiesDialog"/> class.
        /// </summary>
        /// <param name="book">the current book</param>
        /// <param name="stylesheet">The stylesheet.</param>
        /// <param name="helpTopicProvider">The help topic provider.</param>
        /// ------------------------------------------------------------------------------------
        public BookPropertiesDialog(IScrBook book, IVwStylesheet stylesheet, IHelpTopicProvider helpTopicProvider)
        {
            m_currentBook       = book;
            m_helpTopicProvider = helpTopicProvider;
            // TE-5663: make sure the book's name and abbreviation are updated if some were added
            IScrRefSystem scrRefSystem = book.Cache.ServiceLocator.GetInstance <IScrRefSystemRepository>().AllInstances().FirstOrDefault();

            book.Name.MergeAlternatives(scrRefSystem.BooksOS[book.CanonicalNum - 1].BookName);
            book.Abbrev.MergeAlternatives(scrRefSystem.BooksOS[book.CanonicalNum - 1].BookAbbrev);

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            // Put the book name in the dialog caption
            Text = string.Format(Text, book.Name.UserDefaultWritingSystem.Text);

            m_listBookInfo.Cache = book.Cache;
            m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
                                                   ScrBookTags.kflidName, TeResourceHelper.GetResourceString("kstidBookNameColHeader"), 60));
            m_listBookInfo.FieldsToDisplay.Add(new FwMultilingualPropView.ColumnInfo(
                                                   ScrBookTags.kflidAbbrev, TeResourceHelper.GetResourceString("kstidBookAbbrevColHeader"), 40));
            m_listBookInfo.RootObject = book.Hvo;

            foreach (IWritingSystem ws in book.Cache.ServiceLocator.WritingSystems.AllWritingSystems)
            {
                m_listBookInfo.WritingSystemsToDisplay.Add(ws.Handle);
            }

            // Initialize the ID textbox.
            m_txtScrBookIdText.Text = m_currentBook.IdText;
        }
Exemplo n.º 55
0
        /// <summary>
        /// Initialize the dialog.
        /// </summary>
        public void SetValues(bool fHaveOCM, bool fHaveFRAME, List <string> rgsAnthroFiles,
                              IHelpTopicProvider helpTopicProvider)
        {
            m_radioOCM.Enabled   = fHaveOCM;
            m_radioFRAME.Enabled = fHaveFRAME;
            m_helpTopicProvider  = helpTopicProvider;

            m_radioOther.Checked = false;
            if (rgsAnthroFiles.Count == 0)
            {
                m_radioOther.Enabled = false;
                m_radioOther.Visible = false;
                m_cbOther.Enabled    = false;
                m_cbOther.Visible    = false;
                var diff = m_btnOK.Location.Y - m_cbOther.Location.Y;
                Size = new Size(Width, Height - diff);
            }
            else
            {
                for (int i = 0; i < rgsAnthroFiles.Count; ++i)
                {
                    m_cbOther.Items.Add(rgsAnthroFiles[i]);
                }
                m_cbOther.SelectedIndex = 0;
            }
        }
Exemplo n.º 56
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="LexReferenceDetailsDlg"/> class.
		/// </summary>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public LexReferenceDetailsDlg(IHelpTopicProvider helpTopicProvider) : this()
		{
			m_helpTopicProvider = helpTopicProvider;
			helpProvider = new HelpProvider();
			helpProvider.HelpNamespace = helpTopicProvider.HelpFile;
			helpProvider.SetHelpKeyword(this, helpTopicProvider.GetHelpString(s_helpTopic));
			helpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
		}
Exemplo n.º 57
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="SymbolChooserDlg"/> class by passing
		/// the font used in the glyph grid.
		/// </summary>
		/// <param name="font">Font used in the glyph grid.</param>
		/// <param name="cpe">An ILgCharacterPropertyEngine. Set this to null to use the
		/// .Net methods for determining whether or not a codepoint should be added to
		/// the grid.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// ------------------------------------------------------------------------------------
		public SymbolChooserDlg(Font font, ILgCharacterPropertyEngine cpe, IHelpTopicProvider helpTopicProvider)
			: this()
		{
			m_helpTopicProvider = helpTopicProvider;
			charGrid.CharPropEngine = cpe;
			charGrid.Font = font;
			lblFontName.Text = font.Name;
		}
		/// <summary>
		/// Checks to see whether the given file is located in the given root directory (or any subfolder of it), and if not, prompts the user to
		/// allow FW to move, copy, or leave the file. If anything unexpected happens, the default is to leave the file where it is.
		/// </summary>
		/// <param name="sFile">The fully-specified path name of the file.</param>
		/// <param name="sRootDirLinkedFiles">The fully-specified path name of the LinkedFiles root directory.</param>
		/// <param name="helpTopicProvider">The help topic provider.</param>
		/// <param name="isLocal">True if running on the local server: allows file not to be moved or copied</param>
		/// <returns>The fully specified path name of the file to use, which might be the same as the given path or it could be
		/// in its new location under the LinkedFiles folder if the user elected to move or copy it.</returns>
		public static string MoveCopyOrLeaveExternalFile(string sFile, string sRootDirLinkedFiles,
			IHelpTopicProvider helpTopicProvider, bool isLocal)
		{
			return MoveCopyOrLeaveFiles(new[] {sFile},
				Path.Combine(sRootDirLinkedFiles, FdoFileHelper.ksOtherLinkedFilesDir),
				sRootDirLinkedFiles,
				helpTopicProvider, isLocal).FirstOrDefault();
		}
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="T:FixedOrphanFootnoteReportDlg"/> class.
		/// </summary>
		/// <param name="issues">List of styles that the user has modified.</param>
		/// <param name="projectName">Name of the project.</param>
		/// <param name="helpTopicProvider">context sensitive help</param>
		/// ------------------------------------------------------------------------------------
		public FixedOrphanFootnoteReportDlg(List<string> issues, string projectName,
			IHelpTopicProvider helpTopicProvider) :
			base(issues, projectName, helpTopicProvider)
		{
			InitializeComponent();
			RepeatTitleOnEveryPage = true;
			RepeatColumnHeaderOnEveryPage = false;
		}
Exemplo n.º 60
0
		/// <summary>
		/// Constructor.
		/// </summary>
		public ImportXmlDialog(FdoCache cache, IHelpTopicProvider helpTopicProvider)
		{
			m_cache = cache;
			m_helpTopicProvider = helpTopicProvider;
			InitializeComponent();
			m_sDescriptionFmt = m_lblDescription.Text;
			m_lblDescription.Text = "";
		}