当前位置: 首页>>代码示例>>C#>>正文


C# _DTE类代码示例

本文整理汇总了C#中_DTE的典型用法代码示例。如果您正苦于以下问题:C# _DTE类的具体用法?C# _DTE怎么用?C# _DTE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


_DTE类属于命名空间,在下文中一共展示了_DTE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetTarget

 public object GetTarget(_DTE vs)
 {
     if ((vs.SelectedItems == null) || (vs.SelectedItems.Count <= 0))
       {
     throw new InvalidOperationException("invalid");
       }
       if (vs.SelectedItems.Count != 1)
       {
     return vs.SelectedItems;
       }
       SelectedItem item = vs.SelectedItems.Item(1);
       if (item.Project != null)
       {
     return item.Project;
       }
       if (item.ProjectItem != null)
       {
     return item.ProjectItem;
       }
       if (vs.Solution.Properties.Item("Name").Value.Equals(item.Name))
       {
     return vs.Solution;
       }
       return item;
 }
开发者ID:sunday-out,项目名称:SharePoint-Software-Factory,代码行数:25,代码来源:CheckOpenSourceControlExplorer.cs

示例2: MovePageCodeToBackup

        public static bool MovePageCodeToBackup(string id, string file, string name, string backupFolder, _DTE dte)
        {
            string csfileName = string.Format("{0}.cs", file);
            string designerfileName = string.Format("{0}.designer.cs", file);
            string aspxfileNameBackup = string.Format(@"{0}BTPage_{1}_{2}.aspx", backupFolder, id.Replace("-", "_"), name);
            string csfileNameBackup = string.Format("{0}.cs", aspxfileNameBackup);
            string designerfileNameBackup = string.Format("{0}.designer.cs", aspxfileNameBackup);

            if (File.Exists(file))
            {
                if (File.Exists(aspxfileNameBackup))
                    File.Delete(aspxfileNameBackup);

                if (File.Exists(csfileNameBackup))
                    File.Delete(csfileNameBackup);

                if (File.Exists(designerfileNameBackup))
                    File.Delete(designerfileNameBackup);

                dte.Solution.FindProjectItem(file).Remove();

                File.Move(file, aspxfileNameBackup);
                File.Move(csfileName, csfileNameBackup);
                File.Move(designerfileName, designerfileNameBackup);

                return true;
            }

            return false;
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:30,代码来源:ImportHelper.cs

示例3: VsVimHost

        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            IWordUtilFactory wordUtilFactory,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            SVsServiceProvider serviceProvider)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _wordUtilFactory = wordUtilFactory;
            _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager = textManager;
            _sharedService = sharedServiceFactory.Create();
            _vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();

            uint cookie;
            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
开发者ID:0-F,项目名称:VsVim,代码行数:26,代码来源:VsVimHost.cs

示例4: CheckOutFile

		/// <summary>
		/// Checks the out file.
		/// </summary>
		/// <param name="vs">The vs.</param>
		/// <param name="filePath">The file path.</param>
		public static void CheckOutFile(_DTE vs, string filePath)
		{
            Guard.ArgumentNotNullOrWhiteSpaceString(filePath, "filePath");

            //Do nothing if no DTE instance
            if (vs == null)
            {
                Trace.TraceWarning("TFSHelper.CheckOutFile: No DTE instance available to access TFS functions.");
                return;
            }

			if (File.Exists(filePath))
			{
				if (vs.SourceControl.IsItemUnderSCC(filePath) &&
					!vs.SourceControl.IsItemCheckedOut(filePath))
				{
					bool checkout = vs.SourceControl.CheckOutItem(filePath);
					if (!checkout)
					{
						throw new CheckoutException(
							string.Format(CultureInfo.CurrentCulture, Properties.Resources.CheckoutException, filePath));
					}
				}
				else
				{
					// perform an extra check if the file is read only.
					if (IsReadOnly(filePath))
					{
						ResetReadOnly(filePath);
					}
				}
			}
		}
开发者ID:Phidiax,项目名称:open-wssf-2015,代码行数:38,代码来源:TFSHelper.cs

示例5: VsVimHost

        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ISmartIndentationService smartIndentationService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            IVimApplicationSettings vimApplicationSettings,
            SVsServiceProvider serviceProvider)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager = textManager;
            _sharedService = sharedServiceFactory.Create();
            _vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();
            _fontProperties = new TextEditorFontProperties(serviceProvider);
            _vimApplicationSettings = vimApplicationSettings;
            _smartIndentationService = smartIndentationService;

            uint cookie;
            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
开发者ID:honeyhoneywell,项目名称:VsVim,代码行数:29,代码来源:VsVimHost.cs

