public MainPage()
        {
            InitializeComponent();

            isoSettings = IsolatedStorageSettings.ApplicationSettings;

            basicJsonObjectConverter = new JsonConverter<BasicJsonObject>();
            // TODO Remove
            App.Settings.APP_ID = "cylinder-manager-e30";
            App.Settings.API_KEY = "d6c6b4b7aa0f4162a04f23ebd34c6d2e";
            App.Settings.ADMIN_KEY = "e4b4709e31924777a4521df5fbf57692";

            data = new BasicJsonObject();
            // use two-way binding to set BasicjsonObject's key/value pairs
            JsonObjectGrid.DataContext = data;

            if (isoSettings.Contains(SETTINGS_BUCKET_NAME))
                BucketName_Box.Text = isoSettings[SETTINGS_BUCKET_NAME] as string;
            if (isoSettings.Contains(SETTINGS_OBJECT_ID))
                ObjectId_Box.Text = isoSettings[SETTINGS_OBJECT_ID] as string;
            if (isoSettings.Contains(SETTINGS_CCID))
                CCID_Box.Text = isoSettings[SETTINGS_CCID] as string;
            if (isoSettings.Contains(SETTINGS_CLIENT_ID))
                ClientId_Box.Text = isoSettings[SETTINGS_CLIENT_ID] as string;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor for the Application object.
        /// </summary>
        public App()
        {


            // Global handler for uncaught exceptions. 
            UnhandledException += Application_UnhandledException;

            // Standard Silverlight initialization
            InitializeComponent();

            // Phone-specific initialization
            InitializePhoneApplication();

            appSettings = IsolatedStorageSettings.ApplicationSettings;
            // Show graphics profiling information while debugging.
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // Display the current frame rate counters.
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // Show the areas of the app that are being redrawn in each frame.
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // Enable non-production analysis visualization mode, 
                // which shows areas of a page that are handed off to GPU with a colored overlay.
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // Disable the application idle detection by setting the UserIdleDetectionMode property of the
                // application's PhoneApplicationService object to Disabled.
                // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run
                // and consume battery power when the user is not using the phone.
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }

        }
Ejemplo n.º 3
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            Loaded += MainPage_Loaded;

            appSettings = IsolatedStorageSettings.ApplicationSettings;
        }
 public AccountViewModel(Simperium.Settings _settings)
 {
     isoSettings = IsolatedStorageSettings.ApplicationSettings;
     settings = _settings;
     if (isoSettings.Contains(SETTINGS_APP_ID))
         settings.APP_ID = (isoSettings[SETTINGS_APP_ID] as string);
 }
Ejemplo n.º 5
0
		void CheckICollectionKeyPairValue (IsolatedStorageSettings settings)
		{
			ICollection<KeyValuePair<string, object>> c = (settings as ICollection<KeyValuePair<string, object>>);
			Assert.AreEqual (0, c.Count, "Count");
			Assert.IsFalse (c.IsReadOnly, "IsReadOnly");
			Assert.IsNotNull (c.GetEnumerator (), "GetEnumerator");

			KeyValuePair<string,object> kvp = new KeyValuePair<string,object> ("key", "value");
			c.Add (kvp);
			Assert.AreEqual (1, c.Count, "Add/Count");
			Assert.Throws (delegate { c.Add (new KeyValuePair<string, object> (null, "value")); }, typeof (ArgumentNullException), "Add(KVP(null))");
			Assert.Throws (delegate { c.Add (new KeyValuePair<string, object> ("key", "value")); }, typeof (ArgumentException), "Add(twice)");

			Assert.IsTrue (c.Contains (kvp), "Contains(kvp)");
			Assert.IsTrue (c.Contains (new KeyValuePair<string, object> ("key", "value")), "Contains(new)");
			Assert.IsFalse (c.Contains (new KeyValuePair<string, object> ("value", "key")), "Contains(bad)");

			c.Remove (kvp);
			Assert.IsFalse (c.Contains (kvp), "Remove/Contains(kvp)");
			Assert.AreEqual (0, c.Count, "Remove/Count");

			c.Add (kvp);
			c.Clear ();
			Assert.AreEqual (0, c.Count, "Clear/Count");
		}
