本文整理汇总了C#中ISettingsProvider.GetSettings方法的典型用法代码示例。如果您正苦于以下问题:C# ISettingsProvider.GetSettings方法的具体用法?C# ISettingsProvider.GetSettings怎么用?C# ISettingsProvider.GetSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettingsProvider
的用法示例。
在下文中一共展示了ISettingsProvider.GetSettings方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectSyncConfiguration
public ProjectSyncConfiguration(ISettingsProvider provider)
{
var ignored = provider.GetSettings("IgnoreDirectories");
IgnoredDirectories = string.IsNullOrEmpty(ignored)
? new string[] {}
: ignored.Split(',').Select(x => x.Trim()).ToArray();
}
示例2: PreferencesViewModel
public PreferencesViewModel(ISettingsProvider settingsProvider, IScreenManager screenManager)
{
this.settingsProvider = settingsProvider;
Screens = new ObservableCollection<DetailedScreen>(screenManager.GetScreens());
Settings = settingsProvider.GetSettings<PopupSettings>();
PlaceScreen();
AvailableColors = new ObservableCollection<AvailableColor>();
var properties = typeof(Colors).GetProperties(BindingFlags.Static | BindingFlags.Public);
foreach (var prop in properties)
{
var name = prop.Name;
var value = (Color)prop.GetValue(null, null);
var availableColor = new AvailableColor(name, value);
if (Settings.FontColor == name)
FontColor = availableColor;
if (Settings.ItemBackgroundColor == name)
ItemBackgroundColor = availableColor;
AvailableColors.Add(availableColor);
}
SaveCommand = new DelegateCommand(SaveSettings);
ResetToDefaultsCommand = new DelegateCommand(() => settingsProvider.ResetToDefaults<PopupSettings>());
VisitCommand = new DelegateCommand(Visit);
}
示例3: CommentsController
public CommentsController(ICommentRepository commentRepository, ISettingsProvider settingsProvider)
{
_commentRepository = commentRepository;
_settingsProvider = settingsProvider;
PageSize = _settingsProvider.GetSettings().PageSize;
}
示例4: TagsController
public TagsController(ITagRepository tagRepository, ISettingsProvider settingsProvider)
{
_tagRepository = tagRepository;
_settingsProvider = settingsProvider;
PageSize = _settingsProvider.GetSettings().PageSize;
}
示例5: PostsController
public PostsController(IPostRepository postRepository, ITagRepository tagRepository, ISettingsProvider settingsProvider)
{
_postRepository = postRepository;
_tagRepository = tagRepository;
_settingsProvider = settingsProvider;
PageSize = _settingsProvider.GetSettings().PageSize;
}
示例6: FileRepository
public FileRepository(ISettingsProvider settingsProvider, HttpServerUtilityBase server)
{
root = settingsProvider.GetSettings<Settings.FunnelWebSettings>().UploadPath;
// If it's a virtual path then we can map it, otherwise we'll expect that it's a windows path
if (root.StartsWith("~"))
{
root = server.MapPath(root);
}
}
示例7: ServiceControlConnectionViewModel
public ServiceControlConnectionViewModel(
ISettingsProvider settingsProvider,
IContainer container)
{
this.settingsProvider = settingsProvider;
this.container = container;
appSettings = settingsProvider.GetSettings<ProfilerSettings>();
DisplayName = "Connect To ServiceControl";
}
示例8: AppLicenseManager
public AppLicenseManager(
ISettingsProvider settingsProvider,
ICryptoService cryptoService)
{
_settingsProvider = settingsProvider;
_cryptoService = cryptoService;
_licenseSettings = settingsProvider.GetSettings<LicenseSettings>();
Initialize();
}
示例9: ManagementConnectionViewModel
public ManagementConnectionViewModel(
ISettingsProvider settingsProvider,
IContainer container)
{
_settingsProvider = settingsProvider;
_container = container;
_appSettings = settingsProvider.GetSettings<ProfilerSettings>();
DisplayName = "Connect To Management Service";
}
示例10: TestInitialize
public void TestInitialize()
{
shell = Substitute.For<ShellViewModel>();
serviceControl = Substitute.For<IServiceControl>();
settingsProvider = Substitute.For<ISettingsProvider>();
connection = Substitute.For<ServiceControlConnectionProvider>();
container = RegisterContainer();
storedSetting = GetReloadedSettings();
settingsProvider.GetSettings<ProfilerSettings>().Returns(storedSetting);
connectTo = new ServiceControlConnectionViewModel(settingsProvider, container) { Parent = shell }; //TODO: Do we need to pass the full container here?
}
示例11: MetaWeblog
public MetaWeblog(
ISettingsProvider settingsProvider,
IRepository repository,
ISession session,
IFileRepository fileRepository,
IAuthenticator authenticator)
{
this.repository = repository;
this.session = session;
this.fileRepository = fileRepository;
this.authenticator = authenticator;
funnelWebSettings = settingsProvider.GetSettings<FunnelWebSettings>();
}
示例12: OnResetLayout
public void OnResetLayout(ISettingsProvider settingsProvider)
{
var layoutSettings = settingsProvider.GetSettings<ShellLayoutSettings>();
layoutSettings.ResetLayout = true;
layoutSettings.MenuLayout = null;
layoutSettings.DockLayout = null;
layoutSettings.MainWindowState = WindowState.Maximized;
layoutSettings.MainWindowTop = SystemParameters.VirtualScreenTop;
layoutSettings.MainWindowLeft = SystemParameters.VirtualScreenLeft;
layoutSettings.MainWindowWidth = SystemParameters.VirtualScreenWidth;
layoutSettings.MainWindowHeight = SystemParameters.VirtualScreenHeight;
settingsProvider.SaveSettings(layoutSettings);
}
示例13: OnRestoreLayout
public void OnRestoreLayout(ISettingsProvider settingsProvider)
{
var settings = settingsProvider.GetSettings<ExceptionViewSettings>();
Height = settings.Height;
Width = settings.Width;
if (settings.WindowState == WindowState.Normal)
{
Left = settings.Left;
Top = settings.Top;
}
WindowState = settings.WindowState;
}
示例14: OnRestoreLayout
public void OnRestoreLayout(ISettingsProvider settingsProvider)
{
var layoutSetting = settingsProvider.GetSettings<ShellLayoutSettings>();
var currentLayoutVersion = GetCurrentLayoutVersion();
if (layoutSetting.LayoutVersion == currentLayoutVersion)
{
SetLayout(DockManager, layoutSetting.DockLayout.GetAsStream());
SetLayout(BarManager, layoutSetting.MenuLayout.GetAsStream());
}
Top = layoutSetting.MainWindowTop;
Left = layoutSetting.MainWindowLeft;
Width = layoutSetting.MainWindowWidth;
Height = layoutSetting.MainWindowHeight;
WindowState = layoutSetting.MainWindowState;
}
示例15: TestInitialize
public void TestInitialize()
{
windowManager = Substitute.For<WindowManagerEx>();
endpointExplorer = Substitute.For<EndpointExplorerViewModel>();
messageList = Substitute.For<MessageListViewModel>();
statusbarManager = Substitute.For<StatusBarManager>();
eventAggregator = Substitute.For<IEventAggregator>();
workNotifier = Substitute.For<IWorkNotifier>();
messageFlow = Substitute.For<MessageFlowViewModel>();
sagaWindow = Substitute.For<SagaWindowViewModel>();
messageBodyView = Substitute.For<MessageBodyViewModel>();
messageProperties = Substitute.For<MessagePropertiesViewModel>();
view = Substitute.For<IShellViewStub>();
headerView = Substitute.For<MessageHeadersViewModel>();
sequenceDiagramView = Substitute.For<SequenceDiagramViewModel>();
settingsProvider = Substitute.For<ISettingsProvider>();
licenseManager = Substitute.For<AppLicenseManager>();
logWindow = Substitute.For<LogWindowViewModel>();
settingsProvider.GetSettings<ProfilerSettings>().Returns(DefaultAppSetting());
app = Substitute.For<IAppCommands>();
commandLineArgParser = MockEmptyStartupOptions();
shell = new ShellViewModel(
app,
windowManager,
endpointExplorer,
messageList,
() => Substitute.For<ServiceControlConnectionViewModel>(),
() => Substitute.For<LicenseRegistrationViewModel>(),
statusbarManager,
eventAggregator,
workNotifier,
licenseManager,
messageFlow,
sagaWindow,
messageBodyView,
headerView,
sequenceDiagramView,
settingsProvider,
messageProperties,
logWindow,
commandLineArgParser);
((IViewAware)shell).AttachView(view);
}