Exemple #1
0
 public SwitchRepositoryCommand(
     IGitLocalRepositoryService localRepositoryService,
     IWorkspaceService workspaceService)
 {
     _localRepositoryService = localRepositoryService;
     _workspaceService       = workspaceService;
 }
Exemple #2
0
        public OpenCommand(Storage storage, IWorkspaceService workspace)
        {
            _storage     = storage;
            _worksapce   = workspace;
            Image        = Resources.Folder_48x48;
            DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
            ToolTipText  = @"Ctrl + O";
            ShortcutKeys = Keys.Control | Keys.O;
            EventAggregator.Instance.Subscribe <StopAppEvent>(e => Enabled = true);
            EventAggregator.Instance.Subscribe <PlayAppEvent>(e => Enabled = false);
            EventAggregator.Instance.Subscribe <StorageAppEvent>(e =>
            {
                if (e.ChangingType == FileChangingType.Loading || e.ChangingType == FileChangingType.Saving)
                {
                    Enabled = false;
                }

                if (e.ChangingType == FileChangingType.LoadComplete || e.ChangingType == FileChangingType.SaveComplete)
                {
                    Enabled = true;
                }
            });

            _openView = new OpenFileView();
        }
        public TimerPageViewModel(ITimeEntryService timeEntryService, IAuthService authService,
                                  IProjectService projectService, IWorkspaceService workspaceService)
        {
            _timeEntryService = timeEntryService;
            _authService      = authService;
            _projectService   = projectService;
            _workspaceService = workspaceService;

            StartTimerCommand = new DelegateCommand(async() =>
            {
                NewEntry.Start = DateTime.Now;
                Current        = await _timeEntryService.StartCurrentTimer(_newEntry);
            });

            StopTimerCommand = new DelegateCommand(async() =>
            {
                await _timeEntryService.StopCurrentTimer();
                LoadCurrentTimeEntry();
            });

            RefreshCommand = new DelegateCommand(OnNavigatedTo);

            PropertyChanged += (sender, args) =>
            {
                switch (args.PropertyName)
                {
                case nameof(Workspace):
                    LoadProjects(Task.FromResult(Workspace));
                    break;
                }
            };
        }
Exemple #4
0
 public CodeEditorViewModel(ICodeEditorView view, IShellService shellService, IWorkspaceService workspaceService, CodeEditorService codeEditorService)
     : base(view)
 {
     ShellService      = shellService;
     WorkspaceService  = workspaceService;
     CodeEditorService = codeEditorService;
 }
Exemple #5
0
 public HandleFileDropCommand(BaseViewModel viewModel, Workspace workspace, IWorkspaceService wsService, IResourceDirectoryService rdService)
 {
     _viewModel                = viewModel;
     _workspaceService         = wsService;
     _resourceDirectoryService = rdService;
     _workspace                = workspace;
 }
Exemple #6
0
        public EvaluationService(
            IWorkspaceService workspace,
            IEvaluationEnvironment evaluationEnvironment)
        {
            this.workspace = workspace
                             ?? throw new ArgumentNullException(nameof(workspace));

            this.evaluationEnvironment = evaluationEnvironment;
        }
Exemple #7
0
        public SelectTool(IServiceManager services) : base(services)
        {
            tools     = services.GetService <IToolService> ();
            workspace = services.GetService <IWorkspaceService> ();

            CreateHandler();

            workspace.SelectionChanged += AfterSelectionChange;
        }
 ///<inheritdoc/>
 public ConfigurationService(
     IEnvironmentService environmentService,
     IWorkspaceService workspaceService,
     ITraceService traceService)
 {
     this._environmentService = environmentService;
     this._workspaceService   = workspaceService;
     this._traceService       = traceService;
 }
 public ServerAuditService(
     IWorkspaceService workspaceService,
     IWorkspaceAuditServiceFactory workspaceAuditServiceFactory,
     ILogger logger)
 {
     this.workspaceService             = workspaceService;
     this.workspaceAuditServiceFactory = workspaceAuditServiceFactory;
     this.logger = logger.WithClassName();
 }
        public OpenExportDialogCommand(
            WorkspaceViewModel viewModel,
            IWorkspaceService workspaceService)
        {
            _viewModel        = viewModel;
            _workspaceService = workspaceService;

            worker.DoWork             += worker_DoWork;
            worker.RunWorkerCompleted += worker_RunWorkerCompleted;
        }
