本文整理汇总了C#中IVisualStudioService类的典型用法代码示例。如果您正苦于以下问题:C# IVisualStudioService类的具体用法?C# IVisualStudioService怎么用?C# IVisualStudioService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IVisualStudioService类属于命名空间,在下文中一共展示了IVisualStudioService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: AutoLinkerService
public AutoLinkerService(DTE2 visualStudio, IConfigurationService configurationService, IVisualStudioService visualStudioService)
{
Argument.IsNotNull("visualStudio", visualStudio);
Argument.IsNotNull("configurationService", configurationService);
Argument.IsNotNull("visualStudioService", visualStudioService);
_visualStudio = visualStudio;
_configurationService = configurationService;
_visualStudioService = visualStudioService;
var events = (Events2)_visualStudio.Events;
_solutionEvents = events.SolutionEvents;
_solutionEvents.Opened += OnSolutionOpened;
_solutionEvents.AfterClosing += OnSolutionClosed;
_solutionItemsEvents = events.MiscFilesEvents;
_solutionItemsEvents.ItemAdded += OnSolutionItemAdded;
_solutionItemsEvents.ItemRemoved += OnSolutionItemRemoved;
_solutionItemsEvents.ItemRenamed += OnSolutionItemRenamed;
_projectItemsEvents = events.ProjectItemsEvents;
_projectItemsEvents.ItemAdded += OnSolutionItemAdded;
_projectItemsEvents.ItemRemoved += OnSolutionItemRemoved;
_projectItemsEvents.ItemRenamed += OnSolutionItemRenamed;
}
开发者ID:GeertvanHorrik,项目名称:Caitlyn,代码行数:26,代码来源:AutoLinkerService.cs
示例2: ProjectsController
/// <summary>
/// Initializes a new instance of the <see cref="ProjectsController" /> class.
/// </summary>
/// <param name="configurationService">The configuration service.</param>
/// <param name="projectsService">The projects service.</param>
/// <param name="nugetService">The nuget service.</param>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="readMeService">The read me service.</param>
/// <param name="settingsService">The settings service.</param>
/// <param name="messageBoxService">The message box service.</param>
/// <param name="mockingServiceFactory">The mocking service factory.</param>
/// <param name="resolverService">The resolver service.</param>
/// <param name="viewModelViewsService">The view model views service.</param>
/// <param name="viewModelAndViewsFactory">The view model and views factory.</param>
public ProjectsController(
IConfigurationService configurationService,
IProjectsService projectsService,
INugetService nugetService,
IVisualStudioService visualStudioService,
IReadMeService readMeService,
ISettingsService settingsService,
IMessageBoxService messageBoxService,
IMockingServiceFactory mockingServiceFactory,
IResolverService resolverService,
IViewModelViewsService viewModelViewsService,
IViewModelAndViewsFactory viewModelAndViewsFactory)
: base(configurationService,
visualStudioService,
readMeService,
settingsService,
messageBoxService,
resolverService)
{
TraceService.WriteLine("ProjectsController::Constructor");
this.projectsService = projectsService;
this.nugetService = nugetService;
this.viewModelViewsService = viewModelViewsService;
this.viewModelAndViewsFactory = viewModelAndViewsFactory;
this.mockingService = mockingServiceFactory.GetMockingService();
}
开发者ID:rmarinho,项目名称:NinjaCoderForMvvmCross,代码行数:41,代码来源:ProjectsController.cs
示例3: PluginsViewModel
/// <summary>
/// Initializes a new instance of the <see cref="PluginsViewModel" /> class.
/// </summary>
/// <param name="settingsService">The settings service.</param>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="pluginFactory">The plugin factory.</param>
public PluginsViewModel(
ISettingsService settingsService,
IVisualStudioService visualStudioService,
IPluginFactory pluginFactory)
: base(settingsService)
{
TraceService.WriteLine("PluginsViewModel::Constructor Start");
this.settingsService = settingsService;
this.visualStudioService = visualStudioService;
Plugins allPlugins = pluginFactory.GetPlugins(this.settingsService.MvvmCrossPluginsUri);
this.corePlugins = this.GetPlugins(allPlugins, false);
this.communityPlugins = this.GetPlugins(allPlugins, true);
if (this.corePlugins.Any() == false &&
this.communityPlugins.Any())
{
this.CommunityPluginsSelected = true;
}
else
{
this.CorePluginsSelected = true;
}
TraceService.WriteLine("PluginsViewModel::Constructor End");
}
开发者ID:asudbury,项目名称:NinjaCoderForMvvmCross,代码行数:34,代码来源:PluginsViewModel.cs
示例4: PluginsController
/// <summary>
/// Initializes a new instance of the <see cref="PluginsController" /> class.
/// </summary>
/// <param name="fileSystem">The file system.</param>
/// <param name="pluginsService">The plugins service.</param>
/// <param name="nugetService">The nuget service.</param>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="readMeService">The read me service.</param>
/// <param name="settingsService">The settings service.</param>
/// <param name="messageBoxService">The message box service.</param>
/// <param name="dialogService">The dialog service.</param>
/// <param name="formsService">The forms service.</param>
/// <param name="translator">The translator.</param>
public PluginsController(
IFileSystem fileSystem,
IPluginsService pluginsService,
INugetService nugetService,
IVisualStudioService visualStudioService,
IReadMeService readMeService,
ISettingsService settingsService,
IMessageBoxService messageBoxService,
IDialogService dialogService,
IFormsService formsService,
ITranslator<Tuple<DirectoryInfoBase, DirectoryInfoBase>, Plugins> translator)
: base(visualStudioService,
readMeService,
settingsService,
messageBoxService,
dialogService,
formsService)
{
TraceService.WriteLine("PluginsController::Constructor");
this.fileSystem = fileSystem;
this.pluginsService = pluginsService;
this.nugetService = nugetService;
this.translator = translator;
}
开发者ID:CliffCawley,项目名称:NinjaCoderForMvvmCross,代码行数:38,代码来源:PluginsController.cs
示例5: ProjectFactory
/// <summary>
/// Initializes a new instance of the <see cref="ProjectFactory" /> class.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="settingsService">The settings service.</param>
public ProjectFactory(
IVisualStudioService visualStudioService,
ISettingsService settingsService)
{
this.visualStudioService = visualStudioService;
this.settingsService = settingsService;
}
开发者ID:rahulpnath,项目名称:NinjaCoderForMvvmCross,代码行数:12,代码来源:ProjectFactory.cs
示例6: ViewModelAndViewsFactory
/// <summary>
/// Initializes a new instance of the <see cref="ViewModelAndViewsFactory" /> class.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="settingsService">The settings service.</param>
public ViewModelAndViewsFactory(
IVisualStudioService visualStudioService,
ISettingsService settingsService)
{
this.visualStudioService = visualStudioService;
this.settingsService = settingsService;
}
开发者ID:rahulpnath,项目名称:NinjaCoderForMvvmCross,代码行数:12,代码来源:ViewModelAndViewsFactory.cs
示例7: BaseController
/// <summary>
/// Initializes a new instance of the <see cref="BaseController" /> class.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="readMeService">The read me service.</param>
/// <param name="settingsService">The settings service.</param>
/// <param name="messageBoxService">The message box service.</param>
/// <param name="dialogService">The dialog service.</param>
/// <param name="formsService">The forms service.</param>
protected BaseController(
IVisualStudioService visualStudioService,
IReadMeService readMeService,
ISettingsService settingsService,
IMessageBoxService messageBoxService,
IDialogService dialogService,
IFormsService formsService)
{
//// init the tracing service first!
TraceService.Initialize(
settingsService.LogToTrace,
false, //// log to console.
settingsService.LogToFile,
settingsService.LogFilePath,
settingsService.DisplayErrors);
TraceService.WriteLine("BaseController::Constructor");
this.VisualStudioService = visualStudioService;
this.ReadMeService = readMeService;
this.SettingsService = settingsService;
this.MessageBoxService = messageBoxService;
this.DialogService = dialogService;
this.FormsService = formsService;
}
开发者ID:nanohex,项目名称:NinjaCoderForMvvmCross,代码行数:34,代码来源:BaseController.cs
示例8: FileOperationService
/// <summary>
/// Initializes a new instance of the <see cref="FileOperationService" /> class.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="settingsService">The settings service.</param>
public FileOperationService(
IVisualStudioService visualStudioService,
ISettingsService settingsService)
{
this.visualStudioService = visualStudioService;
this.settingsService = settingsService;
}
开发者ID:asudbury,项目名称:NinjaCoderForMvvmCross,代码行数:12,代码来源:FileOperationService.cs
示例9: ProjectTemplateTranslator
/// <summary>
/// Initializes a new instance of the <see cref="ProjectTemplateTranslator" /> class.
/// </summary>
/// <param name="settingsService">The settings service.</param>
/// <param name="visualStudioService">The visual studio service.</param>
public ProjectTemplateTranslator(
ISettingsService settingsService,
IVisualStudioService visualStudioService)
{
this.settingsService = settingsService;
this.visualStudioService = visualStudioService;
}
开发者ID:asudbury,项目名称:NinjaCoderForMvvmCross,代码行数:12,代码来源:ProjectTemplateTranslator.cs
示例10: AddRuleViewModel
/// <summary>
/// Initializes a new instance of the <see cref="AddRuleViewModel" /> class.
/// </summary>
/// <param name="configuration">The configuration.</param>
/// <param name="visualStudioService">The visual studio service.</param>
/// <exception cref="ArgumentNullException">The <paramref name="configuration" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">The <paramref name="visualStudioService" /> is <c>null</c>.</exception>
public AddRuleViewModel(IConfiguration configuration, IVisualStudioService visualStudioService)
{
Argument.IsNotNull(() => configuration);
Argument.IsNotNull(() => visualStudioService);
_configuration = configuration;
AvailableProjects = new List<string>();
AvailableProjects.AddRange(from project in visualStudioService.GetAllProjects()
select project.Name);
RootProject = visualStudioService.GetCurrentProject().Name;
ItemsToAdd = new List<string>(visualStudioService.GetSelectedItems());
RuleTypes = Enum<RuleType>.ToList();
ProjectTypes = new ObservableCollection<SelectableProjectType>();
foreach (var projectType in ProjectTypeHelper.GetAvailableProjectTypes())
{
var selectableProjectType = new SelectableProjectType(projectType);
this.SubscribeToWeakPropertyChangedEvent(selectableProjectType, OnSelectableProjectTypePropertyChanged);
ProjectTypes.Add(selectableProjectType);
}
}
开发者ID:GeertvanHorrik,项目名称:Caitlyn,代码行数:32,代码来源:AddRuleViewModel.cs
示例11: AddPlugins
/// <summary>
/// Adds the plugins.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="plugins">The plugins.</param>
/// <param name="viewModelName">Name of the view model.</param>
/// <param name="createUnitTests">if set to <c>true</c> [create unit tests].</param>
/// <returns>
/// The messages.
/// </returns>
public IEnumerable<string> AddPlugins(
IVisualStudioService visualStudioService,
IEnumerable<Plugin> plugins,
string viewModelName,
bool createUnitTests)
{
TraceService.WriteLine("PluginsService::AddPlugins viewModelName=" + viewModelName);
this.InitNuget(NinjaMessages.PluginsViaNuget);
IProjectService coreProjectService = visualStudioService.CoreProjectService;
Plugin[] enumerablePlugins = plugins as Plugin[] ?? plugins.ToArray();
this.AddProjectPlugins(coreProjectService, enumerablePlugins, Settings.Core, Settings.Core);
this.AddProjectPlugins(visualStudioService.DroidProjectService, enumerablePlugins, Settings.Droid, Settings.Droid);
this.AddProjectPlugins(visualStudioService.iOSProjectService, enumerablePlugins, Settings.iOS, "Touch");
this.AddProjectPlugins(visualStudioService.WindowsPhoneProjectService, enumerablePlugins, Settings.WindowsPhone, Settings.WindowsPhone);
this.AddProjectPlugins(visualStudioService.WindowsStoreProjectService, enumerablePlugins, Settings.WindowsStore, Settings.WindowsStore);
this.AddProjectPlugins(visualStudioService.WpfProjectService, enumerablePlugins, Settings.Wpf, Settings.Wpf);
if (string.IsNullOrEmpty(viewModelName) == false)
{
this.AddToViewModel(visualStudioService, viewModelName, createUnitTests, coreProjectService, enumerablePlugins);
}
return this.Messages;
}
开发者ID:nanohex,项目名称:NinjaCoderForMvvmCross,代码行数:38,代码来源:PluginsService.cs
示例12: RootProjectViewModel
/// <summary>
/// Initializes a new instance of the <see cref="RootProjectViewModel" /> class.
/// </summary>
/// <param name="rootProject">The root project.</param>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="uiVisualizerService">The UI visualizer service.</param>
/// <param name="messageService">The message service.</param>
/// <exception cref="ArgumentNullException">The <paramref name="rootProject" /> is <c>null</c>.</exception>
public RootProjectViewModel(RootProject rootProject, IVisualStudioService visualStudioService, IUIVisualizerService uiVisualizerService,
IMessageService messageService)
{
Argument.IsNotNull(() => rootProject);
Argument.IsNotNull(() => visualStudioService);
Argument.IsNotNull(() => uiVisualizerService);
Argument.IsNotNull(() => messageService);
_uiVisualizerService = uiVisualizerService;
_messageService = messageService;
AvailableProjects = new List<string>();
var availableProjects = visualStudioService.GetAllProjects();
foreach (var availableProject in availableProjects)
{
AvailableProjects.Add(availableProject.Name);
}
RootProject = rootProject;
Add = new Command(OnAddExecute, OnAddCanExecute);
Edit = new Command(OnEditExecute, OnEditCanExecute);
Remove = new Command(OnRemoveExecute, OnRemoveCanExecute);
}
开发者ID:GeertvanHorrik,项目名称:Caitlyn,代码行数:33,代码来源:RootProjectViewModel.cs
示例13: TokensTranslator
/// <summary>
/// Initializes a new instance of the <see cref="TokensTranslator"/> class.
/// </summary>
public TokensTranslator(
IVisualStudioService visualStudioService,
ISettingsService settingsService)
{
this.visualStudioService = visualStudioService;
this.settingsService = settingsService;
}
开发者ID:asudbury,项目名称:NinjaCoderForMvvmCross,代码行数:10,代码来源:TokensTranslator.cs
示例14: SearchViewModel
public SearchViewModel(IVisualStudioService visualStudioService, IRegexService regexService)
{
this._visualStudioService = visualStudioService;
this._regexService = regexService;
DuplicatesInLayoutAndFile = new ObservableCollection<ParentChildDuplicates>();
DuplicatesInSameFile = new ObservableCollection<Page>();
}
开发者ID:Omar-Salem,项目名称:Redundant-References-Remover,代码行数:7,代码来源:SearchViewModel.cs
示例15: SearchViewModel
public SearchViewModel(IVisualStudioService visualStudioService, IRegexService regexService, IPagesService pagesService)
{
this._visualStudioService = visualStudioService;
this._regexService = regexService;
this._pagesService = pagesService;
Results = new ObservableCollection<Result>();
}
开发者ID:Omar-Salem,项目名称:MissingSectionsFinder,代码行数:7,代码来源:SearchViewModel.cs
示例16: AddPlugins
/// <summary>
/// Adds the plugins.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="plugins">The plugins.</param>
/// <param name="viewModelName">Name of the view model.</param>
/// <param name="codeSnippetsPath">The code snippets path.</param>
public void AddPlugins(
IVisualStudioService visualStudioService,
List<Plugin> plugins,
string viewModelName,
string codeSnippetsPath)
{
Project coreProject = visualStudioService.CoreProject;
this.AddProjectPlugins(coreProject, plugins, "Core", "Core");
this.AddProjectPlugins(visualStudioService.DroidProject, plugins, "Droid", "Droid");
this.AddProjectPlugins(visualStudioService.iOSProject, plugins, "iOS", "Touch");
this.AddProjectPlugins(visualStudioService.WindowsPhoneProject, plugins, "WindowsPhone", "WindowsPhone");
this.AddProjectPlugins(visualStudioService.WindowsStoreProject, plugins, "WindowsStore", "WindowsStore");
this.AddProjectPlugins(visualStudioService.WpfProject, plugins, "Wpf", "Wpf");
if (string.IsNullOrEmpty(viewModelName) == false)
{
ProjectItem projectItem = coreProject.GetProjectItem(viewModelName);
if (projectItem != null)
{
foreach (Plugin plugin in plugins)
{
string snippetPath = string.Format(@"{0}\Plugins.{1}.txt", codeSnippetsPath, plugin.FriendlyName);
if (File.Exists(snippetPath))
{
FileInfo fileInfo = new FileInfo(snippetPath);
//// only do if the snippet contains some text :-)
if (fileInfo.Length > 0)
{
string assemblyName = Path.GetFileNameWithoutExtension(plugin.FileName);
projectItem.AddUsingStatement("Cirrious.CrossCore");
projectItem.AddUsingStatement(assemblyName);
projectItem.InsertMethod(snippetPath);
//// tidy up the using statements.
projectItem.Save();
projectItem.MoveUsingStatements();
projectItem.Save();
projectItem.SortAndRemoveUsingStatements();
projectItem.Save();
if (projectItem.Document != null)
{
projectItem.Document.ActiveWindow.Close();
}
}
}
}
}
}
DTE2 dte2 = coreProject.DTE as DTE2;
dte2.SaveAll();
}
开发者ID:slodge,项目名称:NinjaCoderForMvvmCross,代码行数:67,代码来源:PluginsService.cs
示例17: RuleViewModel
/// <summary>
/// Initializes a new instance of the <see cref="RuleViewModel" /> class.
/// </summary>
/// <param name="rootProject">The root project this rule belongs to.</param>
/// <param name="rule">The rule.</param>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="uiVisualizerService">The UI visualizer service.</param>
/// <exception cref="ArgumentNullException">The <paramref name="rootProject" /> is <c>null</c>.</exception>
/// <exception cref="ArgumentNullException">The <paramref name="rootProject" /> is <c>null</c>.</exception>
public RuleViewModel(RootProject rootProject, Rule rule, IVisualStudioService visualStudioService, IUIVisualizerService uiVisualizerService)
{
Argument.IsNotNull(() => rootProject);
Argument.IsNotNull(() => rule);
Argument.IsNotNull(() => visualStudioService);
Argument.IsNotNull(() => uiVisualizerService);
_uiVisualizerService = uiVisualizerService;
var project = visualStudioService.GetProjectByName(rootProject.Name);
if (project != null)
{
_rootProjectItem = new ProjectItem(project);
}
Rule = rule;
RuleTypes = Enum<RuleType>.ToList();
ProjectTypes = new ObservableCollection<SelectableProjectType>();
foreach (var projectType in ProjectTypeHelper.GetAvailableProjectTypes())
{
bool isSelected = rule.ProjectTypes.Contains(projectType);
var selectableProjectType = new SelectableProjectType(projectType, isSelected);
this.SubscribeToWeakPropertyChangedEvent(selectableProjectType, OnSelectableProjectTypePropertyChanged);
ProjectTypes.Add(selectableProjectType);
}
SelectProjectItem = new Command(OnSelectProjectItemExecute, OnSelectProjectItemCanExecute);
}
开发者ID:GeertvanHorrik,项目名称:Caitlyn,代码行数:39,代码来源:RuleViewModel.cs
示例18: NuGet
public NuGet(IServiceProvider serviceProvider, IVisualStudioService visualStudioService)
{
this.visualStudioService = visualStudioService;
dteService = serviceProvider.GetService(typeof(SDTE)) as DTE;
if (dteService == null)
throw new InvalidOperationException("Was not able to get the EnvDTE service.");
}
开发者ID:smhabdoli,项目名称:NBehave,代码行数:8,代码来源:NuGet.cs
示例19: ConvertersViewModel
/// <summary>
/// Initializes a new instance of the <see cref="ConvertersViewModel" /> class.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="settingsService">The settings service.</param>
public ConvertersViewModel(
IVisualStudioService visualStudioService,
ISettingsService settingsService)
: base(settingsService)
{
this.visualStudioService = visualStudioService;
this.settingsService = settingsService;
}
开发者ID:rahulpnath,项目名称:NinjaCoderForMvvmCross,代码行数:13,代码来源:ConvertersViewModel.cs
示例20: MvvmCrossViewFactory
/// <summary>
/// Initializes a new instance of the <see cref="MvvmCrossViewFactory" /> class.
/// </summary>
/// <param name="settingsService">The settings service.</param>
/// <param name="visualStudioService">The visual studio service.</param>
public MvvmCrossViewFactory(
ISettingsService settingsService,
IVisualStudioService visualStudioService)
: base(settingsService,
visualStudioService)
{
TraceService.WriteLine("MvvmCrossViewFactory::Constructor");
}
开发者ID:asudbury,项目名称:NinjaCoderForMvvmCross,代码行数:13,代码来源:MvvmCrossViewFactory.cs
注:本文中的IVisualStudioService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论