本文整理汇总了C#中Windows.Storage.ApplicationDataContainer.CreateContainer方法的典型用法代码示例。如果您正苦于以下问题:C# ApplicationDataContainer.CreateContainer方法的具体用法?C# ApplicationDataContainer.CreateContainer怎么用?C# ApplicationDataContainer.CreateContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.Storage.ApplicationDataContainer
的用法示例。
在下文中一共展示了ApplicationDataContainer.CreateContainer方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SettingsManager
public SettingsManager(ref MapControl MapMain)
{
// Check is the instance doesnt already exist.
if (Current != null)
{
//if there is an instance in the app already present then simply throw an error.
throw new Exception("Only one settings manager can exist in a App.");
}
// Setting the instance to the static instance field.
Current = this;
this.MapMain = MapMain;
ApplicationData.Current.DataChanged += new TypedEventHandler<ApplicationData, object>(DataChangeHandler);
// Roaming Settings
RoamingSettings = ApplicationData.Current.RoamingSettings;
RoamingSettings.CreateContainer("Map", ApplicationDataCreateDisposition.Always);
RoamingSettings.CreateContainer("Appearance", ApplicationDataCreateDisposition.Always);
// Local Settings
LocalSettings = ApplicationData.Current.LocalSettings;
LocalSettings.CreateContainer("Location", ApplicationDataCreateDisposition.Always);
}
示例2: SettingsManager
//-------------------------------------------------------------------------------------
// Class constructor
/// <summary>
/// Class constructor. Scope is internal so external code cannot create instances.
/// </summary>
static SettingsManager()
{
#if !WINDOWS_PHONE
// Initialise the _settings object
_settings = ApplicationData.Current.LocalSettings;
_settings.CreateContainer("main", ApplicationDataCreateDisposition.Always);
#endif
}
示例3: CreateEmailProxiesSettings
internal void CreateEmailProxiesSettings(ApplicationDataContainer localRootContainer)
{
if (!localRootContainer.Containers.ContainsKey(projectContainerName))
{
localRootContainer.CreateContainer(projectContainerName, ApplicationDataCreateDisposition.Always);
}
var emailProxiesSettings = localRootContainer.Containers[projectContainerName];
CreateIpSettings(emailProxiesSettings);
}
示例4: CreateIpSettings
private void CreateIpSettings(ApplicationDataContainer emailProxiesContainer)
{
if (!emailProxiesContainer.Containers.ContainsKey(ipContainerName))
{
emailProxiesContainer.CreateContainer(ipContainerName, ApplicationDataCreateDisposition.Always);
}
var ipSettings = emailProxiesContainer.Containers[ipContainerName].Values;
ipSettings["MinBufferSize"] = (uint)1024;
ipSettings["MaxBufferSize"] = (uint)65536;
ipSettings["LogResponse"] = (bool)true; //TODO this mist be set to false!!!!
ipSettings["Timeout"] = (uint)1000;
}
示例5: WriteSetting
private static void WriteSetting(ApplicationDataContainer container, string containerName, string name, string value)
{
var selectedcontainer = !container.Containers.ContainsKey(containerName)
? container.CreateContainer(containerName, ApplicationDataCreateDisposition.Always)
: container.Containers[containerName];
if (selectedcontainer.Values.ContainsKey(name))
selectedcontainer.Values[name] = value;
else
selectedcontainer.Values.Add(name, value);
}
示例6: SaveConnection
private void SaveConnection(ApplicationDataContainer store, ConnectionOptions conn)
{
ApplicationDataContainer connStore;
if (!store.Containers.TryGetValue("connection", out connStore))
{
connStore = store.CreateContainer("connection", ApplicationDataCreateDisposition.Always);
}
connStore.Values["scheme"] = conn.Scheme;
connStore.Values["host"] = conn.Host;
connStore.Values["port"] = conn.Port;
connStore.Values["base"] = conn.Base;
connStore.Values["username"] = conn.Username;
connStore.Values["password"] = conn.Password;
}