/// <summary> /// Initialize. /// </summary> /// <param name="mediator"></param> /// <param name="configurationParameters"></param> public void Init(Mediator mediator, XmlNode configurationParameters) { CheckDisposed(); m_mediator = mediator; m_previousShowTreeBarValue = m_mediator.PropertyTable.GetBoolProperty("ShowRecordList", true); m_mediator.PropertyTable.SetProperty("ShowRecordList", false); m_configurationParameters = configurationParameters; mediator.AddColleague(this); m_mediator.PropertyTable.SetProperty("StatusPanelRecordNumber", ""); m_mediator.PropertyTable.SetPropertyPersistence("StatusPanelRecordNumber", false); #if notnow m_htmlControl.Browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(Browser_DocumentCompleted); #endif SetStrings(); ReadParameters(); DetermineNumberOfPrompts(); DetermineNumberOfTransforms(); SetAlsoSaveInfo(); ReadRegistry(); ShowSketch(); //add our current state to the history system string toolName = m_mediator.PropertyTable.GetStringProperty("currentContentControl", ""); FdoCache cache = Cache; m_mediator.SendMessage("AddContextToHistory", FwLink.Create(toolName, Guid.Empty, cache.ServerName, cache.DatabaseName), false); }
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { m_link = FwLink.Create("phonologicalFeaturesAdvancedEdit", m_cache.LangProject.PhFeatureSystemOA.Guid, m_cache.ServerName, m_cache.DatabaseName); m_btnCancel.PerformClick(); DialogResult = DialogResult.Ignore; }
public virtual bool OnContextJumpToPhoneme(object args) { CheckDisposed(); int hvo = RuleFormulaControl.CurrentContextHvo; IPhSimpleContextSeg ctxt = new PhSimpleContextSeg(m_cache, hvo); Mediator.PostMessage("FollowLink", FwLink.Create("phonemeEdit", m_cache.GetGuidFromId(ctxt.FeatureStructureRAHvo), m_cache.ServerName, m_cache.DatabaseName)); return(true); }
public virtual bool OnMappingJumpToPhoneme(object args) { CheckDisposed(); int hvo = RuleFormulaControl.CurrentHvo; IMoInsertPhones mapping = new MoInsertPhones(m_cache, hvo); Mediator.PostMessage("FollowLink", FwLink.Create("phonemeEdit", m_cache.GetGuidFromId(mapping.ContentRS[0].Hvo), m_cache.ServerName, m_cache.DatabaseName)); return(true); }
public bool OnMappingJumpToNaturalClass(object args) { CheckDisposed(); int hvo = RuleFormulaControl.CurrentHvo; IMoModifyFromInput mapping = new MoModifyFromInput(m_cache, hvo); Mediator.PostMessage("FollowLink", FwLink.Create("naturalClassedit", m_cache.GetGuidFromId(mapping.ModificationRAHvo), m_cache.ServerName, m_cache.DatabaseName)); return(true); }
public bool OnViewIncorrectWords(object argument) { FwLink link = FwLink.Create("Language Explorer", "Analyses", ActiveWordform(Cache), Cache.ServerName, Cache.DatabaseName); List <Property> additionalProps = link.PropertyTableEntries; additionalProps.Add(new Property("SuspendLoadListUntilOnChangeFilter", link.ToolName)); additionalProps.Add(new Property("LinkSetupInfo", "TeCorrectSpelling")); m_mediator.PostMessage("FollowLink", link); return(true); }
/// <summary> /// Called by reflection to implement the command. /// </summary> /// <param name="argument"></param> /// <returns></returns> public bool OnEditSpellingStatus(object argument) { // Without checking both the SpellingStatus and (virtual) FullConcordanceCount // fields for the ActiveWordform(Cache) result, it's too likely that the user // will get a puzzling "Target not found" message popping up. See LT-8717. FwLink link = FwLink.Create("Language Explorer", "toolBulkEditWordforms", Guid.Empty, Cache.ServerName, Cache.DatabaseName); List <Property> additionalProps = link.PropertyTableEntries; additionalProps.Add(new Property("SuspendLoadListUntilOnChangeFilter", link.ToolName)); additionalProps.Add(new Property("LinkSetupInfo", "TeReviewUndecidedSpelling")); m_mediator.PostMessage("FollowLink", link); return(true); }
/// <summary> /// /// </summary> /// <returns></returns> public bool OnTestFollowLink(object unused) { CheckDisposed(); FdoCache cache = (FdoCache)m_mediator.PropertyTable.GetValue("cache"); int[] hvos = cache.LangProject.LexDbOA.EntriesOC.HvoArray; m_mediator.SendMessage("FollowLink", FwLink.Create("lexiconEdit", cache.GetGuidFromId(hvos[hvos.Length - 1]) /*the last one*/, cache.ServerName, cache.DatabaseName)); return(true); }
/// <summary> /// create and register a URL describing the current context, for use in going backwards and forwards /// </summary> protected virtual void UpdateContextHistory() { //are we the dominant pane? The thinking here is that if our clerk is controlling the record tree bar, then we are. if (Clerk.IsControllingTheRecordTreeBar) { //add our current state to the history system string toolName = m_mediator.PropertyTable.GetStringProperty("currentContentControl", ""); int hvo = -1; if (Clerk.CurrentObject != null) { hvo = Clerk.CurrentObject.Hvo; } FdoCache cache = Cache; m_mediator.SendMessage("AddContextToHistory", FwLink.Create(toolName, cache.GetGuidFromId(hvo), cache.ServerName, cache.DatabaseName), false); } }
internal int DisplayChooser(string fieldName, string linkText, string toolName, string guiControl, Set <int> candidates) { int hvo = 0; ObjectLabelCollection labels = new ObjectLabelCollection(m_cache, candidates); using (SimpleListChooser chooser = new SimpleListChooser(m_persistenceProvider, labels, fieldName)) { chooser.Cache = m_cache; chooser.TextParamHvo = m_cache.LangProject.PhonologicalDataOAHvo; chooser.AddLink(linkText, SimpleListChooser.LinkType.kGotoLink, FwLink.Create(toolName, m_cache.GetGuidFromId(chooser.TextParamHvo), m_cache.ServerName, m_cache.DatabaseName)); chooser.ReplaceTreeView(m_mediator, guiControl); if (this.Parent is SIL.FieldWorks.XWorks.MorphologyEditor.RegRuleFormulaControl) { chooser.SetHelpTopic("khtpChoose-Grammar-PhonFeats-RegRuleFormulaControl"); } else if (this.Parent is SIL.FieldWorks.XWorks.MorphologyEditor.MetaRuleFormulaControl) { chooser.SetHelpTopic("khtpChoose-Grammar-PhonFeats-MetaRuleFormulaControl"); } else if (this.Parent is SIL.FieldWorks.XWorks.MorphologyEditor.MetaRuleFormulaControl) { chooser.SetHelpTopic("khtpChoose-LexiconEdit-PhonFeats-AffixRuleFormulaControl"); } DialogResult res = chooser.ShowDialog(); if (res != DialogResult.Cancel) { chooser.HandleAnyJump(); if (chooser.ChosenOne != null) { hvo = chooser.ChosenOne.Hvo; } } } return(hvo); }
protected override void ShowRecord() { RecordClerk clerk = Clerk; // See if it is showing the same record, as before. if (m_currentObject != null && clerk.CurrentObject != null && m_currentIndex == clerk.CurrentIndex && m_currentObject.Hvo == clerk.CurrentObject.Hvo) { SetInfoBarText(); return; } // See if the main owning object has changed. if (clerk.OwningObject.Hvo != m_hvoOwner) { m_hvoOwner = clerk.OwningObject.Hvo; m_mainView.ResetRoot(m_hvoOwner); } m_currentObject = clerk.CurrentObject; m_currentIndex = clerk.CurrentIndex; //add our current state to the history system string toolName = m_mediator.PropertyTable.GetStringProperty( "currentContentControl", ""); int hvo = -1; if (clerk.CurrentObject != null) { hvo = clerk.CurrentObject.Hvo; } FdoCache cache = Cache; m_mediator.SendMessage("AddContextToHistory", FwLink.Create(toolName, cache.GetGuidFromId(hvo), cache.ServerName, cache.DatabaseName), false); SelectAndScrollToCurrentRecord(); base.ShowRecord(); }