Ejemplo n.º 6
0
        public Login()
        {

            InitializeComponent();

            this.Loaded += new RoutedEventHandler(Login_Loaded);
            //加载所有公司、部门、岗位信息
            // organClient.GetCompanyActivedAsync("");
            //登录控件禁用  在加载完组织架构后 再激活
            this.OK.IsEnabled = false;
            this.OK.Content = "加载中....";
            settings = IsolatedStorageSettings.ApplicationSettings;

            if (settings.Contains("SYS_PostInfo") && settings["SYS_PostInfo"] != null)
            {
                App.Current.Resources.Add("SYS_PostInfo", settings["SYS_PostInfo"]);
                App.Current.Resources.Add("SYS_CompanyInfo", settings["SYS_CompanyInfo"]);
                App.Current.Resources.Add("SYS_DepartmentInfo", settings["SYS_DepartmentInfo"]);
            }
            isDict = true;
            isHR = true;

            if (settings.Contains("UserName"))
            {
                UserName.Text = Convert.ToString(settings["UserName"]);
                paw.Password = Convert.ToString(settings["UserPWD"]);               
            }            
            RefreshBtn();
            
        }
Ejemplo n.º 7
0
 static Cache()
 {
     _lckStandards = new object();
     _appSettings = IsolatedStorageSettings
         .ApplicationSettings;
     _standards = new Dictionary<int, ImageSource>();
 }
Ejemplo n.º 8
0
 // Constructor
 public PhotoProcess()
 {
     InitializeComponent();
     appSettings = IsolatedStorageSettings.ApplicationSettings;
     Loaded += new System.Windows.RoutedEventHandler(MainPage_Loaded);
     OrientationChanged += new EventHandler<OrientationChangedEventArgs>(MainPage_OrientationChanged);
 }
        /// <summary>
        /// Initializes a new instance of the NotificationHub class.
        /// </summary>
        /// <param name="notificationHubPath"></param>
        /// <param name="connectionString"></param>
        public NotificationHub(string notificationHubPath, string connectionString)
        {
            setNotificationHubPath(notificationHubPath);
            setConnectionString(connectionString);

            isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings;
        }
Ejemplo n.º 10
0
        public ReviewPopup()
        {
            InitializeComponent();
            LayoutRoot.Hide();

            settings = App.Current.Settings;
        }
Ejemplo n.º 11
0
 public Test()
 {
     InitializeComponent();
     m_storageSettings = IsolatedStorageSettings.ApplicationSettings;
     LoadScheduleDetails();
     this.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(Test_BackKeyPress);
 }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            savedSettings = IsolatedStorageSettings.ApplicationSettings;

            if (savedSettings.Contains("callsign"))
            {
                callsign = (string)savedSettings["callsign"];
            }

            tbCallsign.Text = callsign + "_chase";

            if (savedSettings.Contains("interval"))
            {
                interval = Convert.ToUInt32(savedSettings["interval"]);
            }

            if (savedSettings.Contains("consent"))
            {
                consent = (bool)savedSettings["consent"];
            }

            if (!consent)
            {
                MessageBoxResult result = MessageBox.Show("This app accesses your phone's location. Is this okay?", "Location", MessageBoxButton.OKCancel);
                if (result == MessageBoxResult.OK)
                {
                    updateSetting("consent", true);
                    consent = true;
                }

            }
        }
