/// ------------------------------------------------------------------------------------ /// <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)); } }
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; } }
public void Init(Mediator mediator, XmlNode configurationNode, ICmObject sourceObject) { CheckDisposed(); m_cache = sourceObject.Cache; // Find the sense we want examples for, which depends on the kind of source object. if (sourceObject is ILexExampleSentence) { m_les = sourceObject as ILexExampleSentence; m_owningSense = (ILexSense)m_les.Owner; } else if (sourceObject is ILexSense) { m_owningSense = sourceObject as ILexSense; } else { throw new ArgumentException("Invalid object type for sourceObject."); } m_mediator = mediator; m_configurationNode = configurationNode; helpProvider.SetHelpNavigator(this, HelpNavigator.Topic); helpProvider.SetShowHelp(this, true); if (m_mediator.HelpTopicProvider != null) { helpProvider.HelpNamespace = m_mediator.HelpTopicProvider.HelpFile; helpProvider.SetHelpKeyword(this, m_mediator.HelpTopicProvider.GetHelpString(m_helpTopic)); btnHelp.Enabled = true; } AddConfigurableControls(); }
public override void AddToDatabase(FdoCache cache) { if (m_fInDatabase) return; // It's already in the database, so nothing more can be done. using (var undoHelper = new UndoableUnitOfWorkHelper( cache.ServiceLocator.GetInstance<IActionHandler>(), MGAStrings.ksUndoCreateInflectionFeature, MGAStrings.ksRedoCreateInflectionFeature)) { m_featDefn = cache.LanguageProject.MsFeatureSystemOA.AddFeatureFromXml(m_node); // Attempt to add feature to category as an inflectable feature var sPosId = XmlUtils.GetOptionalAttributeValue(m_node, "posid"); var node = m_node; while (node.ParentNode != null && sPosId == null) { node = node.ParentNode; sPosId = XmlUtils.GetOptionalAttributeValue(node, "posid"); } foreach (IPartOfSpeech pos in cache.LanguageProject.PartsOfSpeechOA.ReallyReallyAllPossibilities) { if (pos.CatalogSourceId == sPosId) { pos.InflectableFeatsRC.Add(m_featDefn); break; } } undoHelper.RollBack = false; } }
///------------------------------------------------------------------------------- /// <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(); }
public ComplexConcPatternModel(FdoCache cache, ComplexConcPatternNode root) { m_cache = cache; m_root = root; m_spanFactory = new ShapeSpanFactory(); m_sda = new ComplexConcPatternSda((ISilDataAccessManaged) cache.DomainDataByFlid, m_root); }
/// <summary> /// when calling the dialog from an "Insert Variant" context this /// constructor is used to indicate that m_startingEntry is a componentLexeme /// rather than the variant /// </summary> /// <param name="cache"></param> /// <param name="mediator"></param> /// <param name="componentLexeme">the entry we wish to find or create a variant for.</param> protected void SetDlgInfoForComponentLexeme(FdoCache cache, Mediator mediator, IVariantComponentLexeme componentLexeme) { m_fBackRefToVariant = true; ILexEntry startingEntry = null; if (componentLexeme.ClassID == LexEntry.kclsidLexEntry) { startingEntry = componentLexeme as LexEntry; } else { int hvoEntry = cache.GetOwnerOfObjectOfClass(componentLexeme.Hvo, LexEntry.kclsidLexEntry); if (hvoEntry != 0) startingEntry = LexEntry.CreateFromDBObject(cache, hvoEntry); } base.SetDlgInfo(cache, mediator, startingEntry); // we are looking for an existing variant form // so hide the Entry/Sense radio group box. grplbl.Visible = false; // also hide variant type. tcVariantTypes.Visible = false; lblVariantType.Visible = false; m_fGetVariantEntryTypeFromTreeCombo = false; lblCreateEntry.Visible = false; // The dialog title and other labels need to reflect "Insert Variant" context. m_formLabel.Text = LexTextControls.ks_Variant; this.Text = LexTextControls.ksFindVariant; btnInsert.Text = LexTextControls.ks_Create; // We disable the "Create" button when we don't have text in the Find textbox. UpdateButtonCreateNew(); }
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(); }
/// ------------------------------------------------------------------------------------ /// <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; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Constructor based on a ScrSfFileList /// </summary> /// <param name="fileList">The list of files</param> /// ------------------------------------------------------------------------------------ public ImportFileSource(ScrSfFileList fileList) { Debug.Assert(fileList != null); m_cache = null; m_sourceTable = null; m_fileList = fileList; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Constructor based on a hashtable which maps HVOs of ScrImportSource objects to /// ScrSfFileList objects /// </summary> /// <param name="sourceTable">The hashtable</param> /// <param name="cache">The FDO cache needed for interpreting the HVOs</param> /// ------------------------------------------------------------------------------------ public ImportFileSource(Hashtable sourceTable, FdoCache cache) { Debug.Assert(sourceTable != null); m_cache = cache; m_sourceTable = sourceTable; m_fileList = null; }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the <see cref="T:MultipleFilterDlg"/> class. /// </summary> /// ------------------------------------------------------------------------------------ public MultipleFilterDlg(FdoCache cache, ICmFilter filter) : this() { m_cache = cache; m_scr = (Scripture)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 = ScrReference.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), m_scr, false); scrBookTo.Initialize(new ScrReference(lastBook, 1, 0, m_scr.Versification).LastReferenceForBook, m_scr, false); // Update the controls from the filter in the database. InitializeFromFilter(); chkCategory.Checked = tvCatagories.Load(m_cache, m_filter, null); chkCategory_CheckedChanged(null, null); }
public InfoPane(FdoCache cache, Mediator mediator, RecordClerk clerk) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); Initialize(cache, mediator, clerk); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Initializes a new instance of the FootnoteView class /// </summary> /// <param name="cache">The cache.</param> /// <param name="filterInstance">The tag that identifies the book filter instance.</param> /// <param name="app">The application.</param> /// <param name="viewName">The name of the view.</param> /// <param name="fEditable"><c>true</c> if view is to be editable.</param> /// <param name="viewType">Bit-flags indicating type of view.</param> /// <param name="btWs">The back translation writing system (if needed).</param> /// <param name="draftView">The corresponding draftview pane</param> /// ------------------------------------------------------------------------------------ public FootnoteView(FdoCache cache, int filterInstance, IApp app, string viewName, bool fEditable, TeViewType viewType, int btWs, DraftView draftView) : base(cache, filterInstance, app, viewName, fEditable, viewType, btWs) { Debug.Assert((viewType & TeViewType.FootnoteView) != 0); m_draftView = draftView; }
internal InterAreaBookmark(InterlinMaster interlinMaster, Mediator mediator, FdoCache cache) // For restoring { // Note: resist any temptation to save mediator in a memer variable. Bookmarks are kept in a static dictionary // and may well have a longer life than the mediator. There is danger of using if after it is disposed. See LT-12435. Init(interlinMaster, cache); Restore(interlinMaster.IndexOfTextRecord, mediator); }
public void Initialize(ICmObject rootObj, int rootFlid, string rootFieldName, FdoCache cache, string displayNameProperty, Mediator mediator, string displayWs) { CheckDisposed(); m_displayWs = displayWs; Initialize(rootObj, rootFlid, rootFieldName, cache, displayNameProperty, mediator); }
public override void FixtureSetup() { string partDirectory = Path.Combine(SIL.FieldWorks.Common.Utils.DirectoryFinder.FwSourceDirectory, @"common\controls\detailcontrols\detailcontrolstests"); Dictionary<string, string[]> keyAttrs = new Dictionary<string, string[]>(); keyAttrs["layout"] = new string[] {"class", "type", "name" }; keyAttrs["group"] = new string[] {"label"}; keyAttrs["part"] = new string[] {"ref"}; string configurationDir = Path.Combine(SIL.FieldWorks.Common.Utils.DirectoryFinder.FWCodeDirectory, @"Language Explorer\Configuration"); m_stringTable = new SIL.Utils.StringTable(configurationDir); m_layouts = new Inventory(new string[] {partDirectory}, "*Layouts.xml", "/LayoutInventory/*", keyAttrs); keyAttrs = new Dictionary<string, string[]>(); keyAttrs["part"] = new string[] {"id"}; m_parts = new Inventory(new string[] {partDirectory}, "*Parts.xml", "/PartInventory/bin/*", keyAttrs); m_cache = FdoCache.Create("TestLangProj"); m_entry = new LexEntry(); m_cache.LangProject.LexDbOA.EntriesOC.Add(m_entry); m_entry.CitationForm.VernacularDefaultWritingSystem = "rubbish"; // We set both alternatives because currently the default part for Bibliography uses vernacular, // but I think this will probably get fixed. Anyway, this way the test is robust. m_entry.Bibliography.SetAnalysisDefaultWritingSystem("My rubbishy bibliography"); m_entry.Bibliography.SetVernacularDefaultWritingSystem("My rubbishy bibliography"); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// <param name="cache"></param> /// <param name="filter">book filter in place</param> /// <param name="bookID">ordinal ID of the book being removed</param> /// ------------------------------------------------------------------------------------ public UndoRemoveBookAction(FdoCache cache, FilteredScrBooks filter, int bookID) { m_cache = cache; m_bookFilter = filter; m_bookID = bookID; m_bookHvo = ScrBook.FindBookByID(m_cache, bookID).Hvo; }
/// <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(); }
protected override void GetSegmentLevelTags(FdoCache cache) { // for PrintView vtagStTextTitle = cache.MetaDataCacheAccessor.GetFieldId("StText", "Title", false); vtagStTextSource = cache.MetaDataCacheAccessor.GetFieldId("StText", "Source", false); base.GetSegmentLevelTags(cache); }
public InflAffixTemplateControl(FdoCache cache, int hvoRoot, XmlNode xnSpec, StringTable stringTable) : base(hvoRoot, XmlUtils.GetAttributeValue(xnSpec, "layout"), stringTable, true) { m_xnSpec = xnSpec["deParams"]; Cache = cache; m_template = Cache.ServiceLocator.GetInstance<IMoInflAffixTemplateRepository>().GetObject(m_hvoRoot); }
protected override void DoRun(ILfProject project) { // TODO: These checks might be overkill; consider removing some of them Logger.Debug("FdoToMongo: starting"); FwProject fwProject = project.FieldWorksProject; if (fwProject == null) { Logger.Error("Can't find FieldWorks project {0}", project.ProjectCode); return; } Logger.Debug("FdoToMongo: getting cache"); _cache = fwProject.Cache; if (_cache == null) { Logger.Error("Can't find cache for FieldWorks project {0}", project.ProjectCode); return; } Logger.Debug("FdoToMongo: serviceLocator"); _servLoc = _cache.ServiceLocator; if (_servLoc == null) { Logger.Error("Can't find service locator for FieldWorks project {0}", project.ProjectCode); return; } _lexiconConverter = new ConvertFdoToMongoLexicon(project, Logger, _connection); _lexiconConverter.RunConversion(); }
/// <summary> /// Create and initialize the browse view, storing the data it will display. /// </summary> /// <param name="cache">The cache.</param> /// <param name="stylesheet">The stylesheet.</param> /// <param name="mediator">The mediator.</param> /// <param name="xnConfig">The config node.</param> /// <param name="objs">The objs.</param> public void Initialize(FdoCache cache, IVwStylesheet stylesheet, Mediator mediator, XmlNode xnConfig, IEnumerable<ICmObject> objs) { CheckDisposed(); m_cache = cache; m_stylesheet = stylesheet; m_mediator = mediator; m_configNode = xnConfig; SuspendLayout(); m_listPublisher = new ObjectListPublisher(cache.DomainDataByFlid as ISilDataAccessManaged, ObjectListFlid); StoreData(objs); m_bvList = new BrowseViewer(m_configNode, m_cache.LanguageProject.Hvo, ObjectListFlid, m_cache, m_mediator, null, m_listPublisher); m_bvList.Location = new Point(0, 0); m_bvList.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right; m_bvList.Name = "m_bvList"; m_bvList.Sorter = null; m_bvList.TabStop = true; m_bvList.StyleSheet = m_stylesheet; m_bvList.Dock = DockStyle.Fill; m_bvList.SelectionChanged += m_bvList_SelectionChanged; Controls.Add(m_bvList); ResumeLayout(false); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Constructs a EmptyTePrintLayoutConfigurer to configure the main print layout /// </summary> /// <param name="cache">The cache.</param> /// <param name="styleSheet">The style sheet.</param> /// <param name="viewType">Type of the view.</param> /// ------------------------------------------------------------------------------------ public EmptyTePrintLayoutConfigurer(FdoCache cache, IVwStylesheet styleSheet, TeViewType viewType) { m_fdoCache = cache; m_styleSheet = styleSheet; m_viewType = viewType; }
public MGAHtmlHelpDialog(FdoCache cache, Mediator mediator, string sMorphemeForm) : base(cache, mediator, sMorphemeForm) { #if __MonoCS__ m_browser = new GeckoWebBrowser { Dock = DockStyle.Fill, Location = new Point(0, 0), TabIndex = 1, MinimumSize = new Size(20, 20), NoDefaultContextMenu = true }; splitContainerHorizontal.Panel2.Controls.Add(m_browser); #else m_webBrowserInfo = new WebBrowser { Dock = DockStyle.Fill, Location = new Point(0, 0), TabIndex = 1, IsWebBrowserContextMenuEnabled = false, MinimumSize = new Size(20, 20), Name = "webBrowserInfo", WebBrowserShortcutsEnabled = false }; splitContainerHorizontal.Panel2.Controls.Add(m_webBrowserInfo); #endif }
/// <summary> /// Create a new one. /// </summary> /// <param name="cache"></param> /// <param name="ss"></param> /// <param name="choices"></param> /// <param name="analysis"></param> /// <param name="mediator"></param> public TryAWordSandbox(FdoCache cache, Mediator mediator, IVwStylesheet ss, InterlinLineChoices choices, IAnalysis analysis) : base(cache, mediator, ss, choices) { SizeToContent = true; LoadForWordBundleAnalysis(analysis.Hvo); }
/// ------------------------------------------------------------------------------------ /// <summary> /// Exposes the <see cref="TeScrInitializer.CreateScrBookRefs"/> method /// </summary> /// <param name="cache"></param> /// ------------------------------------------------------------------------------------ public void CallCreateScrBookRefs(FdoCache cache) { using (ProgressDialogWithTask progressDlg = new ProgressDialogWithTask(Form.ActiveForm)) { CreateScrBookRefs(progressDlg); } }
/// <summary> /// From IFwExtension /// </summary> /// <param name="cache"></param> /// <param name="mediator"></param> void IFwExtension.Init(FdoCache cache, Mediator mediator) { m_cache = cache; m_mediator = mediator; string sPrevFile = m_mediator.PropertyTable.GetStringProperty(FilePropertyName, null); if (!String.IsNullOrEmpty(sPrevFile)) { tbPath.Text = sPrevFile; UpdateButtons(); } string sMergeStyle = m_mediator.PropertyTable.GetStringProperty(MergeStylePropertyName, null); if (!String.IsNullOrEmpty(sMergeStyle)) { m_msImport = (FlexLiftMerger.MergeStyle)Enum.Parse(typeof(FlexLiftMerger.MergeStyle), sMergeStyle, true); switch (m_msImport) { case FlexLiftMerger.MergeStyle.MsKeepOld: m_rbKeepCurrent.Checked = true; break; case FlexLiftMerger.MergeStyle.MsKeepNew: m_rbKeepNew.Checked = true; break; case FlexLiftMerger.MergeStyle.MsKeepBoth: m_rbKeepBoth.Checked = true; break; default: m_rbKeepCurrent.Checked = true; break; } } }
/// ------------------------------------------------------------------------------------ /// <summary> /// normal constructor. /// </summary> /// <param name="cache">The cache.</param> /// <param name="layoutName">Name of the layout.</param> /// <param name="colSpec">The col spec.</param> /// <param name="stringTbl">The string TBL.</param> /// ------------------------------------------------------------------------------------ public LayoutFinder(FdoCache cache, string layoutName, XmlNode colSpec, StringTable stringTbl) { m_layoutName = layoutName; m_colSpec = colSpec; m_stringTbl = stringTbl; Cache = cache; }
protected InterlinearExporter(FdoCache cache, XmlWriter writer, ICmObject objRoot, InterlinLineChoices lineChoices, InterlinVc vc) : base(null, cache.MainCacheAccessor, objRoot.Hvo) { m_cache = cache; m_writer = writer; m_flidStTextTitle = m_cache.MetaDataCacheAccessor.GetFieldId("StText", "Title", false); m_flidStTextSource = m_cache.MetaDataCacheAccessor.GetFieldId("StText", "Source", false); m_vc = vc; SetTextTitleAndMetadata(objRoot as IStText); // Get morphtype information that we need later. (plus stuff we don't...) See LT-8288. IMoMorphType mmtStem; IMoMorphType mmtPrefix; IMoMorphType mmtSuffix; IMoMorphType mmtInfix; IMoMorphType mmtBoundStem; IMoMorphType mmtSimulfix; IMoMorphType mmtSuprafix; m_cache.ServiceLocator.GetInstance<IMoMorphTypeRepository>().GetMajorMorphTypes( out mmtStem, out mmtPrefix, out mmtSuffix, out mmtInfix, out mmtBoundStem, out m_mmtProclitic, out m_mmtEnclitic, out mmtSimulfix, out mmtSuprafix); m_wsManager = m_cache.ServiceLocator.WritingSystemManager; m_repoObj = m_cache.ServiceLocator.GetInstance<ICmObjectRepository>(); }
void IFwExtension.Init(SIL.FieldWorks.FDO.FdoCache cache, XCore.Mediator mediator) { m_mediator = mediator; m_cache = cache; m_sUserWs = SIL.FieldWorks.Common.Framework.FwApp.UserWs; m_sNewUserWs = m_sUserWs; m_userInterfaceChooser.Init(m_sUserWs); //PopulateLanguagesCombo(); // Populate Plugins tab page list. string baseConfigPath = DirectoryFinder.GetFWCodeSubDirectory(@"Language Explorer\Configuration"); string basePluginPath = Path.Combine(baseConfigPath, "Available Plugins"); // The extension XML files should be stored in the data area, not in the code area. // This reduces the need for users to have administrative privileges. string baseExtensionPath = Path.Combine(DirectoryFinder.FWDataDirectory, @"Language Explorer\Configuration"); foreach (string dir in Directory.GetDirectories(basePluginPath)) { Debug.WriteLine(dir); string managerPath = Path.Combine(dir, "ExtensionManager.xml"); if (File.Exists(managerPath)) { XmlDocument managerDoc = new XmlDocument(); managerDoc.Load(managerPath); XmlNode managerNode = managerDoc.SelectSingleNode("/manager"); m_lvPlugins.SuspendLayout(); ListViewItem lvi = new ListViewItem(); lvi.Tag = managerDoc; lvi.Text = managerNode.Attributes["name"].Value; lvi.SubItems.Add(managerNode.Attributes["description"].Value); // See if it is installed and check the lvi if it is. XmlNode configfilesNode = managerNode.SelectSingleNode("configfiles"); string extensionPath = Path.Combine(baseExtensionPath, configfilesNode.Attributes["targetdir"].Value); lvi.Checked = Directory.Exists(extensionPath); m_plugins.Add(lvi.Text, lvi.Checked); // Remember original installed state. m_lvPlugins.Items.Add(lvi); m_lvPlugins.ResumeLayout(); } } }
/// <summary> /// Constructor. /// </summary> /// <param name="cache"></param> public RfcWritingSystem(FdoCache cache) { Initialize(cache, true); }
/// <summary> /// Constructor. /// </summary> /// <param name="cache">FDO Cache object.</param> /// <param name="hvo">ID of the database object.</param> /// <param name="displayNameProperty">property name to display</param> public CmPossibilityLabel(FdoCache cache, int hvo, string displayNameProperty) : base(cache, hvo, displayNameProperty) { }
/// <summary> /// Constructor. /// </summary> /// <param name="cache"></param> /// <param name="fUpdateVernWss"></param> public RfcWritingSystem(FdoCache cache, bool fUpdateVernWss) { Initialize(cache, fUpdateVernWss); }
/// <summary> /// Given a set of hvos, create a collection of labels for them using the default /// display name and writing system properties. /// </summary> /// <returns>An ObjectLabelCollection of ObjectLabel structs.</returns> public ObjectLabelCollection(FdoCache cache, Set <int> hvos) { Init(new List <int>(hvos.ToArray()), cache, null, null, false); }
/// <summary> /// Constructor. /// </summary> /// <param name="cache">FDO Cache object.</param> /// <param name="hvo">ID of the database object.</param> /// <param name="displayNameProperty">property name to display</param> public MoInflClassLabel(FdoCache cache, int hvo, string displayNameProperty) : base(cache, hvo, displayNameProperty) { }
/// <summary> /// Get a set of hvos, create a collection of labels for them using the best available /// writing system property. /// </summary> /// <returns>An ObjectLabelCollection of ObjectLabel structs.</returns> public ObjectLabelCollection(FdoCache cache, Set <int> hvos, string displayNameProperty) { Init(new List <int>(hvos.ToArray()), cache, displayNameProperty, "best analorvern", false); }
/// <summary> /// Constructor. /// </summary> public NullObjectLabel(FdoCache cache) : base(cache, 0, null) { }
/// <summary> /// Get a list of hvos, create a collection of labels for them. /// </summary> /// <returns>An ObjectLabelCollection of ObjectLabel structs.</returns> public ObjectLabelCollection(FdoCache cache, List <int> hvos, string displayNameProperty, string displayWs) { Init(hvos, cache, displayNameProperty, displayWs, false); }
/// <summary> /// Given a list of hvos, create a collection of labels for them using the default /// display name and writing system properties. /// </summary> /// <returns>An ObjectLabelCollection of ObjectLabel structs.</returns> public ObjectLabelCollection(FdoCache cache, List <int> hvos) { Init(hvos, cache, null, null, false); }
/// <summary> /// Get a list of hvos, create a collection of labels for them. /// </summary> /// <returns>An ObjectLabelCollection of ObjectLabel structs.</returns> public ObjectLabelCollection(FdoCache cache, List <int> hvos, string displayNameProperty, string displayWs, bool fIncludeNone) { Init(hvos, cache, displayNameProperty, displayWs, fIncludeNone); }
/// <summary> /// Get a list of hvos, create a collection of labels for them using the best available /// writing system property. /// </summary> /// <returns>An ObjectLabelCollection of ObjectLabel structs.</returns> public ObjectLabelCollection(FdoCache cache, List <int> hvos, string displayNameProperty) { Init(hvos, cache, displayNameProperty, "best analorvern", false); }
/// <summary> /// Constructor. /// </summary> /// <param name="cache">FDO Cache object.</param> /// <param name="hvo">ID of the database object.</param> /// <param name="displayNameProperty">the property to use to get the label.</param> protected ObjectLabel(FdoCache cache, int hvo, string displayNameProperty) { InitializeNew(displayNameProperty, cache, "analysis", hvo); }
/// <summary> /// Get a set of hvos, create a collection of labels for them. /// </summary> /// <returns>An ObjectLabelCollection of ObjectLabel structs.</returns> public ObjectLabelCollection(FdoCache cache, Set <int> hvos, string displayNameProperty, string displayWs, bool fIncludeNone) { Init(new List <int>(hvos.ToArray()), cache, displayNameProperty, displayWs, fIncludeNone); }
/// <summary> /// a factory method for creating the correct type of object label, depending on the /// class of the object /// </summary> static public ObjectLabel CreateObjectLabel(FdoCache cache, int hvo, string displayNameProperty) { return(CreateObjectLabel(cache, hvo, displayNameProperty, null)); }
/// <summary> /// Constructor. /// </summary> /// <param name="cache">FDO Cache object.</param> /// <param name="hvo">ID of the database object.</param> /// <param name="displayNameProperty">the property to use to get the label.</param> /// <param name="sDisplayWs">the ws to use to get the label.</param> protected ObjectLabel(FdoCache cache, int hvo, string displayNameProperty, string sDisplayWs) { InitializeNew(displayNameProperty, cache, sDisplayWs, hvo); }