Exemple #11
0
 public Task <WorkspaceFile> GetFileAsync(
     GetFileInput input,
     [Service] IWorkspaceService workspaceService,
     CancellationToken cancellationToken)
 {
     return(workspaceService.GetFileAsync(new GetFileRequest(input.FileName)
     {
         Converter = input.Converter
     }, cancellationToken));
 }
        public async Task <IEnumerable <WorkRoot> > GetWorkRootsAsync(
            CancellationToken cancellationToken)
        {
            IUserSettingsManager settingsManager = _app.GetRequiredService <IUserSettingsManager>();

            UserSettings?settings = await settingsManager.GetAsync(cancellationToken);

            if (settings.WorkRoots.Count() == 0)
            {
                _console.WriteLine("No work roots configured!");
                _console.WriteLine("You can configure you work roots in the UI or directly in:");
                _console.WriteLine($"{SettingsStore.UserSettingsFilePath}.");

                var options = new List <string>
                {
                    "Open UI",
                    "Open User settings in code",
                    $"Add {Directory.GetCurrentDirectory()} as work root",
                    "Cancel"
                };

                var index = _console.ChooseFromList(options);

                switch (index)
                {
                case 0:
                    IWebServer?webServer = _app.GetRequiredService <IWebServer>();
                    var        url       = await webServer.StartAsync(3003);

                    ProcessHelpers.OpenBrowser(url + "/settings");
                    break;

                case 1:
                    //first ensure file exists
                    if (!File.Exists(SettingsStore.UserSettingsFilePath))
                    {
                        await AddCurrentWorkroot(settingsManager, cancellationToken);
                    }
                    IWorkspaceService workspaceService = _app.GetRequiredService <IWorkspaceService>();
                    await workspaceService.OpenFileInCode(SettingsStore.UserSettingsFilePath);

                    break;

                case 2:
                    await AddCurrentWorkroot(settingsManager, cancellationToken);

                    break;

                default:
                    break;
                }
            }

            return(settings.WorkRoots);
        }
Exemple #13
0
 public DesignService(IWorkspaceService workspaceService, CompilerService compilerService,Report report)
 {
     this.WorkspaceService = workspaceService;
     this.compilerService = compilerService;
     controlViewFactory = new ControlViewFactory (this);
     PixbufRepository = new PixbufRepository (){ Report = report};
     IsDesign = true;
     Zoom = 1;
     Render = true;
     Report = report;
 }
Exemple #14
0
 public Toggl(string key)
 {
     ApiService = new ApiService(key);
     Client     = new ClientService(ApiService);
     Project    = new ProjectService(ApiService);
     Tag        = new TagService(ApiService);
     Task       = new TaskService(ApiService);
     TimeEntry  = new TimeEntryService(ApiService);
     User       = new UserService(ApiService);
     Workspace  = new WorkspaceService(ApiService);
 }
Exemple #15
0
 public Toggl(string key)
 {
     ApiService = new ApiService(key);
     Client = new ClientService(ApiService);
     Project = new ProjectService(ApiService);
     Tag = new TagService(ApiService);
     Task = new TaskService(ApiService);
     TimeEntry = new TimeEntryService(ApiService);
     User = new UserService(ApiService);
     Workspace = new WorkspaceService(ApiService);
 }        
 public ServerAuditReporter(
     IUserExperienceReportRepository userExperienceReportRepository,
     IWorkspaceService workspaceService,
     IWorkspaceAuditServiceFactory workspaceAuditServiceFactory,
     ISearchAuditBatchRepository searchAuditBatchRepository)
 {
     this.userExperienceReportRepository = userExperienceReportRepository;
     this.workspaceService             = workspaceService;
     this.workspaceAuditServiceFactory = workspaceAuditServiceFactory;
     this.searchAuditBatchRepository   = searchAuditBatchRepository;
 }
