コード例 #1
0
 public SourceExplorerHierarchyControllerFactory(
     ISynchronizationContextProvider synchronizationContextProvider,
     IFileSystemTreeSource fileSystemTreeSource,
     IVisualStudioPackageProvider visualStudioPackageProvider,
     IVsGlyphService vsGlyphService,
     IImageSourceFactory imageSourceFactory,
     IOpenDocumentHelper openDocumentHelper,
     IFileSystem fileSystem,
     IClipboard clipboard,
     IWindowsExplorer windowsExplorer,
     IDispatchThreadServerRequestExecutor dispatchThreadServerRequestExecutor,
     IEventBus eventBus,
     IGlobalSettingsProvider globalSettingsProvider,
     IDelayedOperationExecutor delayedOperationExecutor,
     IDispatchThread dispatchThread,
     IShowServerInfoService showServerInfoService)
 {
     _synchronizationContextProvider = synchronizationContextProvider;
     _fileSystemTreeSource           = fileSystemTreeSource;
     _visualStudioPackageProvider    = visualStudioPackageProvider;
     _vsGlyphService     = vsGlyphService;
     _imageSourceFactory = imageSourceFactory;
     _openDocumentHelper = openDocumentHelper;
     _fileSystem         = fileSystem;
     _clipboard          = clipboard;
     _windowsExplorer    = windowsExplorer;
     _dispatchThreadServerRequestExecutor = dispatchThreadServerRequestExecutor;
     _eventBus = eventBus;
     _globalSettingsProvider   = globalSettingsProvider;
     _delayedOperationExecutor = delayedOperationExecutor;
     _dispatchThread           = dispatchThread;
     _showServerInfoService    = showServerInfoService;
 }
コード例 #2
0
        public MainViewModel(
            IDataApiClient dataApiClient,
            DataVisualizer dataVisualizer,
            IReadonlyObjectDatabase <UserProfile> userDatabase,
            IReadonlyObjectDatabase <DataSet> dataSetDatabase,
            IReadonlyObjectDatabase <DataProject> dataProjectDatabase,
            IClipboard clipboard,
            IClosable mainWindow)
        {
            this.dataApiClient       = dataApiClient;
            this.userDatabase        = userDatabase;
            this.mainWindow          = mainWindow;
            DataSetMainViewModel     = new DataSetMainViewModel(dataApiClient, dataSetDatabase, dataProjectDatabase, clipboard);
            CollectionsMainViewModel = new CollectionsMainViewModel(dataApiClient, dataVisualizer, userDatabase, clipboard);

            var passwordBoxSpawner = new WpfPasswordBoxSpawner();
            var loginViewSpawner   = new WpfWindowSpawner <LoginViewModel>(vm => new LoginWindow {
                ViewModel = vm
            });
            var changePasswordViewSpawner = new WpfWindowSpawner <ChangePasswordViewModel>(vm => new ChangePasswordWindow {
                ViewModel = vm
            });

            UserSwitchViewModel = new UserSwitchViewModel(
                dataApiClient,
                LoginSuccessful,
                LoginFailed,
                passwordBoxSpawner,
                loginViewSpawner,
                changePasswordViewSpawner);
            OpenUserManagementWindowCommand = new RelayCommand(OpenUserManagementWindow);
            OpenAboutWindowCommand          = new RelayCommand(OpenAboutWindow);
        }
コード例 #3
0
 public XmlMessageViewModel(
     IContentDecoder <XmlDocument> xmlDecoder,
     IClipboard clipboard)
 {
     _xmlDecoder = xmlDecoder;
     _clipboard  = clipboard;
 }
コード例 #4
0
        public MessageFlowViewModel(
            IServiceControl serviceControl,
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            SearchBarViewModel searchBar,
            MessageListViewModel messageList,
            Func <ExceptionDetailViewModel> exceptionDetail,
            ISettingsProvider settingsProvider,
            EndpointExplorerViewModel endpointExplorer,
            IClipboard clipboard)
        {
            this.serviceControl   = serviceControl;
            this.eventAggregator  = eventAggregator;
            this.windowManager    = windowManager;
            this.settingsProvider = settingsProvider;
            this.messageList      = messageList;
            this.endpointExplorer = endpointExplorer;
            this.exceptionDetail  = exceptionDetail;

            CopyConversationIDCommand = new CopyConversationIDCommand(clipboard);
            CopyMessageURICommand     = new CopyMessageURICommand(clipboard, serviceControl);
            SearchByMessageIDCommand  = new SearchByMessageIDCommand(eventAggregator, searchBar);
            RetryMessageCommand       = new RetryMessageCommand(eventAggregator, serviceControl);

            Diagram = new MessageFlowDiagram();
            nodeMap = new ConcurrentDictionary <string, MessageNode>();
        }
