public async Task <ObservableCollection <MenuItem> > getMenuItems() { var loader = new Windows.ApplicationModel.Resources.ResourceLoader(); string type = loader.GetString("type"); Uri menuUri = new Uri("ms-appx:///DataModel/MenuItems-" + type + ".json"); StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(menuUri); /*List<MenuItem> movie1 = JsonConvert.DeserializeObject<List<MenuItem>>(await FileIO.ReadLinesAsync(file));*/ string jsonText = await FileIO.ReadTextAsync(file); JsonObject jsonObject = JsonObject.Parse(jsonText.ToString()); JsonArray jsonArray = jsonObject["MenuItems"].GetArray(); foreach (JsonValue groupValue in jsonArray) { JsonObject groupObject = groupValue.GetObject(); MenuItem _sampleDataSource = new MenuItem(groupObject["name"].GetString(), groupObject["description"].GetString(), LocalProperties.LoadFromToLP(LocalProperties.LP_theme) == LocalProperties.theme_light ? groupObject["img_black"].GetString() : groupObject["img_white"].GetString(), groupObject["position"].GetString()); MenuList.Add(_sampleDataSource); } return(MenuList); }
public bool Load(XmlElement el, FDMExecutive fdmex, string prefix = "") { LocalProperties.Load(el, fdmex.PropertyManager, false); PreLoad(el, fdmex, prefix); return(true); // TODO: Need to make this value mean something. }
private async void LoadSchedule_Click(object sender, RoutedEventArgs e) { if (!Constant.checkNetworkConnection()) { ResourceLoader resourceLoader = ResourceLoader.GetForCurrentView("Resources"); await new MessageDialog(resourceLoader.GetString("Error_InternetConnection"), resourceLoader.GetString("Error")).ShowAsync(); return; } Constant.Loader(this.resourceLoader.GetString("GlobalLoading"), true); LoadSchedule.IsEnabled = false; Cities.IsEnabled = false; Database.CreateTables(); Database.DropDatabase(); Status status = await Task.Run(() => loadSchedule()); if (status.isSuccess) { Constant.Loader(this.resourceLoader.GetString("GlobalLoadingSuccess"), false); LocalProperties.SaveToLP(LocalProperties.LP_selected_city, selected.key); if (!Frame.Navigate(typeof(HubPage), "true")) { throw new Exception(this.resourceLoader.GetString("NavigationFailedExceptionMessage")); } } else if (status.reason != null) { new MessageDialog(status.reason).ShowAsync(); } }
/// <summary> /// /// </summary> /// <param name="_props"></param> public LocalPropertyGridObject(LocalProperties _props) { _properties = _props; if (_properties == null) { _properties = new LocalProperties(); } }
/// <summary> /// Loads this model. /// </summary> /// <param name="el"></param> /// <param name="preLoad">true if model functions and local properties must be /// preloaded.</param> /// <returns>true if model is successfully loaded</returns> protected virtual bool Load(XmlElement el, bool preLoad) { ModelLoader modelLoader = new ModelLoader(this); XmlElement document = modelLoader.Open(el); ModelFunctions ModelFunctions = new ModelFunctions(); if (document == null) { return(false); } if (document.Name != el.Name) { log.Error(" Read model '" + document.Name + "' while expecting model '" + el.Name + "'"); return(false); } bool result = true; if (preLoad) { result = ModelFunctions.Load(document, FDMExec); } if (document != el) { el.MergeAttributes(document); if (preLoad) { // After reading interface properties in a file, read properties in the // local model element. This allows general-purpose models to be defined // in a file, with overrides or initial loaded constants supplied in the // relevant element of the aircraft configuration file. LocalProperties.Load(el, propertyManager, true); } foreach (var node in document.ChildNodes) { XmlElement element = node as XmlElement; if (element != null) { el.AppendChild(element); } } } return(result); }
private async void LoadSettings() { if (!isLoadedSettings) { Toggle_Theme.IsOn = LocalProperties.LoadFromToLP(LocalProperties.LP_theme) == LocalProperties.theme_light; Settings_Latest_Database.Text = LocalProperties.LoadFromToLP(LocalProperties.LP_current_version); New_Goes.CommonAPI.Metadata.StatusMetaData metadata = await Metadata.Get_MetaData(); if (metadata.obj != null) { string city = LocalProperties.LoadFromToLP(LocalProperties.LP_selected_city); int version = 0; switch (city) { case "brest": version = metadata.obj.cities_versions.brest; break; case "vitebsk": version = metadata.obj.cities_versions.vitebsk; break; case "grodno": version = metadata.obj.cities_versions.grodno; break; case "gomel": version = metadata.obj.cities_versions.gomel; break; case "mogilev": version = metadata.obj.cities_versions.mogilev; break; case "minsk": version = metadata.obj.cities_versions.minsk; break; } Settings_Newest_Database.Text = version.ToString(); if (version > Int32.Parse(LocalProperties.LoadFromToLP(LocalProperties.LP_current_version))) { Constant.ShowNotification("Доступно обновление расписания"); } } } isLoadedSettings = true; }
private async Task LoadStopNames() { SQLiteConnection connection = new SQLiteConnection(dbPath); Transport = new List <StopNameAllSQL>(); var items = connection.Query <StopNameSQL>( "SELECT s.n_id as id, REPLACE(sn.name,'ул. ','') as name FROM stop AS s LEFT JOIN stopname as sn ON s.n_id = sn.id GROUP BY s.n_id ORDER BY name"); List <StopNameSQL> buses = connection.Query <StopNameSQL>( "SELECT s.n_id as id, REPLACE(sn.name,'ул. ','') as name,r.type as type FROM stop AS s LEFT JOIN stopname as sn ON s.n_id = sn.id LEFT JOIN route as r ON s.r_id = r.id WHERE r.type= 0 GROUP BY s.n_id ORDER BY name"); List <StopNameSQL> trolls = connection.Query <StopNameSQL>( "SELECT s.n_id as id, REPLACE(sn.name,'ул. ','') as name,r.type as type FROM stop AS s LEFT JOIN stopname as sn ON s.n_id = sn.id LEFT JOIN route as r ON s.r_id = r.id WHERE r.type= 1 GROUP BY s.n_id ORDER BY name"); List <StopNameSQL> tramms = connection.Query <StopNameSQL>( "SELECT s.n_id as id, REPLACE(sn.name,'ул. ','') as name,r.type as type FROM stop AS s LEFT JOIN stopname as sn ON s.n_id = sn.id LEFT JOIN route as r ON s.r_id = r.id WHERE r.type= 2 GROUP BY s.n_id ORDER BY name"); foreach (var item in items) { Transport.Add(new StopNameAllSQL() { id = item.id, isBus = buses.Find(x => x.name == item.name) != null ? (LocalProperties.LoadFromToLP(LocalProperties.LP_theme) != LocalProperties.theme_light ? "/Assets/MenuItemsLogo/ic_bus_white.png" : "/Assets/MenuItemsLogo/ic_bus_black.png") : null, isTroll = trolls.Find(x => x.name == item.name) != null ? (LocalProperties.LoadFromToLP(LocalProperties.LP_theme) != LocalProperties.theme_light ? "/Assets/MenuItemsLogo/ic_troll_white.png" : "/Assets/MenuItemsLogo/ic_troll_black.png") : null, isTramm = tramms.Find(x => x.name == item.name) != null ? (LocalProperties.LoadFromToLP(LocalProperties.LP_theme) != LocalProperties.theme_light ? "/Assets/MenuItemsLogo/ic_tram_white.png" : "/Assets/MenuItemsLogo/ic_tram_black.png") : null, name = item.name, width = screenWidth }); } List <StopNameAllSQL> New_Transport = new List <StopNameAllSQL>(); var tt = Transport.GroupBy(item => item.name) .Select(group => new { name = group.Key, width = screenWidth, id = group.ToList()[0].id, isBus = group.ToList()[0].isBus, isTroll = group.ToList()[0].isTroll, isTramm = group.ToList()[0].isTramm }) .ToList(); this.DefaultViewModel["Transport"] = tt; /*await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, * () => * { * if (Buses.Count == 0) * PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemBus)); * if (Trolls.Count == 0) * PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemTroll)); * if (Tramms.Count == 0) * PivotMain.Items.RemoveAt(PivotMain.Items.IndexOf(PItemTramm)); * } * );*/ }
//------------------------------------------------------------------------------------ /// <summary> /// Sets a value that will be cached locally (not saved to the backing store). /// </summary> //------------------------------------------------------------------------------------ private void EnsureLocalValue(string publicPropName, PropType type) { lock (SyncLockLocalProperties) { if (LocalProperties == null) { LocalProperties = new System.Collections.Generic.Dictionary <string, object>(); } if (!LocalProperties.ContainsKey(publicPropName)) { LocalProperties.Add(publicPropName, ItemProperty.GetValue(null, type)); } } }
private async void Button_Click(object sender, RoutedEventArgs e) { Constant.Loader(this.resourceLoader.GetString("GlobalLoading"), true); if (LocalProperties.LoadFromToLP(LocalProperties.LP_active_premium) != "true") { MessageDialog msg = new MessageDialog(this.resourceLoader.GetString("MessageDialogPremiumContent"), this.resourceLoader.GetString("MessageDialogPremiumTitle")); msg.Commands.Add(new UICommand(this.resourceLoader.GetString("StaticButtonCancel"), new UICommandInvokedHandler(CommandHandlers))); msg.Commands.Add(new UICommand(this.resourceLoader.GetString("StaticButtonBuy"), new UICommandInvokedHandler(CommandHandlers))); msg.ShowAsync(); } else { await Task.Run(() => GetRoutes()); } Constant.Loader(this.resourceLoader.GetString("GlobalLoading"), false); }
private void ToggleSwitch_Toggled(object sender, RoutedEventArgs e) { if (isLoadedSettings) { TextBlock_ReloadApp.Visibility = Visibility.Visible; TextBlock_ReloadApp.Text = this.resourceLoader.GetString("Reload_Application"); if (LocalProperties.LoadFromToLP(LocalProperties.LP_theme) == LocalProperties.theme_light) { LocalProperties.SaveToLP(LocalProperties.LP_theme, LocalProperties.theme_dark); } else { LocalProperties.SaveToLP(LocalProperties.LP_theme, LocalProperties.theme_light); } } }
private void LoadValues() { if (LocalProperties.LoadFromToLP(LocalProperties.LP_theme) == null) { this.RequestedTheme = ApplicationTheme.Light; LocalProperties.SaveToLP(LocalProperties.LP_theme, LocalProperties.theme_light); } else if (LocalProperties.LoadFromToLP(LocalProperties.LP_theme) == LocalProperties.theme_light) { this.RequestedTheme = ApplicationTheme.Light; } else { this.RequestedTheme = ApplicationTheme.Dark; } }
public async void CommandHandlers(IUICommand commandLabel) { var Actions = commandLabel.Label; if (this.resourceLoader.GetString("StaticButtonBuy") == Actions) { if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable()) { ListingInformation listing = await CurrentApp.LoadListingInformationAsync(); var superweapon = listing.ProductListings.FirstOrDefault(p => p.Value.ProductId == Constant.IAP_PREMIUN); try { ListingInformation LicensePremiumID = await Windows.ApplicationModel.Store.CurrentApp.LoadListingInformationByProductIdsAsync(new string[] { Constant.IAP_PREMIUN }); string x = await CurrentApp.RequestProductPurchaseAsync(LicensePremiumID.ProductListings.ToList()[0].Value.ProductId, false); var productLicenses = CurrentApp.LicenseInformation.ProductLicenses; ProductLicense tokenLicense = productLicenses[Constant.IAP_PREMIUN]; if (tokenLicense.IsActive) { LocalProperties.SaveToLP(LocalProperties.LP_active_premium, "true"); new MessageDialog("Платный функционал успешно активирован").ShowAsync(); } else { new MessageDialog("Не удалось активировать!").ShowAsync(); } } catch (Exception ex) { new MessageDialog("Неизвестная ошибка").ShowAsync(); } } else { new MessageDialog(resourceLoader.GetString("Error_InternetConnection"), resourceLoader.GetString("Error")).ShowAsync(); } } else { this.resourceLoader.GetString("StaticButtonCancel"); } }
private void ListView_ItemClick(object sender, ItemClickEventArgs e) { if (LocalProperties.LoadFromToLP(LocalProperties.LP_active_premium) != "true") { MessageDialog msg = new MessageDialog(this.resourceLoader.GetString("MessageDialogPremiumContent"), this.resourceLoader.GetString("MessageDialogPremiumTitle")); msg.Commands.Add(new UICommand(this.resourceLoader.GetString("StaticButtonCancel"), new UICommandInvokedHandler(CommandHandlers))); msg.Commands.Add(new UICommand(this.resourceLoader.GetString("StaticButtonBuy"), new UICommandInvokedHandler(CommandHandlers))); msg.ShowAsync(); } else { if (!Frame.Navigate(typeof(Views.Taxi.Cities.First), JsonConvert.SerializeObject(e.ClickedItem as StaticFBusesData))) { throw new Exception(this.resourceLoader.GetString("NavigationFailedExceptionMessage")); } } }
private void UpdateEntitiesProperties(List <Retro_Formats.Object> selectedEntities) { multipleObjects = false; bool isCommonObjects = false; if (selectedEntities.Count != 1) { entityProperties.SelectedObject = null; currentEntity = null; entitiesList.ResetText(); _selectedEntitySlots.Clear(); if (selectedEntities.Count > 1) { isCommonObjects = true; entitiesList.SelectedText = String.Format("{0} entities selected", selectedEntities.Count); entitiesList.Items.Clear(); entitiesList.DisplayMember = "Text"; entitiesList.Tag = "Value"; foreach (Retro_Formats.Object selectedEntity in selectedEntities) { entitiesList.Items.Add(new { Text = (String.Format("{0} - {1}", selectedEntity.id, selectedEntity.Name)), Value = selectedEntity.id }); _selectedEntitySlots.Add(selectedEntity.id); } //entitiesList.Items.AddRange(selectedEntities.Select(x => String.Format("{0} - {1}", x.SlotID, x.Object.Name)).ToArray()); multipleObjects = true; //_selectedEntitySlots.AddRange(selectedEntities.Select(x => (int)x.SlotID).ToList()); string commonObject = selectedEntities[0].Name; foreach (Retro_Formats.Object selectedEntity in selectedEntities) { if (selectedEntity.Name != commonObject) { isCommonObjects = false; } } } if (isCommonObjects == true) { //Keep Going (if Implemented; which it's not) // return; } else { //return; } } Retro_Formats.Object entity = selectedEntities[0]; if (entity == currentEntity) { return; } currentEntity = entity; if (entitiesList.SelectedIndex >= 0 && entitiesList.SelectedIndex < _entities.Count && _entities[entitiesList.SelectedIndex] == currentEntity) { // Than it is called from selected item in the menu, so changeing the text will remove it, we don't want that } else { entitiesList.ResetText(); entitiesList.SelectedText = String.Format("{0} - {1}", currentEntity.id, currentEntity.Name); //entitiesList.SelectedIndex = entities.IndexOf(entity); } LocalProperties objProperties = new LocalProperties(); int category_index = 3;//+ entity.Attributes.Count; if (engineType == Retro_Formats.EngineType.RSDKvB) { category_index = 4; } addProperty(objProperties, category_index, "object", "name", "string", entity.Name.ToString(), false); addProperty(objProperties, category_index, "object", "entitySlot", "ushort", entity.id, false); --category_index; addProperty(objProperties, category_index, "position", "x", "ushort", entity.xPos); addProperty(objProperties, category_index, "position", "y", "ushort", entity.yPos); --category_index; addProperty(objProperties, category_index, "type", "Type", "byte", entity.type); addProperty(objProperties, category_index, "type", "PropertyValue", "byte", entity.subtype); --category_index; if (engineType == Retro_Formats.EngineType.RSDKvB) { addProperty(objProperties, category_index, "attribute", "attributeType", "ushort", entity.AttributeType); addProperty(objProperties, category_index, "attribute", "attributeValue 1", "uint", entity.attributes[0]); addProperty(objProperties, category_index, "attribute", "attributeValue 2", "uint", entity.attributes[1]); addProperty(objProperties, category_index, "attribute", "attributeValue 3", "uint", entity.attributes[2]); addProperty(objProperties, category_index, "attribute", "attributeValue 4", "byte", entity.attributes[3]); addProperty(objProperties, category_index, "attribute", "attributeValue 5", "byte", entity.attributes[4]); addProperty(objProperties, category_index, "attribute", "attributeValue 6", "byte", entity.attributes[5]); addProperty(objProperties, category_index, "attribute", "attributeValue 7", "uint", entity.attributes[6]); addProperty(objProperties, category_index, "attribute", "attributeValue 8", "uint", entity.attributes[7]); addProperty(objProperties, category_index, "attribute", "attributeValue 9", "byte", entity.attributes[8]); addProperty(objProperties, category_index, "attribute", "attributeValue 10", "uint", entity.attributes[9]); addProperty(objProperties, category_index, "attribute", "attributeValue 11", "uint", entity.attributes[10]); addProperty(objProperties, category_index, "attribute", "attributeValue 12", "uint", entity.attributes[11]); addProperty(objProperties, category_index, "attribute", "attributeValue 13", "uint", entity.attributes[12]); addProperty(objProperties, category_index, "attribute", "attributeValue 14", "uint", entity.attributes[13]); --category_index; } entityProperties.SelectedObject = new LocalPropertyGridObject(objProperties); }
private async Task <Status> updateSchedule() { Schedule scedule = new Schedule(); return(await scedule.GetSchedule(LocalProperties.LoadFromToLP(LocalProperties.LP_selected_city))); }
public virtual bool InitModel() { LocalProperties.ResetToIC(); return(true); }
private void addProperty(LocalProperties properties, int category_index, string category, string name, string value_type, object value, bool read_only = false) { properties.Add(String.Format("{0}.{1}", category, name), new LocalProperty(name, value_type, category_index, category, name, true, read_only, value, "") ); }
private void UpdateEntitiesProperties(List <RSDKv5.SceneEntity> selectedEntities) { //TODO: Allow to change multiple entities /*bool first_entity = true; * RSDKv5.SceneObject commonObject = null; * * foreach (var entity in selectedEntities) * { * if (first_entity) commonObject = entity.Object; * else if (entity.Object != commonObject) commonObject = null; * } * * if (commonObject != currentObject) * { * currentObject = commonObject;*/ multipleObjects = false; if (selectedEntities.Count != 1) { entityProperties.SelectedObject = null; currentEntity = null; entitiesList.ResetText(); _selectedEntitySlots.Clear(); if (selectedEntities.Count > 1) { entitiesList.SelectedText = String.Format("{0} entities selected", selectedEntities.Count); entitiesList.Items.Clear(); entitiesList.Items.AddRange(selectedEntities.Select(x => String.Format("{0} - {1}", x.SlotID, x.Object.Name)).ToArray()); multipleObjects = true; _selectedEntitySlots.AddRange(selectedEntities.Select(x => (int)x.SlotID).ToList()); } return; } RSDKv5.SceneEntity entity = selectedEntities[0]; if (entity == currentEntity) { return; } currentEntity = entity; if (entitiesList.SelectedIndex >= 0 && entitiesList.SelectedIndex < _entities.Count && _entities[entitiesList.SelectedIndex] == currentEntity) { // Than it is called from selected item in the menu, so changeing the text will remove it, we don't want that } else { entitiesList.ResetText(); entitiesList.SelectedText = String.Format("{0} - {1}", currentEntity.SlotID, currentEntity.Object.Name); //entitiesList.SelectedIndex = entities.IndexOf(entity); } LocalProperties objProperties = new LocalProperties(); int category_index = 2 + entity.Attributes.Count; addProperty(objProperties, category_index, "object", "name", "string", entity.Object.Name.ToString(), false); addProperty(objProperties, category_index, "object", "entitySlot", "ushort", entity.SlotID, false); --category_index; addProperty(objProperties, category_index, "position", "x", "float", entity.Position.X.High + ((float)entity.Position.X.Low / 0x10000)); addProperty(objProperties, category_index, "position", "y", "float", entity.Position.Y.High + ((float)entity.Position.Y.Low / 0x10000)); --category_index; foreach (var attribute in entity.Object.Attributes) { string attribute_name = attribute.Name.ToString(); var attribute_value = currentEntity.GetAttribute(attribute_name); switch (attribute.Type) { case RSDKv5.AttributeTypes.UINT8: addProperty(objProperties, category_index, attribute_name, "uint8", "byte", attribute_value.ValueUInt8); break; case RSDKv5.AttributeTypes.UINT16: addProperty(objProperties, category_index, attribute_name, "uint16", "ushort", attribute_value.ValueUInt16); break; case RSDKv5.AttributeTypes.UINT32: addProperty(objProperties, category_index, attribute_name, "uint32", "uint", attribute_value.ValueUInt32); break; case RSDKv5.AttributeTypes.INT8: addProperty(objProperties, category_index, attribute_name, "int8", "sbyte", attribute_value.ValueInt8); break; case RSDKv5.AttributeTypes.INT16: addProperty(objProperties, category_index, attribute_name, "int16", "short", attribute_value.ValueInt16); break; case RSDKv5.AttributeTypes.INT32: addProperty(objProperties, category_index, attribute_name, "int32", "int", attribute_value.ValueInt32); break; case RSDKv5.AttributeTypes.VAR: addProperty(objProperties, category_index, attribute_name, "var", "uint", attribute_value.ValueVar); break; case RSDKv5.AttributeTypes.BOOL: addProperty(objProperties, category_index, attribute_name, "bool", "bool", attribute_value.ValueBool); break; case RSDKv5.AttributeTypes.STRING: addProperty(objProperties, category_index, attribute_name, "string", "string", attribute_value.ValueString); break; case RSDKv5.AttributeTypes.POSITION: addProperty(objProperties, category_index, attribute_name, "x", "float", attribute_value.ValuePosition.X.High + ((float)attribute_value.ValuePosition.X.Low / 0x10000)); addProperty(objProperties, category_index, attribute_name, "y", "float", attribute_value.ValuePosition.Y.High + ((float)attribute_value.ValuePosition.Y.Low / 0x10000)); break; case RSDKv5.AttributeTypes.COLOR: var color = attribute_value.ValueColor; addProperty(objProperties, category_index, attribute_name, "color", "color", Color.FromArgb(255 /* color.A */, color.R, color.G, color.B)); break; } --category_index; } entityProperties.SelectedObject = new LocalPropertyGridObject(objProperties); }
private void UpdateEntitiesProperties(List <RSDKv5.Scene.ISCN_Object> selectedEntities) { // TODO: Allow to change multiple entities /*bool first_entity = true; * RSDKv5.SceneObject commonObject = null; * * foreach (var entity in selectedEntities) * { * if (first_entity) commonObject = entity.Object; * else if (entity.Object != commonObject) commonObject = null; * } * * if (commonObject != currentObject) * { * currentObject = commonObject;*/ if (selectedEntities.Count != 1) { entityProperties.SelectedObject = null; currentEntity = null; entitiesList.ResetText(); if (selectedEntities.Count > 1) { entitiesList.SelectedText = String.Format("{0} entities selected", selectedEntities.Count); } return; } RSDKv5.Scene.ISCN_Object entity = selectedEntities[0]; if (entity == currentEntity) { return; } currentEntity = entity; if (entitiesList.SelectedIndex >= 0 && entitiesList.SelectedIndex < entities.Count && entities[entitiesList.SelectedIndex] == currentEntity) { // Than it is called from selected item in the menu, so changeing the text will remove it, we don't want that } else { entitiesList.ResetText(); entitiesList.SelectedText = String.Format("{0} - {1}", currentEntity.Unused, currentEntity.Definition.ObjectName); //entitiesList.SelectedIndex = entities.IndexOf(entity); } LocalProperties objProperties = new LocalProperties(); int category_index = 2 + entity.Attributes.Count; addProperty(objProperties, category_index, "object", "name", "string", entity.Definition.ObjectName.ToString(), true); addProperty(objProperties, category_index, "object", "entitySlot", "ushort", entity.Unused, true); --category_index; addProperty(objProperties, category_index, "position", "x", "float", entity.X); addProperty(objProperties, category_index, "position", "y", "float", entity.Y); --category_index; int g = -1; foreach (var attribute in entity.Definition.AttributeTypes) { g++; string attribute_name = ""; // attribute.Name.ToString(); var attribute_value = currentEntity.Attributes[g]; switch (attribute) { case (byte)RSDKv5.AttributeTypes.UINT8: addProperty(objProperties, category_index, attribute_name, "uint8", "byte", attribute_value); break; case (byte)RSDKv5.AttributeTypes.UINT16: addProperty(objProperties, category_index, attribute_name, "uint16", "ushort", attribute_value); break; case (byte)RSDKv5.AttributeTypes.UINT32: addProperty(objProperties, category_index, attribute_name, "uint32", "uint", attribute_value); break; case (byte)RSDKv5.AttributeTypes.INT8: addProperty(objProperties, category_index, attribute_name, "int8", "sbyte", attribute_value); break; case (byte)RSDKv5.AttributeTypes.INT16: addProperty(objProperties, category_index, attribute_name, "int16", "short", attribute_value); break; case (byte)RSDKv5.AttributeTypes.INT32: addProperty(objProperties, category_index, attribute_name, "int32", "int", attribute_value); break; case (byte)RSDKv5.AttributeTypes.VAR: addProperty(objProperties, category_index, attribute_name, "var", "uint", attribute_value); break; case (byte)RSDKv5.AttributeTypes.BOOL: addProperty(objProperties, category_index, attribute_name, "bool", "bool", attribute_value); break; case (byte)RSDKv5.AttributeTypes.STRING: addProperty(objProperties, category_index, attribute_name, "string", "string", attribute_value); break; case (byte)RSDKv5.AttributeTypes.POSITION: // addProperty(objProperties, category_index, attribute_name, "x", "float", attribute_value.X.High + ((float)attribute_value.ValuePosition.X.Low / 0x10000)); // addProperty(objProperties, category_index, attribute_name, "y", "float", attribute_value.ValuePosition.Y.High + ((float)attribute_value.ValuePosition.Y.Low / 0x10000)); break; case (byte)RSDKv5.AttributeTypes.COLOR: // var color = attribute_value.ValueColor; // addProperty(objProperties, category_index, attribute_name, "color", "color", Color.FromArgb(255 /* color.A */, color.R, color.G, color.B)); break; } --category_index; } entityProperties.SelectedObject = new LocalPropertyGridObject(objProperties); }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used when the application is launched to open a specific file, to display /// search results, and so forth. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override async void OnLaunched(LaunchActivatedEventArgs e) { #if DEBUG if (System.Diagnostics.Debugger.IsAttached) { this.DebugSettings.EnableFrameRateCounter = true; } #endif Frame rootFrame = Window.Current.Content as Frame; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active. if (rootFrame == null) { // Create a Frame to act as the navigation context and navigate to the first page. rootFrame = new Frame(); // Associate the frame with a SuspensionManager key. SuspensionManager.RegisterFrame(rootFrame, "AppFrame"); // TODO: Change this value to a cache size that is appropriate for your application. rootFrame.CacheSize = 1; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { // Restore the saved session state only when appropriate. try { await SuspensionManager.RestoreAsync(); } catch (SuspensionManagerException) { // Something went wrong restoring state. // Assume there is no state and continue. } } // Place the frame in the current Window. Window.Current.Content = rootFrame; } if (rootFrame.Content == null) { // Removes the turnstile navigation for startup. if (rootFrame.ContentTransitions != null) { this.transitions = new TransitionCollection(); foreach (var c in rootFrame.ContentTransitions) { this.transitions.Add(c); } } rootFrame.ContentTransitions = null; rootFrame.Navigated += this.RootFrame_FirstNavigated; // When the navigation stack isn't restored navigate to the first page, // configuring the new page by passing required information as a navigation // parameter. if (LocalProperties.LoadFromToLP(LocalProperties.LP_selected_city) == null) { if (!rootFrame.Navigate(typeof(Loading), e.Arguments)) { throw new Exception("Failed to create initial page"); } } else if (!rootFrame.Navigate(typeof(HubPage), e.Arguments)) { throw new Exception("Failed to create initial page"); } } // Ensure the current window is active. Window.Current.Activate(); }