Exemple #17
0
        /// <summary>
        /// Inserts a new cell into the workspace and sets an initial buffer.
        /// The workspace implementation may not need both <see cref="CodeCellId"/>
        /// parameters, but they will always be provided, should they exist, by
        /// <see cref="EvaluationService"/>.
        /// </summary>
        /// <param name="initialBuffer">The initial the text content for the cell.</param>
        /// <param name="previousCellId">Insert the new cell immediately after this cell.</param>
        /// <param name="nextCellId">Insert the new cell immediately before this cell.</param>
        /// <returns>
        /// Returns the <see cref="CodeCellId"/> of the new cell. The ID must be
        /// unique, opaque, and persistent across the cell's lifecycle.
        /// </returns>
        public static CodeCellId InsertCell(
            this IWorkspaceService workspaceService,
            string initialBuffer,
            CodeCellId previousCellId,
            CodeCellId nextCellId)
        {
            var codeCellId = workspaceService.InsertCell(previousCellId, nextCellId);

            workspaceService.SetCellBuffer(codeCellId, initialBuffer);
            return(codeCellId);
        }
Exemple #18
0
 public UserController(
     IHttpContextAccessor httpContextAccessor,
     IUserService userService,
     IWorkspaceService workspaceService,
     IMapper mapper)
 {
     _workspaceService    = workspaceService;
     _httpContextAccessor = httpContextAccessor;
     _userService         = userService;
     _user   = _userService.GetApplicationUser(_httpContextAccessor.HttpContext.GetUserId());
     _mapper = mapper;
 }
 public AuditServerBatcher(
     IAuditWorkspaceBatcher auditWorkspaceBatcher,
     IWorkspaceService workspaceService,
     ISearchAuditBatchRepository searchAuditBatchRepository,
     IMetricDataService metricDataService,
     ILogger logger)
 {
     this.auditWorkspaceBatcher      = auditWorkspaceBatcher;
     this.workspaceService           = workspaceService;
     this.searchAuditBatchRepository = searchAuditBatchRepository;
     this.metricDataService          = metricDataService;
     this.logger = logger.WithClassName().WithCategory(Names.LogCategory.Audit);
 }
 public DesignService(IWorkspaceService workspaceService,ReportRenderer renderer,PixbufRepository pixbufRepository,CompilerService compilerService, Report report)
 {
     this.PixbufRepository = pixbufRepository;
     this.WorkspaceService = workspaceService;
     this.Compiler = compilerService;
     this.renderer = renderer;
     controlViewFactory = new ControlViewFactory (renderer);
     IsDesign = true;
     Report = report;
     Zoom = 1;
     Render = true;
     IsDirty = true;
 }
Exemple #21
0
 public ViewBridge(IWorkspaceService workspaceService, IViewService viewService, IMessageDisplayService messageDisplayService)
 {
     this.workspaceService                                  = workspaceService;
     this.viewService                                       = viewService;
     this.messageDisplayService                             = messageDisplayService;
     this.viewService.ViewOpened                           += new ViewEventHandler(this.ViewService_ViewOpened);
     this.viewService.ViewClosed                           += new ViewEventHandler(this.ViewService_ViewClosed);
     this.viewService.ActiveViewChanged                    += new ViewChangedEventHandler(this.ViewService_ActiveViewChanged);
     this.workspaceService.ActiveWorkspaceChanging         += new CancelEventHandler(this.WorkspaceService_ActiveWorkspaceChanging);
     this.workspaceService.ActiveWorkspaceChangingCanceled += new EventHandler(this.WorkspaceService_ActiveWorkspaceChangingCanceled);
     this.workspaceService.ActiveWorkspaceChanged          += new EventHandler(this.WorkspaceService_ActiveWorkspaceChanged);
     DockOperations.DockPositionChanging                   += new EventHandler <DockEventArgs>(this.DockOperations_DockPositionChanging);
     DockOperations.DockPositionChanged                    += new EventHandler <DockEventArgs>(this.DockOperations_DockPositionChanged);
 }
Exemple #22
0
 public DesignService(IWorkspaceService workspaceService, CompilerService compilerService, Report report)
 {
     this.WorkspaceService = workspaceService;
     this.compilerService  = compilerService;
     controlViewFactory    = new ControlViewFactory(this);
     PixbufRepository      = new PixbufRepository()
     {
         Report = report
     };
     IsDesign = true;
     Zoom     = 1;
     Render   = true;
     Report   = report;
 }
Exemple #23
0
 public CommandLineService(
     IMigrationServiceFactory migrationServiceFactory,
     IDataServiceFactory dataServiceFactory,
     IWorkspaceService workspaceService,
     IEnvironmentService environmentService,
     ITraceService traceService,
     IConfigurationService configurationService)
 {
     this._workspaceService        = workspaceService;
     this._environmentService      = environmentService;
     this._traceService            = traceService;
     this._configurationService    = configurationService;
     this._migrationServiceFactory = migrationServiceFactory;
     this._dataServiceFactory      = dataServiceFactory;
 }
        public OutlookBarViewModel(
            IWorkspaceService workspaceService,
            IEventAggregator eventAggregator,
            ICachingService cachingService,
            IStatusBarMessageQueue statusBarMessageQueue,
            IOutlookBarItemViewModelFactory modelFactory,
            ISearchViewModel searchViewModel)
        {
            _workspaceService      = workspaceService;
            _eventAggregator       = eventAggregator;
            _cachingService        = cachingService;
            _statusBarMessageQueue = statusBarMessageQueue;
            _modelFactory          = modelFactory;
            _searchViewModel       = searchViewModel;

            Initialize();
        }
        #pragma warning restore 0414

        public HoverProvider(
            IWorkspaceService workspace,
            ScriptContext context,
            Func <string, CodeCellId> monacoModelIdToCodeCellIdMapper)
        {
            this.workspace = workspace
                             ?? throw new ArgumentNullException(nameof(workspace));

            this.context = context
                           ?? throw new ArgumentNullException(nameof(context));

            this.monacoModelIdToCodeCellIdMapper = monacoModelIdToCodeCellIdMapper
                                                   ?? throw new ArgumentNullException(nameof(monacoModelIdToCodeCellIdMapper));

            providerTicket = context.GlobalObject.xiexports.monaco.RegisterWorkbookHoverProvider(
                "csharp",
                (ScriptFunc)ProvideHover);
        }
        public async Task ShowQuickActions(string path)
        {
            IWorkspaceService workspaceService = _app.GetRequiredService <IWorkspaceService>();
            var dir = new DirectoryInfo(path);

            QuickAction[] quickActions =
                workspaceService.GetQuickActions(path).ToArray();

            Console.WriteLine($"Quick actions: {dir.Name}");
            Console.WriteLine($"------------------------------------");

            var actionIndex = _console.ChooseFromList(
                quickActions.Select(x => x.ToString()));

            QuickAction?action = quickActions[actionIndex];

            switch (action.Type)
            {
            case QuickActionTypes.OpenVisualStudioSolution:
                ProcessHelpers.Open(action.Value);
                break;

            case QuickActionTypes.OpenDirectoryInExplorer:
                await workspaceService.OpenInExplorer(action.Value);

                break;

            case QuickActionTypes.OpenDirectoryInCode:
                await workspaceService.OpenInCode(action.Value);

                break;

            case QuickActionTypes.OpenDirectoryInTerminal:
                await workspaceService.OpenInTerminal(action.Value);

                break;

            case QuickActionTypes.RunSuperBoost:
                await workspaceService.RunSuperBoostAsync(action.Title, path);

                break;
            }
        }
Exemple #27
0
 /// <inheritdoc />
 public MigrationService(
     IWorkspaceService workspaceService,
     IDataService dataService,
     IBulkImportService bulkImportService,
     IMetadataService metadataService,
     ITokenReplacementService tokenReplacementService,
     IDirectoryService directoryService,
     IFileService fileService,
     ITraceService traceService,
     IConfigurationService configurationService)
 {
     this._workspaceService        = workspaceService;
     this._dataService             = dataService;
     this._bulkImportService       = bulkImportService;
     this._tokenReplacementService = tokenReplacementService;
     this._directoryService        = directoryService;
     this._fileService             = fileService;
     this._traceService            = traceService;
     this._configurationService    = configurationService;
     this._metadataService         = metadataService;
 }