コード例 #5
0
        public MessageListViewModel(
            IEventAggregator eventAggregator,
            IWorkNotifier workNotifier,
            IServiceControl serviceControl,
            SearchBarViewModel searchBarViewModel,
            GeneralHeaderViewModel generalHeaderDisplay,
            MessageSelectionContext selectionContext,
            IClipboard clipboard,
            ISettingsProvider settingsProvider)
        {
            SearchBar = searchBarViewModel;
            Selection = selectionContext;

            this.clipboard            = clipboard;
            this.settingsProvider     = settingsProvider;
            this.eventAggregator      = eventAggregator;
            this.workNotifier         = workNotifier;
            this.serviceControl       = serviceControl;
            this.generalHeaderDisplay = generalHeaderDisplay;

            Items.Add(SearchBar);

            RetryMessageCommand  = new RetryMessageCommand(eventAggregator, workNotifier, serviceControl);
            CopyMessageIdCommand = new CopyMessageURICommand(clipboard, serviceControl);
            CopyHeadersCommand   = Command.Create(CopyHeaders,
                                                  generalHeaderDisplay.Changed
                                                  .Where(pc => pc.PropertyName == nameof(GeneralHeaderViewModel.HeaderContent))
                                                  .Select(s => !((string)s.Value).IsEmpty()));
            Rows = new BindableCollection <StoredMessage>();
        }
コード例 #6
0
        public MessageListViewModel(
            IEventAggregator eventAggregator,
            IServiceControl serviceControl,
            ISearchBarViewModel searchBarViewModel,
            IErrorHeaderViewModel errorHeaderDisplay,
            IGeneralHeaderViewModel generalHeaderDisplay,
            IClipboard clipboard)
        {
            _eventAggregator      = eventAggregator;
            _serviceControl       = serviceControl;
            _errorHeaderDisplay   = errorHeaderDisplay;
            _generalHeaderDisplay = generalHeaderDisplay;
            _clipboard            = clipboard;

            SearchBar = searchBarViewModel;
            Items.Add(SearchBar);

            _returnToSourceMenu = new MenuItem("Return To Source", new RelayCommand(ReturnToSource, CanReturnToSource), Properties.Resources.MessageReturn);
            _retryMessageMenu   = new MenuItem("Retry Message", new RelayCommand(RetryMessage, CanRetryMessage), Properties.Resources.MessageReturn);
            _copyMessageIdMenu  = new MenuItem("Copy Message URI", new RelayCommand(CopyMessageId, CanCopyMessageId));
            _copyHeadersMenu    = new MenuItem("Copy Headers", new RelayCommand(CopyHeaders, CanCopyHeaders));

            Rows             = new BindableCollection <StoredMessage>();
            ContextMenuItems = new BindableCollection <IMenuItem>
            {
                _returnToSourceMenu,
                _retryMessageMenu,
                _copyHeadersMenu,
                _copyMessageIdMenu
            };
        }
コード例 #7
0
        public MessageListViewModel(
            IEventAggregator eventAggregator,
            IWindowManagerEx windowManager,
            IServiceControl serviceControl,
            IQueueManagerAsync asyncQueueManager,
            ISearchBarViewModel searchBarViewModel,
            IErrorHeaderViewModel errorHeaderDisplay,
            IGeneralHeaderViewModel generalHeaderDisplay,
            IClipboard clipboard,
            IStatusBarManager statusBar)
        {
            _eventAggregator      = eventAggregator;
            _windowManager        = windowManager;
            _serviceControl       = serviceControl;
            _asyncQueueManager    = asyncQueueManager;
            _errorHeaderDisplay   = errorHeaderDisplay;
            _generalHeaderDisplay = generalHeaderDisplay;
            _clipboard            = clipboard;
            _statusBar            = statusBar;

            SearchBar = searchBarViewModel;

            Items.Add(SearchBar);
            Messages         = new BindableCollection <MessageInfo>();
            SelectedMessages = new BindableCollection <MessageInfo>();
            ContextMenuItems = new BindableCollection <ContextMenuModel>
            {
                new ContextMenuModel(this, "ReturnToSource", "Return To Source", Properties.Resources.MessageReturn),
                new ContextMenuModel(this, "RetryMessage", "Retry Message", Properties.Resources.MessageReturn),
                new ContextMenuModel(this, "CopyMessageId", "Copy Message Identifier"),
                new ContextMenuModel(this, "CopyHeaders", "Copy Headers")
            };
        }
コード例 #8
0
 public CopyImageToClipboardCommandHandler(
     ICanvasToBitmapExporter exporter,
     IClipboard clipboard)
 {
     _exporter  = exporter;
     _clipboard = clipboard;
 }
 public SourceExplorerHierarchyControllerFactory(
     ISynchronizationContextProvider synchronizationContextProvider,
     IFileSystemTreeSource fileSystemTreeSource,
     IVisualStudioPackageProvider visualStudioPackageProvider,
     IVsGlyphService vsGlyphService,
     IImageSourceFactory imageSourceFactory,
     IOpenDocumentHelper openDocumentHelper,
     IFileSystem fileSystem,
     IClipboard clipboard,
     IWindowsExplorer windowsExplorer,
     IUIRequestProcessor uiRequestProcessor,
     IEventBus eventBus,
     IGlobalSettingsProvider globalSettingsProvider,
     IDelayedOperationProcessor delayedOperationProcessor,
     IUIThread uiThread)
 {
     _synchronizationContextProvider = synchronizationContextProvider;
     _fileSystemTreeSource           = fileSystemTreeSource;
     _visualStudioPackageProvider    = visualStudioPackageProvider;
     _vsGlyphService            = vsGlyphService;
     _imageSourceFactory        = imageSourceFactory;
     _openDocumentHelper        = openDocumentHelper;
     _fileSystem                = fileSystem;
     _clipboard                 = clipboard;
     _windowsExplorer           = windowsExplorer;
     _uiRequestProcessor        = uiRequestProcessor;
     _eventBus                  = eventBus;
     _globalSettingsProvider    = globalSettingsProvider;
     _delayedOperationProcessor = delayedOperationProcessor;
     _uiThread                  = uiThread;
 }