示例6: SettingsMigrator

 internal SettingsMigrator(SVsServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, ILegacySettings legacySettings, [EditorUtilsImport] IProtectedOperations protectedOperations)
 {
     _dte = serviceProvider.GetService<SDTE, _DTE>();
     _vimApplicationSettings = vimApplicationSettings;
     _legacySettings = legacySettings;
     _protectedOperations = protectedOperations;
 }
开发者ID:wmchristie,项目名称:VsVim,代码行数:7,代码来源:SettingsMigrator.cs

示例7: CommandFilter

 public CommandFilter(IWpfTextView textView, IVsEditorAdaptersFactoryService factoryService, _DTE dt)
 {
     this.textView = textView;
     this.factoryService = factoryService;
     dte = dt;
     textView.GotAggregateFocus += textView_GotAggregateFocus;
 }
开发者ID:chrisortman,项目名称:approval_tests,代码行数:7,代码来源:CommandFilter.cs

示例8: CheckoutFileIfRequired

        private static void CheckoutFileIfRequired(_DTE dte, String fileName)
        {
            _checkOutAction = (String fn) => dte.SourceControl.CheckOutItem(fn);

            var sc = dte.SourceControl;
            if (sc != null && sc.IsItemUnderSCC(fileName) && !sc.IsItemCheckedOut(fileName))
                _checkOutAction.EndInvoke(_checkOutAction.BeginInvoke(fileName, null, null));
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:8,代码来源:base.cs

示例9: KeyBindingService

 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings)
 {
     _dte = serviceProvider.GetService<SDTE, _DTE>();
     _vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
     _optionsDialogService = service;
     _protectedOperations = protectedOperations;
     _vimApplicationSettings = vimApplicationSettings;
     _importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet);
 }
开发者ID:rhanekom,项目名称:VsVim,代码行数:9,代码来源:KeyBindingService.cs

示例10: BackspaceDeleteKeyFilter

 public BackspaceDeleteKeyFilter(_DTE app, IWpfTextView textView)
     : base(textView)
 {
     var events = (Events2) app.Events;
     // ReSharper disable RedundantArgumentDefaultValue
     _keyPressEvents = events.TextDocumentKeyPressEvents[null];
     // ReSharper restore RedundantArgumentDefaultValue
     _keyPressEvents.BeforeKeyPress += BeforeKeyPress;
 }
开发者ID:TeaDrivenDev,项目名称:tabsanity-vs,代码行数:9,代码来源:BackspaceDeleteKeyFilter.cs

示例11: KeyBindingService

 internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, IProtectedOperations protectedOperations, ILegacySettings legacySettings)
 {
     _dte = serviceProvider.GetService<SDTE, _DTE>();
     _vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
     _optionsDialogService = service;
     _protectedOperations = protectedOperations;
     _legacySettings = legacySettings;
     _importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet);
 }
开发者ID:ericbock,项目名称:VsVim,代码行数:9,代码来源:KeyBindingService.cs

示例12: Configuration

        public Configuration(_DTE application, WizardRunKind kind, Dictionary<string, string> replacements)
        {
            Application = application;
            Kind = kind;
            Replacements = replacements;

            DefineSolutionName();
            DefineSolutionRoot();
        }
开发者ID:marektihkan,项目名称:Arc,代码行数:9,代码来源:Configuration.cs

示例13: VsVimHost

 internal VsVimHost(
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     SVsServiceProvider serviceProvider)
 {
     _undoManagerProvider = undoManagerProvider;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));
 }
开发者ID:minhajuddin,项目名称:VsVim,代码行数:10,代码来源:VsVimHost.cs

示例14: FallbackKeyProcessorProvider

        internal FallbackKeyProcessorProvider(SVsServiceProvider serviceProvider, IKeyUtil keyUtil, IVimApplicationSettings vimApplicationSettings, IVim vim)
        {
            _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _keyUtil = keyUtil;
            _vimApplicationSettings = vimApplicationSettings;
            _vim = vim;

            var vsShell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            _scopeData = new ScopeData(vsShell);
        }
开发者ID:kun-liu,项目名称:VsVim,代码行数:10,代码来源:FallbackKeyProcessorProvider.cs

示例15: InitialCleanup

 internal InitialCleanup(ITextDocument textDocument, _DTE ide, FileConfiguration settings)
 {
     _doc = ide.Documents.OfType<Document>()
         .FirstOrDefault(x => x.FullName == textDocument.FilePath);
     if (_doc != null)
         _textDoc = (TextDocument) _doc.Object("TextDocument");
     _ide = ide;
     _settings = settings;
     _eol = settings.EndOfLine();
 }
开发者ID:octoberclub,项目名称:editorconfig-visualstudio,代码行数:10,代码来源:InitialCleanup.cs


注:本文中的_DTE类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。