Isolatedstoragesettings for Windows Phone development

Source: Internet
Author: User

Nana has always said that I do not have a text description for writing a blog, but I think it is only possible to directly write the code

WP brothers, isolatedstoragesettings operation class.

Using system; using system. net; using system. windows; using system. windows. controls; using system. windows. documents; using system. windows. ink; using system. windows. input; using system. windows. media; using system. windows. media. animation; using system. windows. shapes; using system. io. isolatedstorage; namespace microblogforwp7.classes. util {public class isolated {static readonly isolatedstorageset=setting = isolatedstorageset.pdf. applicationsettings; # region method // <summary> // obtain the corresponding property value // </Summary> // <Param name = "flag"> </param> // /<returns> </returns> Public static object get (string flag) {try {If (setting. contains (FLAG) {return setting [flag];} else {setting. add (flag, null);} return NULL;} catch {setting. add (flag, null); return NULL ;}} /// <summary> /// obtain the corresponding property value /// </Summary> /// <Param name = "flag"> </param> /// <returns> </returns> Public static bool get <t> (string flag, out t Val) {try {If (setting. contains (FLAG) {return setting. trygetvalue <t> (flag, out Val);} else {setting. add (flag, null);} val = default (t); Return false;} catch {setting. add (flag, null); val = default (t); Return false ;}} /// <summary> /// set the property value /// </Summary> /// <Param name = "flag"> </param> /// <Param name = "Val"> </param> Public static void set (string flag, object Val) {try {If (setting. contains (FLAG) {setting [flag] = val;} else {setting. add (flag, Val );}} catch {}}/// <summary> /// remove the attribute value /// </Summary> /// <Param name = "flag"> </param> Public static bool remove (string flag) {try {return setting. remove (FLAG) ;}catch {return false ;}# endregion }}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.