コード例 #10
0
 public void Pegar(IClipboard clipboard)
 {
     lock (this)
     {
         clipboard.Pegar(this);
     }
 }
コード例 #11
0
        /// <summary>
        /// Initializes a new code editor.
        /// </summary>
        public CodeEditorViewModel(AbstractFoldingStrategy foldingStrategy, IHighlightingDefinition highlightingDefinition, IEnumerable <MenuViewModel> snippets,
                                   IClipboard clipboard)
        {
            _clipboard             = clipboard;
            FoldingStrategy        = foldingStrategy;
            HighlightingDefinition = highlightingDefinition;
            Snippets = snippets;
            Options  = new EditorOptions();

            _contentIndex       = Property.New(this, p => p.ContentIndex, OnPropertyChanged);
            _contentIndex.Value = 0;

            _selectionStart  = Property.New(this, p => p.SelectionStart, OnPropertyChanged);
            _selectionLength = Property.New(this, p => p.SelectionLength, OnPropertyChanged);

            _document = Property.New(this, p => p.Document, OnPropertyChanged);

            _scrollOffset = Property.New(this, p => p.ScrollOffset, OnPropertyChanged);

            _isModified = Property.New(this, p => IsModified, OnPropertyChanged);

            UndoCommand = new RelayCommand(() => Document.UndoStack.Undo(), () => Document.UndoStack.CanUndo);
            RedoCommand = new RelayCommand(() => Document.UndoStack.Redo(), () => Document.UndoStack.CanRedo);

            CopyCommand  = new RelayCommand(Copy);
            CutCommand   = new RelayCommand(Cut);
            PasteCommand = new RelayCommand(Paste, () => _clipboard.ContainsText);
        }
コード例 #12
0
        public void DefaultUseCase(IClipboard clipboard,
                                   GherkinPaster sut,
                                   TestEnvironment environment)
        {
            "Given a complete system".Given(() =>
            {
                environment = FakesLibrary.CreateDefaultEnvironment();
                sut = new GherkinPaster(environment);
            });
            "And a gherkin Scenario".And(() =>
            {
                var sb = new StringBuilder();
                sb.AppendLine("Scenario: Testing the gherkin paster");
                sb.AppendLine("Given a line");
                sb.AppendLine("And a line");
                sb.AppendLine("When a line");
                sb.AppendLine("Then a line");
                clipboard = FakesLibrary.CreateShim(sb.ToString());
            });
            "When the gherkin is pasted".When(() => sut.PasteGherkin(clipboard));

            "Then the output should be a method wrapping 4 strings with appropriate extension methods".Then(() => { var expectedOutput = @"[Scenario]
            public void TestingTheGherkinPaster()
            {
            ""Given a line"".Given(() => {});
            ""And a line"".And(() => {});
            ""When a line"".When(() => {});
            ""Then a line"".Then(() => {});
            }
            ";
                                                                                                                      environment.TextWritten.Should()
                                                                                                                                 .Be(expectedOutput);
            });
        }
コード例 #13
0
        public LoggingPageViewModel(ILogView logView, IClipboard <ILogView> clipboard, IMailClient <ILogView> mailClient)
        {
            LogView = logView;

            SendCommand = new DelegateCommand(() => mailClient.SendAsync(LogView));
            CopyCommand = new DelegateCommand(() => clipboard.Copy(LogView));
        }
コード例 #14
0
        public static List <DataObjectViewModel> BuildItems(
            List <JObject> searchResults,
            bool includeMetadata,
            string dataType,
            IDataApiClient dataApiClient,
            IClipboard clipboard,
            ICollectionSwitcher collectionSwitcher,
            Action <DataObjectViewModel> deleteCallback)
        {
            var dataObjects          = new List <DataObjectViewModel>();
            var jsonViewModelFactory = new JsonViewModelFactory(clipboard, collectionSwitcher);

            foreach (var jObject in searchResults)
            {
                var    id   = jObject.ContainsKey("_id") ? jObject["_id"].Value <string>() : null;
                JToken data = jObject;
                if (!includeMetadata && jObject.ContainsKey("Data"))
                {
                    data = jObject["Data"];
                }
                if (!(jsonViewModelFactory.Create(data) is JObjectViewModel jObjectViewModel))
                {
                    continue;
                }
                var dataObject = new DataObjectViewModel(jObjectViewModel, dataType, id, dataApiClient, deleteCallback);
                dataObjects.Add(dataObject);
            }
            return(dataObjects);
        }
コード例 #15
0
 public SourceExplorerHierarchyControllerFactory(
   ISynchronizationContextProvider synchronizationContextProvider,
   IFileSystemTreeSource fileSystemTreeSource,
   IVisualStudioPackageProvider visualStudioPackageProvider,
   IVsGlyphService vsGlyphService,
   IImageSourceFactory imageSourceFactory,
   IOpenDocumentHelper openDocumentHelper,
   IFileSystem fileSystem,
   IClipboard clipboard,
   IWindowsExplorer windowsExplorer,
   IUIRequestProcessor uiRequestProcessor,
   IEventBus eventBus,
   IGlobalSettingsProvider globalSettingsProvider,
   IDelayedOperationProcessor delayedOperationProcessor,
   IUIThread uiThread) {
   _synchronizationContextProvider = synchronizationContextProvider;
   _fileSystemTreeSource = fileSystemTreeSource;
   _visualStudioPackageProvider = visualStudioPackageProvider;
   _vsGlyphService = vsGlyphService;
   _imageSourceFactory = imageSourceFactory;
   _openDocumentHelper = openDocumentHelper;
   _fileSystem = fileSystem;
   _clipboard = clipboard;
   _windowsExplorer = windowsExplorer;
   _uiRequestProcessor = uiRequestProcessor;
   _eventBus = eventBus;
   _globalSettingsProvider = globalSettingsProvider;
   _delayedOperationProcessor = delayedOperationProcessor;
   _uiThread = uiThread;
 }
