public CommandTargetToOleShim(ITextView textView, ICommandTarget commandTarget) { _commandTarget = commandTarget; if (textView != null) { _variantStacks = CommandTargetToOleShimVariantStacks.EnsureConnected(textView); } }
public static CommandTargetToOleShimVariantStacks EnsureConnected(ITextView textView) { CommandTargetToOleShimVariantStacks stacks = null; if (!textView.Properties.TryGetProperty(typeof(CommandTargetToOleShimVariantStacks), out stacks)) { stacks = new CommandTargetToOleShimVariantStacks(); textView.Properties.AddProperty(typeof(CommandTargetToOleShimVariantStacks), stacks); } return stacks; }
public static CommandTargetToOleShimVariantStacks EnsureConnected(ITextView textView) { CommandTargetToOleShimVariantStacks stacks = null; if (!textView.Properties.TryGetProperty(typeof(CommandTargetToOleShimVariantStacks), out stacks)) { stacks = new CommandTargetToOleShimVariantStacks(); textView.Properties.AddProperty(typeof(CommandTargetToOleShimVariantStacks), stacks); } return(stacks); }
public OleToCommandTargetShim(ITextView textView, IOleCommandTarget oleTarget) { OleTarget = oleTarget; _variantStacks = CommandTargetToOleShimVariantStacks.EnsureConnected(textView); }