コード例 #1
0
        /// <summary>
        /// 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.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();

            _dte = (DTE2)GetGlobalService(typeof(DTE));
            var service = new SolutionService(_dte);

            ((IServiceContainer)this).AddService(typeof(ISolutionService), service);

            _findSelectorModel = new FileSelectorViewModel(service, new FileGeneratorFactory());

            GenerateTSClass.Initialize(this, _findSelectorModel);
            FileSelectorWindowCommand.Initialize(this);
            _monitorSelection = GetGlobalService(typeof(SVsShellMonitorSelection)) as IVsMonitorSelection;
            _monitorSelection?.AdviseSelectionEvents(this, out _selectionHandle);
        }
コード例 #2
0
 /// <summary>
 /// Initializes the singleton instance of the command.
 /// </summary>
 /// <param name="package">Owner package, not null.</param>
 /// <param name="findSelectorModel"></param>
 public static void Initialize(Package package, FileSelectorViewModel findSelectorModel)
 {
     Instance = new GenerateTSClass(package, findSelectorModel);
 }