コード例 #16
0
        public MessageListViewModel(
            IEventAggregator eventAggregator,
            IServiceControl serviceControl,
            SearchBarViewModel searchBarViewModel,
            GeneralHeaderViewModel generalHeaderDisplay,
            IClipboard clipboard)
        {
            this.clipboard            = clipboard;
            this.eventAggregator      = eventAggregator;
            this.serviceControl       = serviceControl;
            this.generalHeaderDisplay = generalHeaderDisplay;

            SearchBar = searchBarViewModel;
            Items.Add(SearchBar);

            RetryMessageCommand  = new RetryMessageCommand(eventAggregator, serviceControl);
            CopyMessageIdCommand = new CopyMessageURICommand(clipboard, serviceControl);

            CopyHeadersCommand = this.CreateCommand(CopyHeaders, generalHeaderDisplay.WhenAnyValue(ghd => ghd.HeaderContent).Select(s => !s.IsEmpty()));

            Rows = new BindableCollection <StoredMessage>();

            this.WhenAnyValue(vm => vm.FocusedRow)
            .Throttle(TimeSpan.FromMilliseconds(500), RxApp.MainThreadScheduler)
            .Subscribe(_ => DoFocusedRowChanged());
        }
コード例 #17
0
 public XmlMessageViewModel(
     IContentDecoder<XmlDocument> xmlDecoder,
     IClipboard clipboard)
 {
     _xmlDecoder = xmlDecoder;
     _clipboard = clipboard;
 }
コード例 #18
0
        public CodeSearchController(
            CodeSearchControl control,
            IDispatchThreadServerRequestExecutor dispatchThreadServerRequestExecutor,
            IDispatchThreadDelayedOperationExecutor dispatchThreadDelayedOperationExecutor,
            IFileSystemTreeSource fileSystemTreeSource,
            ITypedRequestProcessProxy typedRequestProcessProxy,
            IProgressBarTracker progressBarTracker,
            IStandarImageSourceFactory standarImageSourceFactory,
            IWindowsExplorer windowsExplorer,
            IClipboard clipboard,
            ISynchronizationContextProvider synchronizationContextProvider,
            IOpenDocumentHelper openDocumentHelper,
            ITextDocumentTable textDocumentTable,
            IEventBus eventBus,
            IGlobalSettingsProvider globalSettingsProvider,
            IBuildOutputParser buildOutputParser,
            IVsEditorAdaptersFactoryService adaptersFactoryService,
            IShowServerInfoService showServerInfoService)
        {
            _control = control;
            _dispatchThreadServerRequestExecutor = dispatchThreadServerRequestExecutor;
            _fileSystemTreeSource      = fileSystemTreeSource;
            _typedRequestProcessProxy  = typedRequestProcessProxy;
            _progressBarTracker        = progressBarTracker;
            _standarImageSourceFactory = standarImageSourceFactory;
            _windowsExplorer           = windowsExplorer;
            _clipboard = clipboard;
            _synchronizationContextProvider = synchronizationContextProvider;
            _openDocumentHelper             = openDocumentHelper;
            _eventBus = eventBus;
            _globalSettingsProvider            = globalSettingsProvider;
            _buildOutputParser                 = buildOutputParser;
            _adaptersFactoryService            = adaptersFactoryService;
            _showServerInfoService             = showServerInfoService;
            _searchResultDocumentChangeTracker = new SearchResultsDocumentChangeTracker(
                dispatchThreadDelayedOperationExecutor,
                textDocumentTable);
            _taskCancellation = new TaskCancellation();

            // Ensure initial values are in sync.
            GlobalSettingsOnPropertyChanged(null, null);

            // Ensure changes to ViewModel are synchronized to global settings
            ViewModel.PropertyChanged += ViewModelOnPropertyChanged;

            // Ensure changes to global settings are synchronized to ViewModel
            _globalSettingsProvider.GlobalSettings.PropertyChanged += GlobalSettingsOnPropertyChanged;

            _eventBusCookie1 = _eventBus.RegisterHandler("TextDocument-Open", TextDocumentOpenHandler);
            _eventBusCookie2 = _eventBus.RegisterHandler("TextDocument-Closed", TextDocumentClosedHandler);
            _eventBusCookie3 = _eventBus.RegisterHandler("TextDocumentFile-FileActionOccurred", TextDocumentFileActionOccurred);

            typedRequestProcessProxy.EventReceived += TypedRequestProcessProxy_OnEventReceived;

            dispatchThreadServerRequestExecutor.ProcessFatalError += DispatchThreadServerRequestExecutor_OnProcessFatalError;

            fileSystemTreeSource.TreeReceived  += FileSystemTreeSource_OnTreeReceived;
            fileSystemTreeSource.ErrorReceived += FileSystemTreeSource_OnErrorReceived;
        }
