本文整理汇总了C#中IPreferences类的典型用法代码示例。如果您正苦于以下问题:C# IPreferences类的具体用法?C# IPreferences怎么用?C# IPreferences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPreferences类属于命名空间,在下文中一共展示了IPreferences类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StringSequenceFeedSourceStore
/// <summary>
/// Initializes a new instance of the StringSequenceFeedSourceStore class.
/// </summary>
/// <param name="preferences">IStringSequenceStore instance.</param>
/// <param name="filterTag">Gallery filter tag for the feed sources.</param>
public StringSequenceFeedSourceStore(IPreferences preferences, string filterTag)
: base(preferences)
{
_filterTag = filterTag;
_stringSequenceStore = new StringSequenceStore(this.Preferences);
}
示例2: BackendManager
/// <summary>
/// Initializes a new instance of the
/// <see cref="Tasque.Core.BackendManager"/> class.
/// </summary>
/// <param name='preferences'>
/// Preferences.
/// </param>
/// <exception cref="T:System.ArgumentNullException">
/// thrown when preferences is <c>null</c>.
/// </exception>
public BackendManager(IPreferences preferences)
{
manager = new InternalBackendManager (preferences);
// setup backend manager for AllList
Tasque.Utils.AllList.SetBackendManager (this);
}
示例3: RecentFilesProvider
public RecentFilesProvider (IPreferences prefs)
{
NumRecentDocs = prefs.Get<int> ("NumRecentDocs", 7);
RefreshRecentDocs ();
Gtk.RecentManager.Default.Changed += delegate { RefreshRecentDocs (); };
}
示例4: RenderPackageFactoryViewModel
public RenderPackageFactoryViewModel(IPreferences preferenceSettings)
{
this.factory = new HelixRenderPackageFactory()
{
TessellationParameters = { ShowEdges = preferenceSettings.ShowEdges }
};
}
示例5: ConnectionManager
public ConnectionManager(IPreferences preferences, IPowerManager powerManager, IConnectionInfo connectionInfo, IBlackoutTime blackoutTime)
{
Preferences = preferences;
PowerManager = powerManager;
ConnectionInfo = connectionInfo;
BlackoutTime = blackoutTime;
}
示例6: StartDynamo
/// <summary>
/// Enables starting Dynamo with a mock IUpdateManager
/// </summary>
/// <param name="updateManager"></param>
/// <param name="watchHandler"></param>
/// <param name="preferences"></param>
/// <param name="visualizationManager"></param>
protected void StartDynamo(IUpdateManager updateManager, ILogger logger, IWatchHandler watchHandler, IPreferences preferences, IVisualizationManager visualizationManager)
{
//create a new instance of the ViewModel
Controller = new DynamoController(Context.NONE, updateManager, logger, watchHandler, preferences);
Controller.DynamoViewModel = new DynamoViewModel(Controller, null);
DynamoController.IsTestMode = true;
Controller.VisualizationManager = new VisualizationManager();
}
示例7: Connection
public Connection (IPreferences preferences)
{
if (null == preferences) {
throw new ArgumentNullException ("preferences");
}
this.preferences = preferences;
this.cookies = new CookieCollection ();
}
示例8: NuGetFeedSourceStore
public NuGetFeedSourceStore(IPreferences preferences)
: base(preferences)
{
_packageSourceProvider = new PackageSourceProvider(
// Do not load user settings or machine wide settings for WebMatrix 'nuget.org' feed
// In other words, pass all null to LoadDefaultSettings
Settings.LoadDefaultSettings(null, null, null),
defaultSources: new[] { new PackageSource("https://www.nuget.org/api/v2", Resources.NuGet_PackageSourceName) });
}
示例9: GetPreferences
public static void GetPreferences(this ModbusAdaptersViewModel modbusAdaptersViewModel, IPreferences preferences, string key)
{
var selectedPort = modbusAdaptersViewModel.SelectedPort;
if (selectedPort != null)
{
preferences[key] = selectedPort;
}
}
示例10: ScanAllPackageDirectories
private void ScanAllPackageDirectories(IPreferences preferences)
{
foreach (var dir in
Directory.EnumerateDirectories(RootPackagesDirectory, "*", SearchOption.TopDirectoryOnly))
{
var pkg = ScanPackageDirectory(dir);
if (preferences.PackageDirectoriesToUninstall.Contains(dir)) pkg.MarkForUninstall(preferences);
}
}
示例11: Load
public void Load(IPreferences preferences, IPathManager pathManager)
{
// Load Packages
PackageLoader.DoCachedPackageUninstalls(preferences);
PackageLoader.LoadAll(new LoadPackageParams
{
Preferences = preferences,
PathManager = pathManager
});
}
示例12: StartupParams
/// <summary>
/// Initializes a new instance of the <see cref="StartupParams"/> class.
/// </summary>
/// <param name="provider"><see cref="IAuthProvider"/> for DynamoModel</param>
/// <param name="pathManager"><see cref="IPathManager"/> for DynamoModel</param>
/// <param name="libraryLoader"><see cref="ILibraryLoader"/> for DynamoModel</param>
/// <param name="customNodeManager"><see cref="ICustomNodeManager"/> for DynamoModel</param>
/// <param name="dynamoVersion"><see cref="Version"/> for DynamoModel</param>
/// <param name="preferences"><see cref="IPreferences"/> for DynamoModel</param>
public StartupParams(IAuthProvider provider, IPathManager pathManager,
ILibraryLoader libraryLoader, ICustomNodeManager customNodeManager,
Version dynamoVersion, IPreferences preferences)
{
this.authProvider = provider;
this.pathManager = pathManager;
this.libraryLoader = libraryLoader;
this.customNodeManager = customNodeManager;
this.dynamoVersion = dynamoVersion;
this.preferences = preferences;
}
示例13: InternalBackendManager
public InternalBackendManager(IPreferences preferences)
{
if (preferences == null)
throw new ArgumentNullException ("preferences");
this.preferences = preferences;
availableBackendNodes = AddinManager
.GetExtensionNodes<BackendNode> (typeof(IBackend));
taskLists = new TaskListCollection ();
}
示例14: ApplyPreferences
public static void ApplyPreferences(this ModbusAdaptersViewModel modbusAdaptersViewModel, IPreferences preferences, string key)
{
var displayName = preferences[key];
var item = modbusAdaptersViewModel.Ports.FirstOrDefault(a => string.Compare(a, displayName, true) == 0);
if (item != null)
{
modbusAdaptersViewModel.SelectedPort = item;
}
}
示例15: Initialize
public void Initialize (IPreferences preferences)
{
if (preferences == null)
throw new ArgumentNullException ("preferences");
this.preferences = preferences;
// *************************************
// AUTHENTICATION to Remember The Milk
// *************************************
string authToken = preferences.Get (PreferencesKeys.AuthTokenKey);
if (authToken != null) {
Logger.Debug ("Found AuthToken, checking credentials...");
try {
Rtm = new RtmNet.Rtm (ApiKey, SharedSecret, authToken);
rtmAuth = Rtm.AuthCheckToken (authToken);
Timeline = Rtm.TimelineCreate ();
Logger.Debug ("RTM Auth Token is valid!");
Logger.Debug ("Setting configured status to true");
IsConfigured = true;
} catch (RtmNet.RtmApiException e) {
preferences.Set (PreferencesKeys.AuthTokenKey, null);
preferences.Set (PreferencesKeys.UserIdKey, null);
preferences.Set (PreferencesKeys.UserNameKey, null);
Rtm = null;
rtmAuth = null;
Logger.Error ("Exception authenticating, reverting "
+ e.Message);
} catch (RtmNet.ResponseXmlException e) {
Rtm = null;
rtmAuth = null;
Logger.Error ("Cannot parse RTM response. " +
"Maybe the service is down. " + e.Message);
} catch (RtmNet.RtmWebException e) {
Rtm = null;
rtmAuth = null;
Logger.Error ("Not connected to RTM, maybe proxy: #{0}",
e.Message);
} catch (System.Net.WebException e) {
Rtm = null;
rtmAuth = null;
Logger.Error ("Problem connecting to internet: #{0}",
e.Message);
}
}
if (Rtm == null) {
Rtm = new RtmNet.Rtm (ApiKey, SharedSecret);
if (NeedsConfiguration != null)
NeedsConfiguration (this, EventArgs.Empty);
return;
}
FinishInitialization ();
}