Esempio n. 1
0
        /// Initialization of the package; this method is called right after the
        /// package is sited, so this is the place where you can put all the
        /// initialization code that rely on services provided by VisualStudio.
        protected override async System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress)
        {
            await base.InitializeAsync(cancellationToken, progress);

            await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

            await RewrapCommand.InitializeAsync(this);

            await AutoWrapCommand.InitializeAsync(this);
        }
Esempio n. 2
0
        public void TextViewCreated(IWpfTextView textView)
        {
            // Some IWpfTextViews that get created aren't code windows (eg
            // tooltips in the "Find all references" pane). In these cases the
            // retrieved IVsTextView will be null, and we ignore it.
            var vsTextView = editorFactory.GetViewAdapter(textView);

            if (vsTextView != null)
            {
                RewrapCommand.AttachToTextView(textView, vsTextView);
                AutoWrapCommand.AttachToTextView(textView);
            }
        }
Esempio n. 3
0
 /// Initialization of the package; this method is called right after the
 /// package is sited, so this is the place where you can put all the
 /// initialization code that rely on services provided by VisualStudio.
 protected override void Initialize()
 {
     RewrapCommand.Initialize(this);
     AutoWrapCommand.Initialize(this);
     base.Initialize();
 }