Ejemplo n.º 13
0
        public classicgamelevel()
        {
            InitializeComponent();
          

            var prog = new ProgressIndicator { Text = "Lord of The Math", IsVisible = true, IsIndeterminate = false, Value = 0 };
            SystemTray.SetProgressIndicator(this, prog);

           

            stroge = IsolatedStorageSettings.ApplicationSettings;

            if (!stroge.Contains("levelclassic"))
            {
                IsolatedStorageSettings.ApplicationSettings["levelclassic"] = "1";
                IsolatedStorageSettings.ApplicationSettings.Save();

            }
            //gameoverden gelince limitsizi açması için
            if (stroge.Contains("hangigrid"))
            {
                if (IsolatedStorageSettings.ApplicationSettings["hangigrid"] == "1")
                {
                    kırmızı.Visibility = Visibility.Visible;
                    yesil.Visibility = Visibility.Collapsed;
                    imgkırmızı.Opacity = 100;
                    imgyesil.Opacity = 0;
                }

            }
            levelresimleri();


        }
Ejemplo n.º 14
0
        public About()
        {
            InitializeComponent();

            settings = IsolatedStorageSettings.ApplicationSettings;

            // Load initial settings
            if (settings.Contains("UseLocation"))
            {
                locationtoggle.IsChecked = settings["UseLocation"].ToString() == "true";
            }
            else
            {
                settings["UseLocation"] = "false";
                locationtoggle.IsChecked = false;
            }

            textBlock1.Text = "WHEWCIRC\nVersion "+ appversion +"\n\nCoded lovingly by\nJeff Stephens in St. Louis\n@jefftheman45";
            textBlock1.Text += "\n\nFor support, please contact\[email protected]";
            textBlock1.Text += "\n\nThanks to Colin E. for his great article on\nanimation!";

            // Change logo if light theme
            Visibility isLight = (Visibility)Resources["PhoneLightThemeVisibility"]; // for light theme

            if (isLight == System.Windows.Visibility.Visible)
            {
                image1.Source = new BitmapImage(new Uri("/WhewCirc;component/icons/Marketplace_Device_173x173.png", UriKind.Relative));
            }
        }
Ejemplo n.º 15
0
        public FacebookPostView()
        {
            InitializeComponent();
            emptystr = "What's on your mind?";

            settings = IsolatedStorageSettings.ApplicationSettings;
            this.Loaded += new RoutedEventHandler(ListPage_Loaded);
        }
Ejemplo n.º 16
0
 private static void AddDefaultSettings(IsolatedStorageSettings settings)
 {
     settings.Add("MidThreshold", 8000);
     settings.Add("LowThreshold", 9000);
     settings.Add("MidRate", 1024);
     settings.Add("LowRate", 256);
     settings.Add("PctDiscount", 75);
 }
 private void LoadSettings()
 {
     _isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings;
     if (_isolatedStorageSettings.Contains(_merchantServerUrlKey))
     {
         _merchantServerUrl = (string)_isolatedStorageSettings[_merchantServerUrlKey];
     }
 }
 // Constructor
 public MainPage()
 {
     InitializeComponent();
     settings = IsolatedStorageSettings.ApplicationSettings;
     if (! settings.Contains("data")) {
         settings.Add("data", "");
     }
 }
Ejemplo n.º 19
0
 public FacebookWrite()
 {
     settings = IsolatedStorageSettings.ApplicationSettings;
     emptystr = "What's on your mind?";
     imgstream = null;
     Loaded += new RoutedEventHandler(MainPage_Loaded);
     InitializeComponent();
 }
Ejemplo n.º 20
0
		void CheckICollection (IsolatedStorageSettings settings)
		{
			ICollection c = (settings as ICollection);
			Assert.AreEqual (0, c.Count, "ICollection.Count");
			Assert.IsFalse (c.IsSynchronized, "ICollection.IsSynchronized");
			Assert.IsNotNull (c.SyncRoot, "ICollection.SyncRoot");
			Assert.IsNotNull (c.GetEnumerator (), "ICollection.GetEnumerator");
		}