コード例 #19
0
ファイル: Clipboard.cs プロジェクト: v-karpov/Nez
 public static string GetContents()
 {
     if (_instance == null)
     {
         _instance = new Clipboard();
     }
     return(_instance.GetContents());
 }
コード例 #20
0
ファイル: Driver.cs プロジェクト: pzaps/CrossGFX
        public void Initialize(string resourceDirectory, IClipboard clipboard)
        {
            System = new System(clipboard);
            ResourceManager = new ResourceManager();
            MusicPlayer = new MusicPlayer();

            DriverLoader.AddEnvironmentPaths(new string[] { global::System.IO.Path.GetFullPath(resourceDirectory + "/drivers/x86/sdl") });
        }
コード例 #21
0
        public ClipboardFilesRepository([NotNull] INotifyOfClipboardUpdates clipUpdater, [NotNull] IClipboard clipboard)
        {
            Debug.Assert(clipUpdater != null, nameof(clipUpdater) + " != null");
            Debug.Assert(clipboard != null, nameof(clipboard) + " != null");

            m_clipUpdater = clipUpdater;
            m_clipboard   = clipboard;
        }
コード例 #22
0
 public void TestInitialize()
 {
     XmlDecoder = Substitute.For <IContentDecoder <XmlDocument> >();
     Clipboard  = Substitute.For <IClipboard>();
     View       = Substitute.For <IXmlMessageView>();
     ViewModel  = new XmlMessageViewModel(XmlDecoder, Clipboard);
     ViewModel.Activate();
 }
コード例 #23
0
        public HistoryListItemViewModel(ContentBase content, IClipboard clipboard) : this()
        {
            _content = content;

            CopyToClipboardCommand = ReactiveCommand.Create(() => { content.SetToClipboard(clipboard); });

            Update();
        }
コード例 #24
0
 public void Copiar(IClipboard clipboard)
 {
     lock (this)
     {
         Seleccion sel = conttexto.ObtenerSeleccion();
         clipboard.Copiar(sel);
     }
 }
コード例 #25
0
ファイル: Clipboard.cs プロジェクト: Sockyman/Nez
 public static void SetContents(string text)
 {
     if (_instance == null)
     {
         _instance = new Clipboard();
     }
     _instance.SetContents(text);
 }
コード例 #26
0
 public RichTextEditInteractionElement(IRichTextComponent cText,
                                       IInputHandler inputHandler, IUndoRedoService undoRedo, IClipboard clipboard)
 {
     this.cText        = cText;
     this.undoRedo     = undoRedo;
     this.clipboard    = clipboard;
     this.inputHandler = inputHandler;
 }
コード例 #27
0
 public DataObjectLoader(
     IDataApiClient dataApiClient,
     IClipboard clipboard,
     ICollectionSwitcher collectionSwitcher)
 {
     this.dataApiClient   = dataApiClient;
     jsonViewModelFactory = new JsonViewModelFactory(clipboard, collectionSwitcher);
 }
コード例 #28
0
        //=========================================================================================
        internal bool CopyToClipboard(bool deleteSelection)
        {
            if (!this.HasSelection())
            {
                return(false);
            }

            //Determine start and end of selection
            TextPoint pStart, pEnd;

            if (this.SelectionStart > this.CurPos)
            {
                pStart = this.CurPos;
                pEnd   = this.SelectionStart;
            }
            else
            {
                pStart = this.SelectionStart;
                pEnd   = this.CurPos;
            }

            var sb = new StringBuilder();

            if (pStart.Line == pEnd.Line)
            {
                string sLine = this.Doc[pStart.Line].Text;
                sb.Append(sLine.Substring(pStart.Char, pEnd.Char - pStart.Char));
            }
            else
            {
                //first line
                sb.AppendLine(this.Doc[pStart.Line].Text.Substring(pStart.Char));
                //intermediate lines
                for (int iLine = pStart.Line + 1; iLine < pEnd.Line; iLine++)
                {
                    sb.AppendLine(this.Doc[iLine].Text);
                }
                //last line
                string sLastLine = this.Doc[pEnd.Line].Text;
                if (pEnd.Char < sLastLine.Length)
                {
                    sLastLine = sLastLine.Remove(pEnd.Char);
                }
                sb.Append(sLastLine);
            }
            if (this.ClipboardProxy == null)
            {
                this.ClipboardProxy = ClipboardProxyClass.Self;
            }
            try { this.ClipboardProxy.SetText(sb.ToString()); }
            catch (System.Runtime.InteropServices.ExternalException) { }

            if (deleteSelection)
            {
                this.DeleteSelection();
            }
            return(true);
        }
コード例 #29
0
        public VirtualEntryLine(IConsole console, IClipboard clipboard, ConsoleFontColor cmdColor)
        {
            console.Requires(nameof(console)).IsNotNull();
            clipboard.Requires(nameof(clipboard)).IsNotNull();

            this._console   = console;
            this._clipboard = clipboard;
            this._cmdColor  = cmdColor;
        }
コード例 #30
0
 public PasswordEntryScreen(
     INavigationService navigationService,
     IEventAggregator eventAggregator,
     IClipboard clipboard,
     IPageServices pageServices) : base(navigationService, eventAggregator, pageServices)
 {
     _navigationService = navigationService;
     _clipboard = clipboard;
 }
