Пример #1
0
 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);
        }
Пример #4
0
 public OleToCommandTargetShim(ITextView textView, IOleCommandTarget oleTarget)
 {
     OleTarget      = oleTarget;
     _variantStacks = CommandTargetToOleShimVariantStacks.EnsureConnected(textView);
 }
Пример #5
0
 public CommandTargetToOleShim(ITextView textView, ICommandTarget commandTarget) {
     _commandTarget = commandTarget;
     if (textView != null) {
         _variantStacks = CommandTargetToOleShimVariantStacks.EnsureConnected(textView);
     }
 }
Пример #6
0
 public OleToCommandTargetShim(ITextView textView, IOleCommandTarget oleTarget) {
     OleTarget = oleTarget;
     _variantStacks = CommandTargetToOleShimVariantStacks.EnsureConnected(textView);
 }