Ejemplo n.º 21
0
        public AppSettings(IsolatedStorageSettings settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");

            _settings = settings;
            _globalPass = new GlobalPassHandler(this);
        }
Ejemplo n.º 22
0
 public Settings()
 {
     InitializeComponent();
     BuildLocalizedApplicationBar();
     appSettings = IsolatedStorageSettings.ApplicationSettings;
     oldPass = (string)appSettings["pass"];
     fakeOldPass = (string)appSettings["fake"];
 }
 /// <summary>
 /// Private helper method for performing deletes on a setting
 /// </summary>
 /// <param name="store">The IsolatedStorageSettings store to use (either "site" or "application")</param>
 /// <param name="key">The key of the object to delete</param>
 private static void DeleteSetting(IsolatedStorageSettings store, string key)
 {
     if(store.Contains(key))
     {
         store.Remove(key);
         store.Save();
     }
 }
Ejemplo n.º 24
0
 public StartPage()
 {
     InitializeComponent();
       isValid = false;
       iss = IsolatedStorageSettings.ApplicationSettings;
       wc = new WebClient();
       wc.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wc_DownloadStringCompleted);
 }
Ejemplo n.º 25
0
 // Constructor
 public MainPage()
 {
     InitializeComponent();
       iss = IsolatedStorageSettings.ApplicationSettings;
       // Set the data context of the listbox control to the sample data
       DataContext = App.ViewModel;
       this.Loaded += new RoutedEventHandler(MainPage_Loaded);
 }
Ejemplo n.º 26
0
 public TwitterWrite()
 {
     settings = IsolatedStorageSettings.ApplicationSettings;
     emptystr = "What's on your mind?";
     twit_pic = "";
     Loaded += new RoutedEventHandler(MainPage_Loaded);
     InitializeComponent();
 }
Ejemplo n.º 27
0
 // Constructor
 public MainPage()
 {
     //progress.IsHitTestVisible = false;
     InitializeComponent();
     rrah = null;
     settings = IsolatedStorageSettings.ApplicationSettings;
     xmlCache = IsolatedStorageFile.GetUserStoreForApplication();
     this.Loaded += new RoutedEventHandler(MainPage_Loaded);
 }
Ejemplo n.º 28
0
        private RecentData()
        {
            storage = IsolatedStorageSettings.ApplicationSettings;

            if (storage.Contains("recent"))
                data = (List<string>)storage["recent"];
            else
                data = new List<string>();
        }
Ejemplo n.º 29
0
        public MainPage()
        {
            InitializeComponent();

            _isNew = true;
            _isolatedStorageSettings = IsolatedStorageSettings.ApplicationSettings;

            if (_isolatedStorageSettings.Contains(EMAIL_ADDRESS_KEY)) Address.Text = _isolatedStorageSettings[EMAIL_ADDRESS_KEY].ToString();
        }
Ejemplo n.º 30
0
 public Game()
 {
     InitializeComponent();
     CurrentGamer = 1;
     AppSettings = IsolatedStorageSettings.ApplicationSettings;
     random = new Random();
     backgroundRepository = new BackgroundRepository();
     bottleRepository = new BottleRepository();
 }
Ejemplo n.º 31
0
        public static TT Read <TT>(string name, TT defaultValue)
        {
            System.IO.IsolatedStorage.IsolatedStorageSettings settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
            TT value;

            if (settings == null || !settings.TryGetValue <TT>(name, out value))
            {
                return(defaultValue);
            }
            return(value);
        }
Ejemplo n.º 32
0
 public static void Write <TT>(string name, TT value)
 {
     System.IO.IsolatedStorage.IsolatedStorageSettings settings = System.IO.IsolatedStorage.IsolatedStorageSettings.ApplicationSettings;
     if (settings == null)
     {
         return;
     }
     if (settings.Contains(name))
     {
         settings[name] = value;
     }
     else
     {
         settings.Add(name, value);
     }
     settings.Save();
 }