コード例 #31
0
ファイル: SagaHeaderViewModel.cs プロジェクト: 4lx/Profiler
 public SagaHeaderViewModel(
     IEventAggregator eventAggregator,
     IContentDecoder <IList <HeaderInfo> > decoder,
     IQueueManagerAsync queueManager,
     IClipboard clipboard)
     : base(eventAggregator, decoder, queueManager, clipboard)
 {
     DisplayName = "Saga";
 }
コード例 #32
0
        public ShowCodePageViewModel(BaseServices baseServices, ICodeSampleResolver codeSampleResolver, IClipboard clipboard)
            : base(baseServices)
        {
            CodeSampleResolver = codeSampleResolver;
            Clipboard          = clipboard;

            TapCommand = new DelegateCommand <string>(OnTapCommandExecuted);
            CopyTextToClipboardCommand = new DelegateCommand(OnCopyTextToClipboardCommandExecuted);
        }
コード例 #33
0
 public GeneralHeaderViewModel(
     IEventAggregator eventAggregator, 
     IContentDecoder<IList<HeaderInfo>> decoder, 
     IQueueManagerAsync queueManager, 
     IClipboard clipboard)
     : base(eventAggregator, decoder, queueManager, clipboard)
 {
     DisplayName = "General";
 }
コード例 #34
0
        public ShowCodePageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, ILogger logger, ICodeSampleResolver codeSampleResolver, IClipboard clipboard)
            : base(navigationService, pageDialogService, logger)
        {
            CodeSampleResolver = codeSampleResolver;
            Clipboard          = clipboard;

            TapCommand = new DelegateCommand <string>(OnTapCommandExecuted);
            CopyTextToClipboardCommand = new DelegateCommand(OnCopyTextToClipboardCommandExecuted);
        }
コード例 #35
0
        public override void OnFrameworkInitializationCompleted()
        {
            TemplateService = new TemplateService();
            ImageService    = new ImageService();
            Clipboard       = AvaloniaLocator.Current.GetService <IClipboard>();

            // init logger
            Log.Logger = new LoggerConfiguration()
#if DEBUG
                         .ReadFrom.Configuration(Configuration)
#else
                         .WriteTo.Sentry(o =>
            {
                o.Dsn = new Dsn("https://[email protected]/8");
                // Debug and higher are stored as breadcrumbs (default is Information)
                o.MinimumBreadcrumbLevel = LogEventLevel.Information;
                // Warning and higher is sent as event (default is Error)
                o.MinimumEventLevel = LogEventLevel.Error;
            })
#endif
                         .CreateLogger();

            var currenciesProvider = new CurrenciesProvider(CurrenciesConfigurationString);
            var symbolsProvider    = new SymbolsProvider(SymbolsConfiguration);

            // init Atomex client app
            AtomexApp = new AtomexApp()
                        .UseCurrenciesProvider(currenciesProvider)
                        .UseSymbolsProvider(symbolsProvider)
                        .UseCurrenciesUpdater(new CurrenciesUpdater(currenciesProvider))
                        .UseSymbolsUpdater(new SymbolsUpdater(symbolsProvider))
                        .UseQuotesProvider(new BitfinexQuotesProvider(
                                               currencies: currenciesProvider.GetCurrencies(Network.MainNet),
                                               baseCurrency: BitfinexQuotesProvider.Usd));

            if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
            {
                var mainWindow = new MainWindow();
                DialogService = new DialogService <DialogServiceView>(mainWindow);
                var mainWindowViewModel = new MainWindowViewModel(AtomexApp, mainWindow);

                mainWindow.DataContext = mainWindowViewModel;
                desktop.MainWindow     = mainWindow;

                desktop.Exit += OnExit;

                // var sink = new InMemorySink(mainWindowViewModel.LogEvent);
                // Log.Logger = new LoggerConfiguration()
                //     .WriteTo.Sink(sink)
                //     .CreateLogger();
            }

            AtomexApp.Start();

            base.OnFrameworkInitializationCompleted();
        }
コード例 #36
0
        private static void InitializeWindows()
        {
            Win32Platform.Initialize();

            PlatformThreadingInterface = Win32Platform.Instance;
            WindowingInterface         = Win32Platform.Instance;
            StandardCursorFactory      = CursorFactory.Instance;
            SystemDialogImplementation = new SystemDialogImpl();
            ClipboardInterface         = new ClipboardImpl();
        }
コード例 #37
0
 public SearchResultsViewModel(
     INavigationService navigationService,
     IEventAggregator eventAggregator,
     IClipboard clipboard,
     IPageServices pageServices,
     IPWDatabaseDataSource dataSource)
     : base(navigationService, eventAggregator, clipboard, pageServices)
 {
     _dataSource = dataSource;
     Results = new ObservableCollection<PwEntry>();
 }
コード例 #38
0
        public LogWindowViewModel(IClipboard clipboard)
        {
            this.clipboard = clipboard;

            Logs = new ReactiveList<LogMessage>();

            textFormatter = new MessageTemplateTextFormatter("{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}", CultureInfo.InvariantCulture);
            LogObserver.SubscribeOn(RxApp.TaskpoolScheduler).Subscribe(UpdateLog);

            ClearCommand = this.CreateCommand(Clear);
            CopyCommand = this.CreateCommand(Copy);
        }
コード例 #39
0
 protected HeaderInfoViewModelBase(
     IEventAggregator eventAggregator, 
     IContentDecoder<IList<HeaderInfo>> decoder, 
     IQueueManagerAsync queueManager,
     IClipboard clipboard)
 {
     _decoder = decoder;
     _clipboard = clipboard;
     EventAggregator = eventAggregator;
     QueueManager = queueManager;
     Items = new BindableCollection<HeaderInfo>();
 }
