• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# _DTE类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: KeyBindingService

        internal KeyBindingService(_DTE dte, IOptionsDialogService service, IVimProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData)
        {
            _dte = dte;
            _optionsDialogService = service;
            _protectedOperations = protectedOperations;
            _vimApplicationSettings = vimApplicationSettings;
            _scopeData = scopeData;

            FixKeyMappingIssue();
        }
开发者ID:0-F,项目名称:VsVim,代码行数:10,代码来源:KeyBindingService.cs


示例17: KeyBindingService

        internal KeyBindingService(_DTE dte, IKeyboardOptionsProvider keyboardOptionsProvider, IVimProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData)
        {
            _dte = dte;
            _keyboardOptionsProvider = keyboardOptionsProvider;
            _protectedOperations = protectedOperations;
            _vimApplicationSettings = vimApplicationSettings;
            _scopeData = scopeData;

            FixKeyMappingIssue();
        }
开发者ID:aesire,项目名称:VsVim,代码行数:10,代码来源:KeyBindingService.cs


示例18: Telemetry

        internal Telemetry(IVimApplicationSettings applicationSettings, _DTE dte)
        {
            _vimApplicationSettings = applicationSettings;

            var key = TryReadInstrumentationKey();
            if (key != null)
            {
                _client = CreateClient(dte, key);
                _dteEvents = dte.Events.DTEEvents;
                _dteEvents.OnBeginShutdown += OnBeginShutdown;
            }
        }
开发者ID:jaredpar,项目名称:VsVim,代码行数:12,代码来源:Telemetry.cs


示例19: GetActiveProject

        public static Project GetActiveProject(_DTE dte)
        {
            Project activeProject = null;

            var activeSolutionProjects = dte.ActiveSolutionProjects as Array;
            if (activeSolutionProjects != null && activeSolutionProjects.Length > 0)
            {
                activeProject = activeSolutionProjects.GetValue(0) as Project;
            }

            return activeProject;
        }
开发者ID:Robin--,项目名称:raml-dotnet-tools,代码行数:12,代码来源:VisualStudioAutomationHelper.cs


示例20: MoveCodeToBackup

        public static void MoveCodeToBackup(string id, string file, string name, string backupFolder, _DTE dte)
        {

            string ruleFileNameBackup = string.Format(@"{0}BTRule_{1}_{2}.sql", backupFolder, id.Replace("-", "_"), name);

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

            File.Move(file, ruleFileNameBackup);

            dte.Solution.FindProjectItem(file).Remove();
        }
开发者ID:Exclr8,项目名称:CloudCore,代码行数:12,代码来源:ImportHelper.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# _System类代码示例发布时间:2022-05-24
下一篇:
C# ZyGames类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap