/// <summary> /// Receives the broadcast message "PropertyChanged" /// </summary> public override void OnPropertyChanged(string name) { CheckDisposed(); var window = m_propertyTable.GetValue <FwXWindow>("window"); if (window != null) { window.ClearInvalidatedStoredData(); } switch (name) { default: base.OnPropertyChanged(name); break; case "ReversalIndexGuid": ChangeOwningObjectIfPossible(); break; case "ToolForAreaNamed_lexicon": int rootIndex = GetRootIndex(m_list.CurrentIndex); JumpToIndex(rootIndex); base.OnPropertyChanged(name); break; case "ActiveClerk": RecordClerk activeClerk = m_propertyTable.GetValue <RecordClerk>("ActiveClerk"); if (activeClerk == this) { ChangeOwningObjectIfPossible(); } else { base.OnPropertyChanged(name); } break; case "ReversalIndexPublicationLayout": // When the user chooses a different reversal index configuration from the drop-down menu, // set the list of associated reversal index entries. DictionaryConfigurationUtils.SetReversalIndexGuidBasedOnReversalIndexConfiguration(m_propertyTable, Cache); break; } }
/// <summary> /// This is called when XCore wants to display something that relies on the list with the /// id "ReversalIndexList" /// </summary> /// <param name="parameter"></param> /// <param name="display"></param> /// <returns></returns> public bool OnDisplayReversalIndexList(object parameter, ref UIListDisplayProperties display) { CheckDisposed(); var configObjectName = XmlUtils.GetOptionalAttributeValue(m_configurationParameters, "configureObjectName", null); configObjectName = "ReversalIndex"; var cache = m_propertyTable.GetValue <LcmCache>("cache"); var reversalIndexConfigurations = SIL.FieldWorks.XWorks.DictionaryConfigurationUtils.GatherBuiltInAndUserConfigurations(cache, configObjectName); // Add menu items that display the configuration name and send PropChanges with // the configuration path. foreach (var config in reversalIndexConfigurations) { display.List.Add(config.Key, config.Value, null, null); } DictionaryConfigurationUtils.RemoveAllReversalChoiceFromList(ref display); return(true); // We handled this, no need to ask anyone else. }