コード例 #40
0
        protected override void Establish_context()
        {
            _clipboard = CreateStub<IClipboard>();
            _specParser = CreateStub<ISpecParser>();
            _cSharpCodeWriter = CreateStub<ICodeWriter>();
            _application = new Application(_clipboard, _specParser, _cSharpCodeWriter);

            var parsedSpec = new ParsedSpec();

            _clipboard.Stub(c => c.GetData()).Return("spec");
            _specParser.Stub(p => p.Parse("spec")).Return(parsedSpec);
            _cSharpCodeWriter.Stub(w => w.WriteCode(parsedSpec)).Return("code");
        }
コード例 #41
0
 public MessagePropertiesViewModel(
     IErrorHeaderViewModel error,
     IGeneralHeaderViewModel general,
     ISagaHeaderViewModel saga,
     IPerformanceHeaderViewModel performance,
     IGatewayHeaderViewModel gateway,
     IClipboard clipboard)
 {
     _clipboard = clipboard;
     Saga = saga;
     Performance = performance;
     Gateway = gateway;
     Errors = error;
     General = general;
 }
コード例 #42
0
 public void PastingDoubleQuotesInScenario(IClipboard clipboard,
                                           GherkinPaster sut,
                                           TestEnvironment environment)
 {
     "Given a complete system".Given(() =>
     {
         environment = FakesLibrary.CreateDefaultEnvironment();
         sut = new GherkinPaster(environment);
     });
     "and a scenario containing a 'double quote'".And(() => clipboard = FakesLibrary.CreateShim("Scenario: With a \" character"));
     "When the single line is pasted".Then(() => sut.PasteGherkin(clipboard));
     "Then the 'double quote' character has been removed".Then(() => environment.LinesWritten.Any(l => l.Contains("\""))
                                                                                .Should()
                                                                                .BeFalse());
 }
コード例 #43
0
 public void SingleLinePaste(IClipboard clipboard,
                             GherkinPaster sut,
                             TestEnvironment environment)
 {
     "Given a complete system".Given(() =>
     {
         environment = FakesLibrary.CreateDefaultEnvironment();
         sut = new GherkinPaster(environment);
     });
     "and a single line of valid gherkin".And(() => clipboard = FakesLibrary.CreateShim("Given a single line"));
     "When the single line is pasted".Then(() => sut.PasteGherkin(clipboard));
     "Then only a single line is received by the environment".Then(() => environment.LinesWritten.Count()
                                                                                    .Should()
                                                                                    .Be(1));
 }
コード例 #44
0
 public MessagePropertiesViewModel(
     ErrorHeaderViewModel error,
     GeneralHeaderViewModel general,
     SagaHeaderViewModel saga,
     PerformanceHeaderViewModel performance,
     GatewayHeaderViewModel gateway,
     IClipboard clipboard)
 {
     Saga = saga;
     Performance = performance;
     Gateway = gateway;
     Errors = error;
     General = general;
     this.clipboard = clipboard;
 }
コード例 #45
0
 public void TestInitialize()
 {
     eventAggregator = Substitute.For<IEventAggregator>();
     workNotifier = Substitute.For<IWorkNotifier>();
     serviceControl = Substitute.For<IServiceControl>();
     searchBar = Substitute.For<SearchBarViewModel>();
     clipboard = Substitute.For<IClipboard>();
     messageListFunc = () => new MessageListViewModel(
         eventAggregator,
         workNotifier,
         serviceControl,
         searchBar,
         Substitute.For<GeneralHeaderViewModel>(),
         Substitute.For<MessageSelectionContext>(),
         clipboard);
 }
コード例 #46
0
        public void PasteGherkin(IClipboard source)
        {
            if (!source.ContainsText())
                return;

            var gherkinText = source.GetText()
                                    .Split(new[] {Environment.NewLine},
                                           StringSplitOptions.RemoveEmptyEntries)
                                    .Select(s => s.Trim());

            var gherkinTree = new GherkinTree(LineGenerators.CSharp,
                                              GWTIdentify);
            gherkinTree.AddLines(gherkinText);

            _environment.Paste(gherkinTree.ToString());
        }
コード例 #47
0
 public void PAstingDoubleQuotesInGWTIClipboard(IClipboard clipboard,
                                                GherkinPaster sut,
                                                TestEnvironment environment)
 {
     "Given a complete system".Given(() =>
     {
         environment = FakesLibrary.CreateDefaultEnvironment();
         sut = new GherkinPaster(environment);
     });
     "and a line containing a 'double quote'".And(() => clipboard = FakesLibrary.CreateShim("Given a \" character"));
     "When the line is pasted".Then(() => sut.PasteGherkin(clipboard));
     "then the 'double quote' character has been replaced by the 'backlash' and 'boudle quote' characters".Then(() =>
     {
         environment.LinesWritten[0].Should()
                                    .Be("\"Given a \\\" character\".Given(() => {});");
     });
 }