Exemple #28
0
        protected BaseTool(IServiceManager services)
        {
            Resources = services.GetService <IResourceService> ();
            Settings  = services.GetService <ISettingsService> ();

            tools     = services.GetService <IToolService> ();
            workspace = services.GetService <IWorkspaceService> ();

            CurrentCursor = DefaultCursor;

            // Update cursor when active document changes
            workspace.ActiveDocumentChanged += (_, _) => {
                if (tools.CurrentTool == this)
                {
                    SetCursor(DefaultCursor);
                }
            };

            // Give tools a chance to save their settings on application quit
            Settings.SaveSettingsBeforeQuit += (_, _)
                                               => OnSaveSettings(Settings);
        }
Exemple #29
0
        public IWorkbookSaveOperation CreateSaveOperation(
            IWorkspaceService workspace)
        {
            var dependencies = new WorkbookDependencyCollector().Visit(this);
            var onlyPage     = dependencies.SingleOrDefault();

            var workspaceDependencies = workspace
                                        ?.GetExternalDependencies()
                                        ?.Select(dependency => dependency.Location);

            if (workspaceDependencies != null)
            {
                onlyPage.Value.AddRange(workspaceDependencies);
            }

            return(new SaveOperation {
                Destination = logicalPath,
                AllDependencies = dependencies,
                OnlyPage = onlyPage.Key,
                OnlyPageHasDependencies = onlyPage.Key != null && onlyPage.Value.Count > 0,
                Options = SaveOptions
            });
        }
 public AuditBatchProcessor(
     ISearchAuditBatchRepository searchAuditBatchRepository,
     IHourRepository hourRepository,
     ISearchAnalysisService searchAnalysisService,
     IAuditBatchAnalyzer auditBatchAnalyzer,
     IWorkspaceAuditServiceFactory workspaceAuditServiceFactory,
     IWorkspaceAuditReporter workspaceAuditReporter,
     IServerRepository serverRepository,
     IAuditParsingService auditParsingService,
     IWorkspaceService workspaceService,
     ILogger logger)
 {
     this.searchAuditBatchRepository   = searchAuditBatchRepository;
     this.hourRepository               = hourRepository;
     this.searchAnalysisService        = searchAnalysisService;
     this.auditBatchAnalyzer           = auditBatchAnalyzer;
     this.workspaceAuditServiceFactory = workspaceAuditServiceFactory;
     this.workspaceAuditReporter       = workspaceAuditReporter;
     this.serverRepository             = serverRepository;
     this.auditParsingService          = auditParsingService;
     this.workspaceService             = workspaceService;
     this.logger = logger.WithClassName().WithCategory(Names.LogCategory.Audit);
 }
Exemple #31
0
        public SaveCommand(IWorkspaceService workspaceService)
        {
            this._workspaceService = workspaceService;

            Command = new DelegateCommand(() => this._workspaceService.SaveCurrentEditor());
        }        
 public OpenTexture2DCommand(IEventAggregator eventAggregator, IWorkspaceService workSpaceService)
 {
     this._workSpaceService = workSpaceService;
     this.Command = new DelegateCommand<Object>(CreateNewTexture2DExecute, CanCreateNewTexture2D);
 }
 internal WorkspaceService(IWorkspaceService service, string org) : base(org)
 {
     Service = service;
 }
Exemple #34
0
 public OpenLevelCommand(IWorkspaceService workSpaceService)
 {
     this._workSpaceService = workSpaceService;
     this.Command = new DelegateCommand<Object>(x => _workSpaceService.OpenEditor(ViewNames.LevelEditor, (Asset)x));
 }
 public WorkspaceServiceInternal(IWorkspaceService workspace)
 {
     this.workspaceService = workspace;
 }
Exemple #36
0
 public PropertySearchGroupTreeViewModel(IEventAggregator eventAggregator, IWorkspaceService workspaceService) :
     base(eventAggregator)
 {
     _workspaceService = workspaceService;
     Initialize();
 }
 public OpenTerrainTileDefinitionCommand(IWorkspaceService workSpaceService)
 {
     this._workSpaceService = workSpaceService;
     this.Command = new DelegateCommand<Object>(x => _workSpaceService.OpenEditor(ViewNames.TerrainTileDefinitionEditor, (Asset)x));
 }