本文整理汇总了C#中IConfigurationService类的典型用法代码示例。如果您正苦于以下问题:C# IConfigurationService类的具体用法?C# IConfigurationService怎么用?C# IConfigurationService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IConfigurationService类属于命名空间,在下文中一共展示了IConfigurationService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: MainViewModel
public MainViewModel(IConfigurationService configService, INuiService nuiService, IKeyboardService keyboardService)
{
this.keyboardService = keyboardService;
this.keyboardService.KeyUp += new EventHandler<KeyEventArgs>(keyboardService_KeyUp);
this.configService = configService;
this.nuiService = nuiService;
this.nuiService.UserRaisedHand += new EventHandler<HandRaisedEventArgs>(nuiService_UserRaisedHand);
this.nuiService.UserEnteredBounds += new EventHandler(nuiService_UserEnteredBounds);
this.nuiService.UserExitedBounds += new EventHandler(nuiService_UserExitedBounds);
this.ToggleCommand = new RelayCommand(this.ExecuteToggleCommand);
this.AutoPlayCommand = new RelayCommand(this.ExecuteAutoPlayCommand);
this.ToggleKinectVisionCommand = new RelayCommand(this.ExecuteToggleKinectVisionCommand);
this.MainBackgroundBrush = (Brush)Application.Current.Resources["DefaultBackground"];
this.EngineeringBackgroundBrush = new SolidColorBrush(Color.FromArgb(255, 0, 49, 83));
this.videoTimer = new DispatcherTimer();
this.videoTimer.Interval = TimeSpan.FromMilliseconds(50);
this.videoTimer.Tick += new EventHandler(videoTimer_Tick);
this.videoTimer.Start();
if (!IsInDesignMode)
{
Application.Current.MainWindow.SizeChanged += new SizeChangedEventHandler(MainWindow_SizeChanged);
}
}
示例3: Setup
public void Setup()
{
repository = new MockRepository();
sc = new ServiceContainer();
arch = new IntelArchitecture(ProcessorMode.Protected32);
dcSvc = repository.StrictMock<IConfigurationService>();
}
示例4: WidgetController
public WidgetController(ILog logger, IConfigurationService configurationService, IPostService postService, ICategoryService categoryService, IPageService pageService)
: base(logger, configurationService)
{
this.postService = postService;
this.categoryService = categoryService;
this.pageService = pageService;
}
示例5: Setup
public void Setup()
{
mr = new MockRepository();
dcSvc = mr.Stub<IConfigurationService>();
sc = new ServiceContainer();
sc.AddService(typeof(IConfigurationService), dcSvc);
}
示例6: DirectoryConnectionConfig
public DirectoryConnectionConfig(IConfigurationService configService)
{
this.ServerName = configService.GetSetting<string>("adLds:serverName", string.Empty);
this.Port = configService.GetSetting<string>("adLds:port", string.Empty);
this.Prefix = configService.GetSetting<string>("adLds:prefix", string.Empty);
this.Container = configService.GetSetting<string>("adLds:container", string.Empty);
}
示例7: StationConnectionChecker
public StationConnectionChecker(IStationFeedService stationFeedService,
IConfigurationService configurationService)
{
ConfigurationService = configurationService;
stationCollection = stationFeedService.CachedStations;
stationCollection.CollectionChanged += StationCollection_OnCollectionChanged;
}
示例8: FileWatcherConfigurationService
public FileWatcherConfigurationService(IConfigurationService decoratedService, IFileWatcher fileWatcher)
{
this.decoratedService = decoratedService;
this.fileWatcher = fileWatcher;
this.fileWatcher.OnFileChanged += new FileSystemEventHandler(HandleConfigurationFileChanged);
decoratedService.AddConfigurationSubfileLoadedHandler( SubfileLoaded );
}
示例9: Setup
public void Setup()
{
this.mr = new MockRepository();
this.sc = new ServiceContainer();
loader = mr.Stub<ILoader>();
arch = mr.StrictMock<IProcessorArchitecture>();
Address dummy;
arch.Stub(a => a.TryParseAddress(null, out dummy)).IgnoreArguments().WhenCalled(m =>
{
Address addr;
var sAddr = (string)m.Arguments[0];
var iColon = sAddr.IndexOf(':');
if (iColon > 0)
{
addr = Address.SegPtr(
Convert.ToUInt16(sAddr.Remove(iColon)),
Convert.ToUInt16(sAddr.Substring(iColon+1)));
m.ReturnValue = true;
}
else
{
m.ReturnValue = Address32.TryParse32((string)m.Arguments[0], out addr);
}
m.Arguments[1] = addr;
}).Return(false);
this.cfgSvc = mr.Stub<IConfigurationService>();
this.sc.AddService<IConfigurationService>(cfgSvc);
}
示例10: NewsController
public NewsController(IRssParserService rssParserService, INewsService newsService, IConfigurationService configurationService)
: base(configurationService)
{
_rssParserService = rssParserService;
_newsService = newsService;
_useRssDataSource = configurationService.GetSetting(string.Empty, "NewsDataSource", "Dictionaries", "AppSettings", "General", "News").ToLower() == "rss";
}
示例11: SitesViewModel
public SitesViewModel(ISiteDataService siteDataService, IConfigurationService configurationService)
{
_siteDataService = siteDataService;
_configurationService = configurationService;
_siteDataService.PropertyChanged += (s,e) => {
if (e.PropertyName == "Sites")
{
this.SiteFilter = String.Empty;
this.SelectedSite = this.Sites.FirstOrDefault();
}
};
this.LoadNgrokInspector = new RelayCommand(() => {
Process.Start("http://localhost:4040/");
});
this.RunNgrokCommand = new RelayCommand(() => {
Process p = new Process();
p.StartInfo = new ProcessStartInfo( "cmd.exe" )
{
Arguments = string.Format("/k \"{0}\" http -subdomain={1} {2}", Path.Combine(_configurationService.ApplicationConfiguration.NgrokExecutablePath, "ngrok.exe"), this.SelectedSite.Subdomain, this.SelectedSite.LocalhostPort),
UseShellExecute = true,
WindowStyle = ProcessWindowStyle.Normal
};
p.Start();
});
this.SiteFilter = String.Empty;
}
示例12: WebAutomationViewModel
public WebAutomationViewModel(IManifestService manifestService, ITestCollectionService testCollectionService, IConfigurationService configurationService)
{
_manifestService = manifestService;
_testCollectionService = testCollectionService;
_configurationService = configurationService;
Header = "Web Automation";
ResultsViewModel = App.ServiceLocator.GetInstance<ResultsViewModel>();
Manifests = new ObservableCollection<ManifestViewModel>();
TransitionArea = ResultsViewModel;
LoadInformation();
EditCategoriesCommand = new RelayCommand(EditTestCollections, t => EditTestCollectionViewModel == null);
LoadManifestCommand = new RelayCommand(parameter =>
{
var dialog = new OpenFileDialog
{
Filter = "Manifest File|.manifests.json",
};
var result = dialog.ShowDialog();
if (result == true)
{
_configurationService.TestScriptsPath = Path.GetDirectoryName(dialog.FileName);
_manifestService.ReloadManifest();
LoadInformation();
}
});
}
示例13: LoginWindowViewModel
public LoginWindowViewModel(ILiveService liveAuthService, IConfigurationService configurationService)
{
if (liveAuthService == null)
throw new ArgumentNullException("liveAuthService");
if (configurationService == null)
throw new ArgumentNullException("configurationService");
_liveAuthService = liveAuthService;
_configurationService = configurationService;
Loaded = new RelayCommand(() =>
{
var loginUrl = _liveAuthService.GetLoginUrl();
this.CurrentPage = new Uri(loginUrl, UriKind.Absolute);
});
Navigated = new RelayCommand<NavigationEventArgs>((args) =>
{
if (args.Uri.AbsoluteUri.StartsWith("https://login.live.com/oauth20_desktop.srf"))
{
var continueProcessing = false;
var parsedQueryParameters = HttpUtility.ParseQueryString(args.Uri.Query);
var authorizationCode = parsedQueryParameters["code"];
if (authorizationCode != null)
{
_liveAuthService.GetTokens(authorizationCode);
continueProcessing = true;
}
Messenger.Default.Send<CloseLoginWindow>(new CloseLoginWindow(continueProcessing));
}
});
}
示例14: RibbonViewModel
public RibbonViewModel(IRegexService regexService, ICommandManager commandManager,
INavigationService navigationService, IConfigurationService configurationService, IUIVisualizerService uiVisualizerService,
IWorkspaceManager workspaceManager, IPleaseWaitService pleaseWaitService, IFilterService filterService)
{
Argument.IsNotNull(() => regexService);
Argument.IsNotNull(() => commandManager);
Argument.IsNotNull(() => navigationService);
Argument.IsNotNull(() => configurationService);
Argument.IsNotNull(() => uiVisualizerService);
Argument.IsNotNull(() => workspaceManager);
Argument.IsNotNull(() => pleaseWaitService);
Argument.IsNotNull(() => filterService);
_regexService = regexService;
Filter = filterService.Filter;
_navigationService = navigationService;
_configurationService = configurationService;
_uiVisualizerService = uiVisualizerService;
_workspaceManager = workspaceManager;
_pleaseWaitService = pleaseWaitService;
_filterService = filterService;
SaveWorkspace = new Command(OnSaveWorkspaceExecute, OnSaveWorkspaceCanExecute);
CreateWorkspace = new Command(OnCreateWorkspaceExecute);
ShowSettings = new Command(OnShowSettingsExecute);
ShowKeyboardMappings = new Command(OnShowKeyboardMappingsExecute);
Exit = new Command(OnExitExecute);
commandManager.RegisterCommand(Commands.Settings.General, ShowSettings, this);
commandManager.RegisterCommand(Commands.File.Exit, Exit, this);
Title = AssemblyHelper.GetEntryAssembly().Title();
}
示例15: RegisterUserStore
private static void RegisterUserStore(IConfigurationService configService, ContainerBuilder builder)
{
UserStoreType userStoreType;
Enum.TryParse(configService.GetSetting("IdentityServerUserStore", "None"), out userStoreType);
builder.Register(ctx => userStoreType);
switch (userStoreType)
{
case UserStoreType.AspNetIdentity:
RegisterAspNetIdentity(builder);
break;
case UserStoreType.MembershipReboot:
RegisterMembershipReboot(builder);
break;
case UserStoreType.AdLds:
RegisterAdLds(builder);
break;
case UserStoreType.UsersApi:
RegisterApiServices(configService, builder);
break;
default:
throw new InvalidOperationException("Invalid user store type specified");
}
if (userStoreType != UserStoreType.UsersApi)
{
builder.RegisterType<DomainUserService>().As<IUserService>();
builder.RegisterType<DomainIdentityManagerService>().As<IIdentityManagerService>();
}
}