Example #1
0
        public MainPage()
        {
            InitializeComponent();

            if (!DesignerProperties.IsInDesignTool)
            {
                _debugService    = DebugService.Default;
                _storageService  = new IsolatedStorageService(_machine);
                _keyboardService = new SilverlightKeyboardService(_machine, this);
                _gamePortService = new GamePortService(_machine); // not connected
                _audioService    = new SilverlightAudioService(_machine, this, _media);
                _videoService    = new SilverlightVideoService(_machine, this, _image);

                _machine.Services.AddService(typeof(DebugService), _debugService);
                _machine.Services.AddService(typeof(StorageService), _storageService);
                _machine.Services.AddService(typeof(KeyboardService), _keyboardService);
                _machine.Services.AddService(typeof(GamePortService), _gamePortService);
                _machine.Services.AddService(typeof(AudioService), _audioService);
                _machine.Services.AddService(typeof(VideoService), _videoService);

                Loaded += (sender, e) => _machine.Start();
                CompositionTarget.Rendering += OnCompositionTargetRendering;
                Application.Current.Exit    += (sender, e) => _machine.Stop();

                _disk1Button.Click += (sender, e) => OnDiskButtonClick(0);
                _disk2Button.Click += (sender, e) => OnDiskButtonClick(1);
            }
        }
Example #2
0
        public void DeleteAktie(string symbol)
        {
            var symbolList = IsolatedStorageService.GetStoredObject <List <string> >(AccessKey);

            if (symbolList != null)
            {
                symbolList.Remove(symbol);
                IsolatedStorageService.Save();
            }
        }
Example #3
0
        /// <summary>
        /// Fügt ein Aktiensymbol in die im
        /// IsolatedStorage gespeicherte Symbolliste hinzu.
        /// </summary>
        /// <param name="aktienGesellschaftsSymbol">Aktiensymbol eines Unternehmens</param>
        public void AddAktie(string aktienGesellschaftsSymbol)
        {
            var symbole = IsolatedStorageService.GetStoredObject <List <string> >(AccessKey);

            if (symbole == null)
            {
                symbole = new List <string>();
            }

            symbole.Add(aktienGesellschaftsSymbol);

            IsolatedStorageService.StoreObject(symbole, AccessKey);
            IsolatedStorageService.Save();
        }
Example #4
0
 public string Upload(Pet pet)
 {
     var restClient = new RestClient {BaseUrl = "http://ec2-107-20-224-204.compute-1.amazonaws.com/node"};
     byte[] readBuffer = new IsolatedStorageService().ReadImageFromIsolatedStorage("myWP7.dat");
     IRestRequest restRequest = new RestRequest(Method.POST)
         .AddFile("file", readBuffer, pet.PictureUri.LocalPath)
         .AddParameter("breed", pet.Breed)
         .AddParameter("contact", pet.Contact)
         .AddParameter("contactMethod", pet.ContactMethod)
         .AddParameter("when", pet.DateWhen)
         .AddParameter("description", pet.Description)
         .AddParameter("dogOrCat", pet.DogOrCat)
         .AddParameter("foundAround", pet.FoundAround)
         .AddParameter("name", pet.Name)
         .AddParameter("size", pet.Size)
         .AddParameter("status", pet.Status);
     /*var callback = new Action<RestResponse>(delegate { });
     restClient.ExecuteAsync(restRequest, callback);*/
     return "http://www.lostpets.com";
 }
Example #5
0
 /// <summary>
 /// Lädt die im IsolatedStorage gespeicherte Symbolliste
 /// </summary>
 /// <returns>Symbolliste aller gespeicherten Aktiengesellschaften</returns>
 public List <string> LoadAktienSymbole()
 {
     return(IsolatedStorageService
            .GetStoredObject <List <string> >(AccessKey));
 }