예제 #1
0
 public SaveCurrentSessionCommand(
     PackageAccessor packageAccessor,
     ISessionManager sessionManager,
     IIDE ide,
     ILogger logger)
 {
     _package        = packageAccessor.Package;
     _sessionManager = sessionManager;
     _ide            = ide;
     _logger         = logger;
     _saveLock       = new object();
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SessionManagerToolWindowControl"/> class.
        /// </summary>
        public SessionManagerToolWindowControl(
            SessionManagerToolWindowState state,
            ISessionManager sessionManager,
            SaveCurrentSessionCommand saveCurrentSessionCommand,
            RestoreSessionCommand restoreSessionCommand,
            OpenSessionCommand openSessionCommand,
            CloseSessionDocumentsCommand closeSessionDocumentsCommand,
            DeleteSessionCommand deleteSessionCommand,
            PackageAccessor packageAccessor)
        {
            State               = state;
            SessionManager      = sessionManager;
            _openSessionCommand = openSessionCommand;
            _package            = packageAccessor.Package;

            RestoreSessionCommand = new RelayCommand(
                param => _package.JoinableTaskFactory.RunAsync(async() => await restoreSessionCommand.ExecuteAsync(State.SelectedSession)));
            OpenSessionCommand = new RelayCommand(
                param => _package.JoinableTaskFactory.RunAsync(async() => await openSessionCommand.ExecuteAsync(State.SelectedSession)));
            CloseSessionDocumentsCommand = new RelayCommand(
                param => _package.JoinableTaskFactory.RunAsync(async() => await closeSessionDocumentsCommand.ExecuteAsync(State.SelectedSession)));
            DeleteSessionCommand = new RelayCommand(
                param => _package.JoinableTaskFactory.RunAsync(async() => await deleteSessionCommand.ExecuteAsync(State.SelectedSession)));
            RenameSessionCommand = new RelayCommand(
                param => _package.JoinableTaskFactory.RunAsync(async() => await RenameSessionAsync()));
            UpdateSessionCommand = new RelayCommand(
                param => _package.JoinableTaskFactory.RunAsync(async() =>
            {
                if (MessageBox.Show($"Documents saved in \"{State.SelectedSession.Name}\" will be replaced with " +
                                    $"the currently opened documents. Are you sure you want to continue?",
                                    "Confirm",
                                    MessageBoxButton.YesNo,
                                    MessageBoxImage.Question) != MessageBoxResult.Yes)
                {
                    return;
                }
                await saveCurrentSessionCommand.ExecuteAsync(State.SelectedSession);
            }));

            this.InitializeComponent();
        }
 public PackageAccessor(SessionManagerPackage package)
 {
     Package = package;
 }
예제 #4
0
 public IDE(PackageAccessor packageAccessor, DTE2 environment, IVsUIShellDocumentWindowMgr vsDocumentWindowMgr)
 {
     _package             = packageAccessor.Package;
     Environment          = environment;
     _vsDocumentWindowMgr = vsDocumentWindowMgr;
 }
예제 #5
0
 public SessionManagerToolWindowCommand(PackageAccessor packageAccessor)
 {
     _package = packageAccessor.Package;
 }
 public CloseSessionDocumentsCommand(IIDE ide, SessionManagerToolWindowState sessionManagerToolWindowState, PackageAccessor packageAccessor)
 {
     _ide = ide;
     _sessionManagerToolWindowState = sessionManagerToolWindowState;
     _package = packageAccessor.Package;
 }
 public DefaultLogger(PackageAccessor packageAccessor)
 {
     _package = packageAccessor.Package;
 }