public UserList() { this.InitializeComponent(); storeData = new StoreData(); // set the source of the GridView to be the sample data ItemGridView2.ItemsSource = UsersDataModel.GetUsers(); }
public MainPage() { this.InitializeComponent(); storeData = new StoreData(); ItemGridView.DataContext = storeData.Collection; //ItemGridView.ItemsSource = storeData.Collection; }
public ScenarioOutput1() { InitializeComponent(); _storeData = new StoreData(); List<GroupInfoList<object>> dataCategory = _storeData.GetGroupsByCategory(); cvs1.Source = dataCategory; }
public Scenario1() { this.InitializeComponent(); // initializes the store data storeData = new StoreData(); // sets the source of the GridView to the store data collection ItemGridView.ItemsSource = storeData.Collection; }
public ScenarioOutput2() { InitializeComponent(); _storeData = new StoreData(); List<GroupInfoList<object>> dataLetter = _storeData.GetGroupsByLetter(); cvs2.Source = dataLetter; }
public MainPage() { this.InitializeComponent(); _storeData = new StoreData(); List<GroupInfoList<object>> dataLetter = _storeData.GetGroupsByLetter(); cvs2.Source = dataLetter; (semanticZoom.ZoomedOutView as ListViewBase).ItemsSource = cvs2.View.CollectionGroups; }
public Scenario4() { this.InitializeComponent(); // create a new instance of store data storeData = new StoreData(); // set the source of the GridView to be the sample data ItemGridView.ItemsSource = storeData.Collection; }
//Load the Scene with the cube/ setup the soomla intergration void Start() { if (!mInstance) mInstance = this; Application.LoadLevel("Intro"); //Load actual scene DontDestroyOnLoad(transform.gameObject); //Allows this gameObject to remain during level loads, solving restart crashes StoreEvents.OnSoomlaStoreInitialized += onSoomlaStoreIntitialized; //Handle the initialization of store events (calls function below - unneeded in this case) StoreEvents.OnMarketPurchase += onMarketPurchase; SoomlaStore.Initialize(new StoreAssets()); //Intialize the store }
public Scenario4() { this.InitializeComponent(); // initializing sample data toppingsData = new ToppingsData(); storeData = new StoreData(); // setting GridView data sources to sample data FlavorGrid.ItemsSource = storeData.Collection; FixinsGrid.ItemsSource = toppingsData.Collection; }
public Scenario2() { this.InitializeComponent(); // creates a new instance of the sample data _storeData = new StoreData(); // sets the list of categories to the groups from the sample data List<GroupInfoList<object>> dataLetter = _storeData.GetGroupsByLetter(); // sets the CollectionViewSource in the XAML page resources to the data groups cvs2.Source = dataLetter; }
// Save Function public void Save() { BinaryFormatter bf = new BinaryFormatter (); FileStream file = File.Create (Application.persistentDataPath + "/pointless.dat"); StoreData data = new StoreData (); data.levelOwned = levelOwned; bf.Serialize (file, data); file.Close(); }
public Scenario3() { this.InitializeComponent(); // creates a new instance of the sample data _storeData = new StoreData(); // sets the list of categories to the groups from the sample data List<GroupInfoList<object>> dataLetter = _storeData.GetGroupsByLetter(); // sets the CollectionViewSource in the XAML page resources to the data groups cvs2.Source = dataLetter; // sets the items source for the zoomed out view to the group data as well (semanticZoom.ZoomedOutView as ListViewBase).ItemsSource = cvs2.View.CollectionGroups; }
public MainPage() { this.InitializeComponent(); //Get the root Frame of Window. Frame rootFrame = Window.Current.Content as Frame; _root = ElementCompositionPreview.GetElementVisual(rootFrame) as ContainerVisual; //Get compositor _compositor = _root.Compositor; //Set up Sample Data to load the list. StoreData sampleData = new StoreData(); _sampleCollection = sampleData.Collection; }
/// <summary> /// Método principal de la página. /// </summary> public AboutPage() { this.InitializeComponent(); AboutPageInit(); storeData = new StoreData(); storeData.LoadData(); _source = storeData.GetGroupsByCategory(); ItemGridView2.ItemsSource = storeData.Collection; // Añadimos el listener únicamente para deshabilitar el click izquierdo. // Cambiar por algo más apropiado ItemGridView2.IsItemClickEnabled = true; ItemGridView2.ItemClick += ItemGridView2_ItemClick; // Controlamos el evento de selección para deshabilitar el botón de borrado si no hay ningún almacén importado ItemGridView2.SelectionChanged += ItemGridView2_SelectionChange; EvaluateDeleteButton(storeData); }
public void Save(StoreData data) { string path = GetCacheFilePath(data.Type, data.Key); string head_path = path + ".head"; string body_path = path + ".body"; string folder = GetCacheFileDirectory(data.Type, data.Key); SaveFile(folder, head_path, data.HeadersData); SaveFile(folder, body_path, data.BodyData); }
private async void Button_Import_Click(object sender, RoutedEventArgs e) { StringBuilder contents = new StringBuilder(); StorageFile selectedFile2 = null; FileOpenPicker openPicker = new FileOpenPicker(); openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary; openPicker.FileTypeFilter.Add(".pfx"); openPicker.FileTypeFilter.Add(".p12"); if (ApplicationView.Value == ApplicationViewState.Snapped) { if (ApplicationView.TryUnsnap()) { selectedFile2 = await openPicker.PickSingleFileAsync(); } } else { selectedFile2 = await openPicker.PickSingleFileAsync(); } if (selectedFile2 != null) { CredentialPanel cp = new CredentialPanel(); bool foco = cp.Focus(Windows.UI.Xaml.FocusState.Programmatic); CustomDialog customDialog = new CustomDialog(cp, labels.GetString("Etiqueta_peticion_pass")); customDialog.Commands.Add(new UICommand(labels.GetString("Boton_aceptar"))); customDialog.Commands.Add(new UICommand(labels.GetString("Boton_cancelar"))); customDialog.DefaultCommandIndex = 0; customDialog.CancelCommandIndex = 1; IUICommand com = await customDialog.ShowAsync(); if (com.Label.Equals(labels.GetString("Boton_aceptar"))) if (cp.getPassword() != null) using (StreamReader reader = new StreamReader(await selectedFile2.OpenStreamForReadAsync())) { char[] password = cp.getPassword().ToCharArray(); try { store = new Pkcs12Store(reader.BaseStream, password); if (store != null) { await selectedFile2.CopyAsync(localFolder, selectedFile2.Name, NameCollisionOption.ReplaceExisting); storeData = new StoreData(); storeData.LoadData(); _source = storeData.GetGroupsByCategory(); ItemGridView2.ItemsSource = storeData.Collection; EvaluateDeleteButton(storeData); // Le quitamos la extensión al nombre del almacén por coherencia con el borrado, que al pillarlo de la lista no tiene extensión. AfirmaMetroUtils.showMessage(labels.GetString("Info_almacen_importado") + selectedFile2.Name.Replace(selectedFile2.FileType, "") + "\".", "Importación de almacén correcta"); // Lanzamos: var options = new Windows.System.LauncherOptions(); options.DisplayApplicationPicker = true; var file2 = await localFolder.GetFileAsync(selectedFile2.Name); bool success = await Windows.System.Launcher.LaunchFileAsync(file2, options); } } catch { AfirmaMetroUtils.showMessage(labels.GetString("Error_carga_almacen"), "Error en la importación de almacén"); } } } }
private void EvaluateDeleteButton(StoreData storeData) { // Solo se habilita el botón de borrado si hay algún almacén seleccionado en la lista if (ItemGridView2.SelectedItem != null) { botonBorrar.IsEnabled = true; } else { botonBorrar.IsEnabled = false; } }
// Use this for initialization void Start() { mainCameraObj = GameObject.FindGameObjectWithTag("MainCamera"); buttonText = GameObject.Find("DialogueLabel").GetComponent<UILabel>(); narrativeAnchor = GameObject.FindGameObjectWithTag("NarrativeAnchor"); narrativeDialogue = GameObject.FindGameObjectWithTag("NarrativeDialogue").GetComponent<UILabel>(); mReaderObject = GameObject.Find("A*").GetComponent<MissionReader>(); gameManageObject = GameObject.FindGameObjectWithTag("GameController").GetComponent<gameManage>(); storeDataObject = GameObject.Find("SaveData").GetComponent<StoreData>(); readDialogueFile(); gameManageObject.narrativePanelOpen = true; if(Application.loadedLevelName == "Tutorial") { readSection(1); } }
public void Save(StoreData data) { string cache_path = GetCacheFilePath(data.Type, data.Key); string old_path = cache_path + ".old"; string new_path = cache_path + ".new." + (new Random().Next(9999)); bool exists_cache = false; if (!File.Exists(cache_path)) { string folder = GetCacheFileDirectory(data.Type, data.Key); if (!Directory.Exists(folder)) { Directory.CreateDirectory(folder); } } else { exists_cache = true; } try { using (var fs = File.Create(new_path, 1024 * 256, FileOptions.RandomAccess)) { binaryFormatter.Serialize(fs, data); fs.Close(); fs.Dispose(); } if (exists_cache) { if (File.Exists(old_path)) { File.Delete(old_path); } File.Move(cache_path, old_path); } File.Move(new_path, cache_path); } catch (Exception ex) { } finally { if (File.Exists(new_path)) { File.Delete(new_path); } if (File.Exists(old_path)) { File.Delete(old_path); } } }
private void getSerializedData() { try { using (Stream stream = File.Open(serializedDataPath, FileMode.Open)) { BinaryFormatter bin = new BinaryFormatter(); storeData = (StoreData)bin.Deserialize(stream); } } catch (IOException) { storeData = new StoreData(); Console.WriteLine("MusicStore Serialization | Trying to read to a file, an error occured"); } }
public async void GetUserContacts(string token) { Uri[] _localImages = { new Uri("ms-appx:///Images/user.png"), new Uri("ms-appx:///SampleData/Images/60Mail01.png"), new Uri("ms-appx:///SampleData/Images/60Mail02.png"), new Uri("ms-appx:///SampleData/Images/60Mail03.png"), new Uri("ms-appx:///SampleData/Images/msg.png"), }; var uri = new Uri("https://apis.live.net/v5.0/me/contacts?access_token=" + token); var client = new HttpClient(); var result = await client.GetAsync(uri); string jsonUserContacts = await result.Content.ReadAsStringAsync(); if (jsonUserContacts != null) { var json = JsonObject.Parse(jsonUserContacts); var contacts = json["data"] as JsonValue; var storeData = new StoreData(); int index = 0; foreach (JsonValue contact in contacts.GetArray()) { var obj = contact.GetObject(); var item = new Item(); item.Name = obj["name"].GetString(); item.Id = obj["id"].GetString(); if (obj["user_id"].ValueType == JsonValueType.String) { string userId = obj["user_id"].GetString(); item.SetImage("https://apis.live.net/v5.0/" + userId + "/picture?access_token=" + token); } else { item.Image = new BitmapImage(_localImages[index % _localImages.Length]); } storeData.Collection.Add(item); index++; } cvs1.Source = storeData.GetGroupsByLetter(); } }
public StoreData GetData(string type, string key) { string path = GetCacheFilePath(type, key); string head_path = path + ".head"; string body_path = path + ".body"; StoreData data = null; var data_head = ReadFile(head_path); if (data_head != null) { var data_body = ReadFile(body_path); if (data_body != null) { data = new StoreData(); data.BodyData = data_body; data.CreatedDate = new DateTime(2000, 1, 1); data.ExpiresAbsolute = DateTime.Today.AddYears(10); data.HeadersData = data_head; data.Key = key; data.Seconds = Convert.ToInt32((data.ExpiresAbsolute - data.CreatedDate).TotalSeconds); data.Type = type; } } return data; }