コード例 #48
0
 public SourceExplorerViewModelHost(
     SourceExplorerControl control,
     IUIRequestProcessor uiRequestProcessor,
     IStandarImageSourceFactory standarImageSourceFactory,
     IWindowsExplorer windowsExplorer,
     IClipboard clipboard,
     ISynchronizationContextProvider synchronizationContextProvider,
     IOpenDocumentHelper openDocumentHelper)
 {
     _control = control;
       _uiRequestProcessor = uiRequestProcessor;
       _standarImageSourceFactory = standarImageSourceFactory;
       _windowsExplorer = windowsExplorer;
       _clipboard = clipboard;
       _synchronizationContextProvider = synchronizationContextProvider;
       _openDocumentHelper = openDocumentHelper;
 }
コード例 #49
0
        public XmlMessageViewModel(
            IContentDecoder<XmlDocument> xmlDecoder,
            IContentDecoder<string> stringDecoder,
            IClipboard clipboard)
        {
            _xmlDecoder = xmlDecoder;
            _stringDecoder = stringDecoder;
            _clipboard = clipboard;

            //TODO: Add back context menu
//            ContextMenuItems = new List<PluginContextMenu>
//            {
//                new PluginContextMenu("CopyMessageXml", new RelayCommand(CopyMessageXml, CanCopyMessageXml))
//                {
//                    DisplayName = "Copy Message",
//                }
//            };
        }
コード例 #50
0
        private MessageFlowViewModel CreateSUT()
        {
            _serviceControl = Substitute.For<IServiceControl>();
            _eventAggregator = Substitute.For<IEventAggregator>();
            _clipboard = Substitute.For<IClipboard>();
            _windowManager = Substitute.For<IWindowManagerEx>();
            _screenFactory = Substitute.For<IScreenFactory>();
            _searchBar = Substitute.For<ISearchBarViewModel>();
            _messageList = Substitute.For<IMessageListViewModel>();
            _settingProvider = Substitute.For<ISettingsProvider>();
            _endpointExplorer = Substitute.For<IEndpointExplorerViewModel>();

            return new MessageFlowViewModel(_serviceControl,
                                            _eventAggregator,
                                            _clipboard,
                                            _windowManager,
                                            _screenFactory,
                                            _searchBar,
                                            _messageList,
                                            _settingProvider,
                                            _endpointExplorer);
        }
コード例 #51
0
ファイル: ErrorHeaderViewModel.cs プロジェクト: 4lx/Profiler
        public ErrorHeaderViewModel(
            IEventAggregator eventAggregator, 
            IContentDecoder<IList<HeaderInfo>> decoder, 
            IQueueManagerAsync queueManager, 
            IClipboard clipboard)
            : base(eventAggregator, decoder, queueManager, clipboard)
        {
            DisplayName = "Errors";

            //TODO:Add back the context menu
            //            ContextMenuItems.AddRange(new[]
            //            {
            //                new PluginContextMenu("ReturnToSourceQueue", new RelayCommand(ReturnToSource, CanReturnToSource), 90)
            //                {
            //                    DisplayName = "Return To Source Queue",
            //                    Image = Resources.MessageReturn
            //                },
            //                new PluginContextMenu("CopyHeaderInfo", new RelayCommand(CopyHeaderInfo, CanCopyHeaderInfo))
            //                {
            //                    DisplayName = "Copy Header Info",
            //                }
            //            });
        }
コード例 #52
0
 public CopyConversationIDCommand(IClipboard clipboard)
 {
     this.clipboard = clipboard;
 }
コード例 #53
0
 public void TestInitialize()
 {
     StringDecoder = Substitute.For<IContentDecoder<string>>();
     XmlDecoder = Substitute.For<IContentDecoder<XmlDocument>>();
     Clipboard = Substitute.For<IClipboard>();
     View = Substitute.For<IXmlMessageView>();
     ViewModel = new XmlMessageViewModel(XmlDecoder, StringDecoder, Clipboard);
     ViewModel.Activate();
 }
コード例 #54
0
 public CopyMessageURICommand(IClipboard clipboard, IServiceControl serviceControl)
 {
     this.clipboard = clipboard;
     this.serviceControl = serviceControl;
 }
コード例 #55
0
ファイル: Application.cs プロジェクト: JonKruger/Specs2Tests
 public Application(IClipboard clipboard, ISpecParser specParser, ICodeWriter cSharpCodeWriter)
 {
     _clipboard = clipboard;
     _specParser = specParser;
     _codeWriter = cSharpCodeWriter;
 }
コード例 #56
0
ファイル: System.cs プロジェクト: pzaps/CrossGFX
 public System(IClipboard clipboard)
 {
     this.Clipboard = clipboard;
 }
コード例 #57
0
 public void TestInitialize()
 {
     EventAggregator = Substitute.For<IEventAggregator>();
     ServiceControl = Substitute.For<IServiceControl>();
     SearchBar = Substitute.For<SearchBarViewModel>();
     Clipboard = Substitute.For<IClipboard>();
     MessageListFunc = () => new MessageListViewModel(EventAggregator,
                                            ServiceControl,
                                            SearchBar,
                                            Substitute.For<GeneralHeaderViewModel>(),
                                            Clipboard);
 }
コード例 #58
0
ファイル: System.cs プロジェクト: pzaps/CrossGFX
 public System(IClipboard clipboard)
 {
     stopwatch = new Stopwatch();
     this.Clipboard = clipboard;
 }
コード例 #59
0
 public SelectableTextBoxEditor()
 {
     _clipboard = new WpfClipboard();
 }
コード例 #60
0
 public void TestInitialize()
 {
     clipboard = Substitute.For<IClipboard>();
     viewModel = new LogWindowViewModel(clipboard);
 }