コード例 #1
0
        public void PerformTest()
        {
            LibraryExplorer explorer = new LibraryExplorer();

            explorer.Dock = DockStyle.Fill;

            Form frm = new Form();

            frm.Controls.Add(explorer);
            frm.ShowDialog();
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LibraryExplorerWindow"/> class.
        /// </summary>
        public LibraryExplorerWindow() : base(null)
        {
            this.Caption = "Library Explorer";

            //Visual Studio services
            IVsActivityLog activityLogService = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SVsActivityLog)) as IVsActivityLog;
            IVsSolution    solutionService    = Microsoft.VisualStudio.Shell.Package.GetGlobalService(typeof(SVsSolution)) as IVsSolution;

            //Own services
            ILibraryExplorer libraryExplorerService = new LibraryExplorer(@"C:\LibraryPackages", @"C:\Users\Temitope.A\Documents\GitHub", "netstandard1.5");

            // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
            // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
            // the object returned by the Content property.
            var viewModel = new LibraryExplorerWindowViewModel(libraryExplorerService, solutionService, activityLogService);

            control      = new LibraryExplorerWindowControl(viewModel);
            this.Content = control;

            this.ToolBar         = new CommandID(LibraryExplorerWindowCommand.CommandSet, LibraryExplorerWindowCommand.ToolbarID);
            this.ToolBarLocation = (int)VSTWT_LOCATION.VSTWT_TOP;
        }