protected override void HandleChooser()
		{
			const string displayWs = "best analysis";
			var sense = m_obj as ILexSense;
			if (sense == null)
			{
				Debug.Assert(sense != null, "This chooser can only be applied to senses");
				// ReSharper disable HeuristicUnreachableCode
				//reachable in release mode you usually intelligent program.
				return;
				// ReSharper restore HeuristicUnreachableCode
			}
			var linkCommandNode = m_configurationNode.SelectSingleNode("descendant::chooserLink");
			var chooser = new SemanticDomainsChooser
				{ Mediator = m_mediator, Cache = m_cache, DisplayWs = displayWs, Sense = sense,
					LinkNode = linkCommandNode, HelpTopicProvider = m_mediator.HelpTopicProvider
			};

			var labels = ObjectLabel.CreateObjectLabels(m_cache, m_obj.ReferenceTargetCandidates(m_flid),
				m_displayNameProperty, displayWs);
			chooser.Initialize(labels, sense.SemanticDomainsRC);
			var result = chooser.ShowDialog();
			if(result == DialogResult.OK)
			{
				UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW(Resources.DetailControlsStrings.ksUndoSet,
																Resources.DetailControlsStrings.ksRedoSet,
																m_cache.ActionHandlerAccessor,
																() => sense.SemanticDomainsRC.Replace(sense.SemanticDomainsRC, chooser.SemanticDomains));
			}
		}
Example #2
0
        protected override void HandleChooser()
        {
            const string displayWs = "best analysis";
            var          sense     = m_obj as ILexSense;

            if (sense == null)
            {
                Debug.Assert(sense != null, "This chooser can only be applied to senses");
                // ReSharper disable HeuristicUnreachableCode
                //reachable in release mode you usually intelligent program.
                return;
                // ReSharper restore HeuristicUnreachableCode
            }
            var linkCommandNode = m_configurationNode.SelectSingleNode("descendant::chooserLink");
            var chooser         = new SemanticDomainsChooser
            {
                Mediator = m_mediator, Cache = m_cache, DisplayWs = displayWs, Sense = sense,
                LinkNode = linkCommandNode, HelpTopicProvider = m_mediator.HelpTopicProvider
            };

            var labels = ObjectLabel.CreateObjectLabels(m_cache, m_obj.ReferenceTargetCandidates(m_flid),
                                                        m_displayNameProperty, displayWs);

            chooser.Initialize(labels, sense.SemanticDomainsRC);
            var result = chooser.ShowDialog();

            if (result == DialogResult.OK)
            {
                UndoableUnitOfWorkHelper.DoUsingNewOrCurrentUOW(Resources.DetailControlsStrings.ksUndoSet,
                                                                Resources.DetailControlsStrings.ksRedoSet,
                                                                m_cache.ActionHandlerAccessor,
                                                                () => sense.SemanticDomainsRC.Replace(sense.SemanticDomainsRC, chooser.SemanticDomains));
            }
        }