本文整理汇总了C#中Windows.Storage.ApplicationDataContainer类的典型用法代码示例。如果您正苦于以下问题:C# ApplicationDataContainer类的具体用法?C# ApplicationDataContainer怎么用?C# ApplicationDataContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationDataContainer类属于Windows.Storage命名空间,在下文中一共展示了ApplicationDataContainer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateNewAppSetting
private void CreateNewAppSetting(ApplicationDataContainer settingContainer)
{
var settingKey = Guid.NewGuid().ToString();
var settingValue = DateTime.Now.ToString();
settingContainer.Values[settingKey] = settingValue;
LastStatus.Text = String.Format("Created new {0} setting Key: {1} Value: {2}", settingContainer.Locality.ToString(), settingKey, settingValue);
}
开发者ID:HimanshPal,项目名称:Clearing-Windows-AppData,代码行数:7,代码来源:MainPage.xaml.cs
示例2: ApplicationDataStore
/// <summary>
/// Initializes a new <see cref="ApplicationDataStore"/> instance.
/// </summary>
/// <param name="applicationDataContainer">The application data container in which the configuration is to be stored.</param>
public ApplicationDataStore(ApplicationDataContainer applicationDataContainer)
{
// Stores the application data container and name of the container in which the coinfiguration is to be stored
this.ApplicationDataContainer = applicationDataContainer;
// Subscribes to the data changed event of the application data, when the application data changes, then the configuration changed event is raised
ApplicationData.Current.DataChanged += (sender, e) => this.ConfigurationChanged?.Invoke(this, new EventArgs());
}
开发者ID:lecode-official,项目名称:mvvm-framework,代码行数:12,代码来源:ApplicationDataStore.cs
示例3: Run
public async void Run(IBackgroundTaskInstance taskInstance)
{
appSetting = ApplicationData.Current.LocalSettings; //本地存储
string letterstatus = "";
BackgroundTaskDeferral deferral = taskInstance.GetDeferral(); //获取 BackgroundTaskDeferral 对象,表示后台任务延期
List<KeyValuePair<String, String>> paramList = new List<KeyValuePair<String, String>>();
paramList.Add(new KeyValuePair<string, string>("uid", appSetting.Values["uid"].ToString()));
paramList.Add(new KeyValuePair<string, string>("token", appSetting.Values["token"].ToString()));
letterstatus = Utils.ConvertUnicodeStringToChinese(await NetWork.getHttpWebRequest("/letter/letterstatus", paramList));
Debug.WriteLine("letterstatus" + letterstatus);
try
{
if (letterstatus != "" && letterstatus.IndexOf("成功") != -1)
{
Debug.WriteLine(letterstatus.IndexOf("letter"));
Debug.WriteLine(letterstatus.IndexOf("}"));
int letterUnRead = Int32.Parse(letterstatus.Substring(letterstatus.IndexOf("letter") + 9, letterstatus.IndexOf("}") - (letterstatus.IndexOf("letter") + 10 )));
if (letterUnRead > Int32.Parse(appSetting.Values["LetterUnRead"].ToString())) //仅当接口中数量>应用中保持的私信数量才推送
{
Utils.Toast("你有" + letterUnRead + "条未读私信");
}
appSetting.Values["LetterUnRead"] = letterUnRead; //将保存数值提出来,为了防止在其他平台阅读私信后,本应用永远不推送的问题
}
}
catch (Exception) { Debug.WriteLine("后台任务网络异常"); }
deferral.Complete(); //所有的异步调用完成之后,释放延期,表示后台任务的完成
}
开发者ID:cappuccinoqi,项目名称:Date_Windows,代码行数:32,代码来源:LetterBackgroundTask.cs
示例4: Settings
public Settings()
{
this.InitializeComponent();
roamingSettings = ApplicationData.Current.RoamingSettings;
localSettings = ApplicationData.Current.LocalSettings;
inkRecognizerContainer = new InkRecognizerContainer();
recognizerView = inkRecognizerContainer.GetRecognizers();
if (recognizerView.Count > 0)
{
foreach (InkRecognizer recognizer in recognizerView)
{
RecogizerName.Items.Add(recognizer.Name);
}
}
else
{
RecogizerName.IsEnabled = false;
RecogizerName.Items.Add("No Recognizer Available");
}
GetSettings();
}
开发者ID:liliankasem,项目名称:Jots,代码行数:26,代码来源:Settings.xaml.cs
示例5: MainPage
public MainPage()
{
this.InitializeComponent();
localSettings = ApplicationData.Current.LocalSettings;
DisplayOutPut();
this.NavigationCacheMode = NavigationCacheMode.Required;
}
开发者ID:745322878,项目名称:Code,代码行数:7,代码来源:MainPage.xaml.cs
示例6: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
_settings = ApplicationData.Current.LocalSettings.CreateContainer(
"settings",
ApplicationDataCreateDisposition.Always);
}
开发者ID:jakopo87,项目名称:4thandmayor-socialextension-app,代码行数:8,代码来源:MainPage.xaml.cs
示例7: Init
private async void Init()
{
_Listener = new DatagramSocket();
_Listener.MessageReceived += Listener_MessageReceived;
while (true)
{
try
{
await _Listener.BindServiceNameAsync("6");
break;
}
catch (COMException)
{
var messageDialog = new MessageDialog("Only one usage of each port is normally permitted.\r\n\r\nIs 'Windows IoT Core Watcher' open?", "Port in use");
messageDialog.Commands.Add(new UICommand("Try again", (command) => { }));
await messageDialog.ShowAsync();
}
}
HostName hostname = new HostName("239.0.0.222");
_Listener.JoinMulticastGroup(hostname);
_Settings = ApplicationData.Current.LocalSettings;
_Timer = new Timer(Timer_Callback, null, 1000, 1000);
}
开发者ID:cyberh0me,项目名称:IoT,代码行数:27,代码来源:Discovery.cs
示例8: ApplicationDataSettingsService
public ApplicationDataSettingsService()
{
localSettings = ApplicationData.Current.LocalSettings;
//SummaryDataUrl = localSettings.Values["SummaryDataUrl"].ToString();
//HistoricalDataUrl = localSettings.Values["HistoricalDataUrl"].ToString();
LoadSettings();
}
开发者ID:jhalbrecht,项目名称:HomeAmation,代码行数:7,代码来源:ApplicationDataSettingsService.cs
示例9: LoginPage
public LoginPage()
{
this.InitializeComponent();
appSetting = ApplicationData.Current.LocalSettings;
if (appSetting.Values.ContainsKey("stuNum"))
StuNumTextBox.Text = appSetting.Values["stuNum"].ToString();
}
开发者ID:RedrockTeam,项目名称:ZSCY_Windows_V2.0,代码行数:7,代码来源:LoginPage.xaml.cs
示例10: App
/// <summary>
/// 初始化单一实例应用程序对象。 这是执行的创作代码的第一行,
/// 逻辑上等同于 main() 或 WinMain()。
/// </summary>
///
public App()
{
this.InitializeComponent();
this.Suspending += this.OnSuspending;
appSetting = ApplicationData.Current.LocalSettings; //本地存储
}
开发者ID:yyx290799684,项目名称:WJZZ_WP_RT,代码行数:14,代码来源:App.xaml.cs
示例11: 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);
}
开发者ID:LdwgWffnschmdt,项目名称:CykeMaps,代码行数:28,代码来源:SettingsManager.cs
示例12: ForumSettingsFlyout
public ForumSettingsFlyout()
{
InitializeComponent();
_localSettings = ApplicationData.Current.LocalSettings;
if (_localSettings.Values.ContainsKey(Constants.BOOKMARK_BACKGROUND))
{
BookmarkLiveTiles.IsOn = (bool) _localSettings.Values[Constants.BOOKMARK_BACKGROUND];
}
if (_localSettings.Values.ContainsKey(Constants.BOOKMARK_STARTUP))
{
LoadBookmarksOnLoadSwitch.IsOn = (bool)_localSettings.Values[Constants.BOOKMARK_STARTUP];
}
if (_localSettings.Values.ContainsKey(Constants.BOOKMARK_DEFAULT))
{
FilterComboBox.SelectedIndex = (int) _localSettings.Values[Constants.BOOKMARK_DEFAULT];
}
else
{
FilterComboBox.SelectedIndex = 0;
}
if (_localSettings.Values.ContainsKey(Constants.DARK_MODE))
{
DarkLightThemeSwitch.IsOn = (bool)_localSettings.Values[Constants.DARK_MODE];
}
if (_localSettings.Values.ContainsKey(Constants.AUTO_REFRESH))
{
AutoReloadSwitch.IsOn = (bool)_localSettings.Values[Constants.AUTO_REFRESH];
}
}
开发者ID:llenroc,项目名称:AwfulMetro,代码行数:29,代码来源:ForumSettingsFlyout.xaml.cs
示例13: SearchFreeTimeResultPage_new
public SearchFreeTimeResultPage_new()
{
appSetting = ApplicationData.Current.LocalSettings; //本地存储
this.InitializeComponent();
week_old = week = int.Parse(appSetting.Values["nowWeek"].ToString());
HubSectionKBNum.Text = appSetting.Values["nowWeek"].ToString();
}
开发者ID:RedrockMobile,项目名称:CyxbsMobile_Win,代码行数:7,代码来源:SearchFreeTimeResultPage_new.xaml.cs
示例14: ScorePage
public ScorePage()
{
appSetting = ApplicationData.Current.LocalSettings; //本地存储
this.InitializeComponent();
Debug.WriteLine("init");
//SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;
}
开发者ID:RedrockMobile,项目名称:CyxbsMobile_Win,代码行数:7,代码来源:ScorePage.xaml.cs
示例15: SettingsViewModel
public SettingsViewModel(IAppBootstrapper bootstrapper, IMessageBus messageBus)
: base(bootstrapper, messageBus)
{
base.PathSegment = Constants.PATH_SEGMENT_SETTINGS;
this.localSettings = ApplicationData.Current.LocalSettings;
#region Local Storage Configuration
// IsLocalStorageOn default value
_isLocalStorageOn = ApplicationDataSettingsHelper.ReadValue<bool>(Constants.SETTINGS_IS_LOCALSTORAGE_ENABLED);
this.ObservableForProperty(vm => vm.IsLocalStorageOn)
.Subscribe(x =>
{
ApplicationDataSettingsHelper.SaveOrUpdateValue(Constants.SETTINGS_IS_LOCALSTORAGE_ENABLED, x.Value);
});
#endregion Local Storage Configuration
#region Location Service Configuration
// IsLocationServiceOn default value
_isLocationServiceOn = ApplicationDataSettingsHelper.ReadValue<bool>(Constants.SETTINGS_IS_LOCATION_ENABLED);
this.ObservableForProperty(vm => vm.IsLocationServiceOn)
.Subscribe(x =>
{
ApplicationDataSettingsHelper.SaveOrUpdateValue(Constants.SETTINGS_IS_LOCATION_ENABLED, x.Value);
});
#endregion Location Service Configuration
}
开发者ID:xepher,项目名称:uwp-wxbus,代码行数:33,代码来源:SettingsViewModel.cs
示例16: Api
static Api()
{
CredentialContainer = ApplicationData.Current.LocalSettings.CreateContainer(
"[VK Miner] Entry data",
ApplicationDataCreateDisposition.Always);
const string scope = "friends,photos,audio,video,status,wall,groups,offline";
const string blank = "https://oauth.vk.com/blank.html";
const string url = "https://oauth.vk.com/authorize"
+ "?client_id=4989758"
+ "&scope=" + scope
+ "&redirect_uri=" + blank
+ "&display=popup"
+ "&response_type=token";
AuthStartUri = new Uri(url);
AuthEndUri = new Uri(blank);
RequestStopwatch = Stopwatch.StartNew();
CheckTokenRequestCreator = RequestData.Creator<Func<RequestData>>("users.get",
new RequestArgs()
{
["fields"] = "photo_50"
});
}
开发者ID:ar4ebald,项目名称:VK-Miner,代码行数:25,代码来源:Api.cs
示例17: SettingsPage
public SettingsPage()
{
this.InitializeComponent();
_localSettings = ApplicationData.Current.LocalSettings;
if (_localSettings.Values.ContainsKey(Constants.BOOKMARK_BACKGROUND))
{
BookmarkLiveTiles.IsOn = (bool)_localSettings.Values[Constants.BOOKMARK_BACKGROUND];
}
if (_localSettings.Values.ContainsKey(Constants.BOOKMARK_STARTUP))
{
LoadBookmarksOnLoadSwitch.IsOn = (bool)_localSettings.Values[Constants.BOOKMARK_STARTUP];
}
if (_localSettings.Values.ContainsKey(Constants.AUTO_REFRESH))
{
AutoReloadSwitch.IsOn = (bool)_localSettings.Values[Constants.AUTO_REFRESH];
}
if (_localSettings.Values.ContainsKey(Constants.DARK_MODE))
{
DarkLightThemeSwitch.IsOn = (bool) _localSettings.Values[Constants.DARK_MODE];
}
else
{
// If the mode was never set, it's automatically true unless the user actually sets it to false.
DarkLightThemeSwitch.IsOn = true;
}
this.navigationHelper = new NavigationHelper(this);
this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
}
开发者ID:llenroc,项目名称:AwfulMetro,代码行数:31,代码来源:SettingsPage.xaml.cs
示例18: SearchFreeTimeNumPage
public SearchFreeTimeNumPage()
{
appSetting = ApplicationData.Current.LocalSettings; //本地存储
this.InitializeComponent();
HubSectionKBNum.Text = appSetting.Values["nowWeek"].ToString();
appSetting.Values["FreeWeek"] = appSetting.Values["nowWeek"];
}
开发者ID:RedrockTeam,项目名称:ZSCY_Windows_V2.0,代码行数:7,代码来源:SearchFreeTimeNumPage.xaml.cs
示例19: LoginPage
public LoginPage()
{
this.InitializeComponent();
this.Loaded += LoginPage_Loaded;
localData = ApplicationData.Current.LocalSettings;
}
开发者ID:nana9115,项目名称:Mi-menu-ideal-Windows,代码行数:7,代码来源:LoginPage.xaml.cs
示例20: CompositeSettings
public CompositeSettings()
{
this.InitializeComponent();
roamingSettings = ApplicationData.Current.RoamingSettings;
DisplayOutput();
}
开发者ID:COMIsLove,项目名称:Windows-universal-samples,代码行数:8,代码来源:Scenario4_CompositeSettings.xaml.cs
注:本文中的Windows.Storage.ApplicationDataContainer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论