本文整理汇总了C#中IVimGlobalSettings类的典型用法代码示例。如果您正苦于以下问题:C# IVimGlobalSettings类的具体用法?C# IVimGlobalSettings怎么用?C# IVimGlobalSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVimGlobalSettings类属于命名空间,在下文中一共展示了IVimGlobalSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
internal static void Initialize(IVimGlobalSettings globalSettings, IVimApplicationSettings vimApplicationSettings)
{
var settingsSource = new SettingsSource(vimApplicationSettings);
globalSettings.AddCustomSetting(UseEditorIndentName, UseEditorIndentName, settingsSource);
globalSettings.AddCustomSetting(UseEditorDefaultsName, UseEditorDefaultsName, settingsSource);
globalSettings.AddCustomSetting(UseEditorTabAndBackspaceName, UseEditorTabAndBackspaceName, settingsSource);
}
示例2: CreateLocalSettings
internal static Mock<IVimLocalSettings> CreateLocalSettings(
IVimGlobalSettings global = null)
{
global = global ?? CreateGlobalSettings().Object;
var mock = new Mock<IVimLocalSettings>(MockBehavior.Strict);
mock.SetupGet(x => x.GlobalSettings).Returns(global);
return mock;
}
示例3: CreateLocalSettings
public static Mock<IVimLocalSettings> CreateLocalSettings(
IVimGlobalSettings global = null,
MockRepository factory = null)
{
factory = factory ?? new MockRepository(MockBehavior.Strict);
global = global ?? CreateGlobalSettings(factory: factory).Object;
var mock = factory.Create<IVimLocalSettings>(MockBehavior.Strict);
mock.SetupGet(x => x.GlobalSettings).Returns(global);
return mock;
}
示例4: VimTest
protected VimTest()
{
_factory = new MockRepository(MockBehavior.Strict);
_globalSettings = new GlobalSettings();
_fileSystem = _factory.Create<IFileSystem>(MockBehavior.Strict);
_bufferFactory = VimBufferFactory;
_simpleListener = new SimpleListener();
var creationListeners = new [] { new Lazy<IVimBufferCreationListener>(() => _simpleListener) };
var map = new Dictionary<string, VariableValue>();
_keyMap = new KeyMap(_globalSettings, map);
_vimHost = _factory.Create<IVimHost>(MockBehavior.Strict);
_vimHost.Setup(x => x.CreateHiddenTextView()).Returns(CreateTextView());
_vimHost.Setup(x => x.AutoSynchronizeSettings).Returns(true);
_vimRaw = new Vim(
_vimHost.Object,
_bufferFactory,
CompositionContainer.GetExportedValue<IVimInterpreterFactory>(),
creationListeners.ToFSharpList(),
_globalSettings,
_factory.Create<IMarkMap>().Object,
_keyMap,
MockObjectFactory.CreateClipboardDevice().Object,
_factory.Create<ISearchService>().Object,
_fileSystem.Object,
new VimData(_globalSettings),
_factory.Create<IBulkOperations>().Object,
map,
new EditorToSettingSynchronizer());
_vim = _vimRaw;
_vim.AutoLoadVimRc = false;
}
示例5: Create
private void Create(ITextView textView)
{
_textView = textView;
_textBuffer = textView.TextBuffer;
_buffer = _textView.TextBuffer;
_snapshot = _buffer.CurrentSnapshot;
_buffer.Changed += delegate { _snapshot = _buffer.CurrentSnapshot; };
_globalSettings = new Vim.GlobalSettings();
_localSettings = new LocalSettings(_globalSettings, _textView);
_markMap = new MarkMap(new TrackingLineColumnService());
_vimData = new VimData();
_search = VimUtil.CreateSearchService(_globalSettings);
_jumpList = VimUtil.CreateJumpList();
_statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict);
_navigator = VimUtil.CreateTextStructureNavigator(_textView.TextBuffer);
_motionUtil = new MotionUtil(
_textView,
_markMap,
_localSettings,
_search,
_navigator,
_jumpList,
_statusUtil.Object,
_vimData);
}
示例6: Create
private void Create(ITextView textView, IEditorOptions editorOptions = null)
{
_textView = textView;
_textBuffer = textView.TextBuffer;
_snapshot = _textBuffer.CurrentSnapshot;
_textBuffer.Changed += delegate { _snapshot = _textBuffer.CurrentSnapshot; };
_globalSettings = new Vim.GlobalSettings();
_localSettings = new LocalSettings(_globalSettings, FSharpOption.CreateForReference(editorOptions), FSharpOption.CreateForReference(textView));
_markMap = new MarkMap(new TrackingLineColumnService());
_vimData = new VimData();
_search = VimUtil.CreateSearchService(_globalSettings);
_jumpList = VimUtil.CreateJumpList();
_statusUtil = new Mock<IStatusUtil>(MockBehavior.Strict);
_navigator = VimUtil.CreateTextStructureNavigator(_textView, WordKind.NormalWord);
_motionUtil = new MotionUtil(
_textView,
_markMap,
_localSettings,
_search,
_navigator,
_jumpList,
_statusUtil.Object,
VimUtil.GetWordUtil(textView),
_vimData);
}
示例7: VimTest
public VimTest()
{
_factory = new MockRepository(MockBehavior.Strict);
_globalSettings = new GlobalSettings();
_markMap = _factory.Create<IMarkMap>(MockBehavior.Strict);
_fileSystem = _factory.Create<IFileSystem>(MockBehavior.Strict);
_bufferFactory = VimBufferFactory;
var map = new Dictionary<string, VariableValue>();
_keyMap = new KeyMap(_globalSettings, map);
_vimHost = _factory.Create<IVimHost>(MockBehavior.Strict);
_searchInfo = _factory.Create<ISearchService>(MockBehavior.Strict);
_vimRaw = new Vim(
_vimHost.Object,
_bufferFactory,
FSharpList<Lazy<IVimBufferCreationListener>>.Empty,
_globalSettings,
_markMap.Object,
_keyMap,
MockObjectFactory.CreateClipboardDevice().Object,
_searchInfo.Object,
_fileSystem.Object,
new VimData(),
_factory.Create<IBulkOperations>().Object,
map);
_vim = _vimRaw;
_vim.AutoLoadVimRc = false;
}
示例8: KeyMapTest
public KeyMapTest()
{
_globalSettings = new GlobalSettings();
_variableMap = new Dictionary<string, VariableValue>();
_mapRaw = new KeyMap(_globalSettings, _variableMap);
_map = _mapRaw;
}
示例9: HostFactoryTest
protected HostFactoryTest()
{
_globalSettings = Vim.GlobalSettings;
_protectedOperations = new TestableProtectedOperations();
_mockFactory = new MockRepository(MockBehavior.Strict);
_synchronizer = _mockFactory.Create<IEditorToSettingsSynchronizer>(MockBehavior.Strict);
_vsEditorAdaptersFactoryService = _mockFactory.Create<IVsEditorAdaptersFactoryService>();
_vimApplicationSettings = _mockFactory.Create<IVimApplicationSettings>(MockBehavior.Loose);
var vsAdapter = _mockFactory.Create<IVsAdapter>();
vsAdapter.SetupGet(x => x.EditorAdapter).Returns(_vsEditorAdaptersFactoryService.Object);
_hostFactory = new HostFactory(
Vim,
_vsEditorAdaptersFactoryService.Object,
_mockFactory.Create<IDisplayWindowBrokerFactoryService>(MockBehavior.Loose).Object,
_mockFactory.Create<ITextManager>(MockBehavior.Loose).Object,
vsAdapter.Object,
_protectedOperations,
new VimBufferCoordinatorFactory(Vim),
_mockFactory.Create<IKeyUtil>(MockBehavior.Loose).Object,
_synchronizer.Object,
_vimApplicationSettings.Object,
new Lazy<ICommandTargetFactory, IOrderable>[] { });
}
示例10: Setup
public void Setup()
{
_synchronizer = new EditorToSettingSynchronizer(EditorUtil.FactoryService.Vim);
_buffer = EditorUtil.FactoryService.Vim.CreateBuffer(EditorUtil.CreateTextView(""));
_localSettings = _buffer.LocalSettings;
_globalSettings = _localSettings.GlobalSettings;
_editorOptions = _localSettings.EditorOptions.Value;
}
示例11: Create
protected void Create(params string[] lines)
{
_textView = CreateTextView(lines);
_vimBuffer = Vim.CreateVimBuffer(_textView);
_vimBuffer.SwitchMode(ModeKind.Normal, ModeArgument.None);
_globalSettings = _vimBuffer.LocalSettings.GlobalSettings;
VimHost.FocusedTextView = _textView;
}
示例12: Create
protected void Create(bool insertMode, params string[] lines)
{
_factory = new MockRepository(MockBehavior.Strict);
_factory.DefaultValue = DefaultValue.Mock;
_textView = CreateTextView(lines);
_textBuffer = _textView.TextBuffer;
_vim = _factory.Create<IVim>(MockBehavior.Loose);
_editorOptions = _factory.Create<IEditorOptions>(MockBehavior.Loose);
_textChangeTracker = _factory.Create<ITextChangeTracker>(MockBehavior.Loose);
_textChangeTracker.SetupGet(x => x.CurrentChange).Returns(FSharpOption<TextChange>.None);
_undoRedoOperations = CreateUndoRedoOperations();
_wordCompletionSessionFactoryService = _factory.Create<IWordCompletionSessionFactoryService>();
var localSettings = new LocalSettings(Vim.GlobalSettings);
_vimBuffer = Vim.CreateVimBuffer(_textView);
_globalSettings = _vimBuffer.GlobalSettings;
var vimTextBuffer = Vim.GetOrCreateVimTextBuffer(_textView.TextBuffer);
var vimBufferData = CreateVimBufferData(vimTextBuffer, _textView);
_operations = CommonOperationsFactory.GetCommonOperations(vimBufferData);
_broker = _factory.Create<IDisplayWindowBroker>();
_broker.SetupGet(x => x.IsCompletionActive).Returns(false);
_broker.SetupGet(x => x.IsQuickInfoActive).Returns(false);
_broker.SetupGet(x => x.IsSignatureHelpActive).Returns(false);
_broker.SetupGet(x => x.IsSmartTagSessionActive).Returns(false);
_insertUtil = _factory.Create<IInsertUtil>();
_motionUtil = _factory.Create<IMotionUtil>();
_commandUtil = _factory.Create<ICommandUtil>();
_capture = _factory.Create<IMotionCapture>();
// Setup the mouse. By default we say it has no buttons down as that's the normal state
_mouseDevice = _factory.Create<IMouseDevice>();
_mouseDevice.SetupGet(x => x.IsLeftButtonPressed).Returns(false);
// Setup the keyboard. By default we don't say that any button is pressed. Insert mode is usually
// only concerned with arrow keys and we will set those up as appropriate for the typing tests
_keyboardDevice = _factory.Create<IKeyboardDevice>();
_keyboardDevice.Setup(x => x.IsArrowKeyDown).Returns(false);
_modeRaw = new global::Vim.Modes.Insert.InsertMode(
_vimBuffer,
_operations,
_broker.Object,
_editorOptions.Object,
_undoRedoOperations,
_textChangeTracker.Object,
_insertUtil.Object,
_motionUtil.Object,
_commandUtil.Object,
_capture.Object,
!insertMode,
_keyboardDevice.Object,
_mouseDevice.Object,
WordUtil,
_wordCompletionSessionFactoryService.Object);
_mode = _modeRaw;
_mode.OnEnter(ModeArgument.None);
_mode.CommandRan += (sender, e) => { _lastCommandRan = e.CommandRunData; };
}
示例13: EditorToSettingSynchronizerTest
public EditorToSettingSynchronizerTest()
{
_synchronizer = new EditorToSettingSynchronizer(EditorOptionsFactoryService, Vim);
_buffer = CreateVimBuffer("");
_localSettings = _buffer.LocalSettings;
_globalSettings = _localSettings.GlobalSettings;
_editorOptions = _buffer.TextView.Options;
}
示例14: Create
private void Create(params string[] lines)
{
_globalSettings = Vim.GlobalSettings;
_vimBuffer = CreateVimBuffer(lines);
_textView = (IWpfTextView)_vimBuffer.TextView;
_textBuffer = _vimBuffer.TextBuffer;
_commonOperationsRaw = (CommonOperations)CommonOperationsFactory.GetCommonOperations(_vimBuffer.VimBufferData);
_commonOperations = _commonOperationsRaw;
}
示例15: Create
protected void Create(ModeArgument argument, params string[] lines)
{
_textView = CreateTextView(lines);
_textBuffer = _textView.TextBuffer;
_vimBuffer = Vim.CreateVimBuffer(_textView);
_vimBuffer.SwitchMode(ModeKind.Insert, argument);
_register = Vim.RegisterMap.GetRegister('c');
_globalSettings = Vim.GlobalSettings;
_localSettings = _vimBuffer.LocalSettings;
}