public MPopUpPage(AboutItem aboutItem) { BackgroundColor = Color.FromHex("#80000000"); Animation = new ScaleAnimation(); Label title = new Label { Text = aboutItem.title, FontSize = 25, HorizontalTextAlignment = TextAlignment.Center }; Image mImage = new Image { Source = aboutItem.image, Aspect = Aspect.AspectFit, HeightRequest = 100, WidthRequest = 400, HorizontalOptions = LayoutOptions.Start }; Label mLabel = new Label { Text = aboutItem.content, FontSize = 15 }; StackLayout aboutStacklayout = new StackLayout { BackgroundColor = Color.White }; aboutStacklayout.Children.Add(title); aboutStacklayout.Children.Add(mImage); aboutStacklayout.Children.Add(mLabel); ScrollView scrollView = new ScrollView { Orientation = ScrollOrientation.Vertical, HorizontalOptions = LayoutOptions.Center }; scrollView.Content = aboutStacklayout; Content = scrollView; }
public ActionResult EditAboutItem(FormCollection fc) { if (!CheckLogin()) { return(RedirectToAction("Index", "Home")); } int ID = Convert.ToInt32(fc["hiddenID"]); string Text = fc["inputText"]; string Value = fc["inputValue"]; if (string.IsNullOrEmpty(Text) | string.IsNullOrEmpty(Value)) { return(View()); } AboutItem ai = new AboutItem { ID = ID, Text = Text, Value = Value }; db.Entry(ai).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("AboutSettings")); }
void Start() { contentsData = AppData.ContentsData; for (int i = 0; i < fileIDList.Length; i++) { AboutItem item = Instantiate(itemPrefab, itemContainer); item.Init(contentsData.ContentDictionary[fileIDList[i]].ContentsName, fileIDList[i]); } AboutItem credit = Instantiate(itemPrefab, itemContainer); credit.Init(AppData.UsedLanguage == SystemLanguage.Japanese ? "クレジット": "Credit", () => { creditController.PushCredit(); }); //#if DEVELOPMENT_BUILD || UNITY_EDITOR // AboutItem workSheet = Instantiate(itemPrefab, itemContainer); // workSheet.Init("アンケート回答", // () => // { // developerMenu.StartWorkSheet(); // }); AboutItem developMenu = Instantiate(itemPrefab, itemContainer); developMenu.Init(AppData.UsedLanguage == SystemLanguage.Japanese ? "木札が見つからない時は" : "If the wooden tags can not be found.", () => { developerMenu.Open(); }); //#endif }
private void OnAboutLabelClicked(object s, EventArgs e) { Label label = (Label)s; AboutItem itemToPop = aboutItems.Find(X => X.id == label.ClassId); MPopUpPage mPopUpPage = new MPopUpPage(itemToPop); mMenu.PopUp(mPopUpPage); }
// // Navbar Index: 4 // GET: Admin/DeleteAboutItem public ActionResult DeleteAboutItem(int ID) { if (!CheckLogin()) { return(RedirectToAction("Index", "Home")); } AboutItem ai = db.AboutItems.Find(ID); if (ai != null) { db.AboutItems.Remove(ai); db.SaveChanges(); } return(RedirectToAction("AboutSettings")); }
// // Navbar Index: 4 // GET: Admin/PreEditAboutItem public ActionResult PreEditAboutItem(int ID) { if (!CheckLogin()) { return(RedirectToAction("Index", "Home")); } AboutItem ai = db.AboutItems.Find(ID); if (ai != null) { if (Request.IsAjaxRequest()) { return(PartialView("~/Views/Admin/_PartialAboutItemEditor.cshtml", ai)); } } return(RedirectToAction("AboutSettings")); }
/// <summary> /// This method creates a new updated version of a locale specific view model for calculation. /// </summary> /// <param name="baseUrl"></param> /// <param name="localeIsoCode"></param> /// <returns></returns> private static AboutViewModel CreateAboutCalculationsViewModel(string baseUrl, string localeIsoCode) { AboutViewModel model = new AboutViewModel(); AboutItem item = null; string html = GetPageAsText(baseUrl + Resource.AboutUrlCalculation); if (html.IsNotEmpty()) { model.TitleLabel = GetTitleLabelFromHtml(html); model.Description = GetDescriptionFromHtml(html); model.Items = new List <AboutItem>(); item = CreateAboutItem(baseUrl + Resource.AboutUrlCalculationSummaryStatistics, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlCalculationGridStatistics, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlCalculationTimeSeries, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } /* * item = createAboutItem(baseUrl + LOCAL_URL_CALCULATION_MODEL, localeIsoCode); * if (item.Header.IsNotEmpty()) * { * model.Items.Add(item); * } */ //item = createAboutItem(baseUrl + LOCAL_URL_CALCULATION_REPEAT, localeIsoCode); //if (item.Header.IsNotEmpty()) //{ // model.Items.Add(item); //} } return(model); }
/// <summary> /// This method creates a new updated version of a locale specific view model for results. /// </summary> /// <param name="baseUrl"></param> /// <param name="localeIsoCode"></param> /// <returns></returns> private static AboutViewModel CreateAboutResultFormatViewModel(string baseUrl, string localeIsoCode) { AboutViewModel model = new AboutViewModel(); AboutItem item = null; string html = GetPageAsText(baseUrl + Resource.AboutUrlResult); if (html.IsNotEmpty()) { model.TitleLabel = GetTitleLabelFromHtml(html); model.Description = GetDescriptionFromHtml(html); model.Items = new List <AboutItem>(); item = CreateAboutItem(baseUrl + Resource.AboutUrlResultMaps, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlResultTables, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlResultDiagrams, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlResultReports, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlResultDownload, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } } return(model); }
/// <summary> /// This method creates a new updated version of a locale specific view model for filters. /// </summary> /// <param name="baseUrl"></param> /// <param name="localeIsoCode"></param> /// <returns></returns> private static AboutViewModel CreateAboutFiltersViewModel(string baseUrl, string localeIsoCode) { AboutViewModel model = new AboutViewModel(); AboutItem item = null; string html = GetPageAsText(baseUrl + Resource.AboutUrlFilter); if (html.IsNotEmpty()) { model.TitleLabel = GetTitleLabelFromHtml(html); model.Description = GetDescriptionFromHtml(html); model.Items = new List <AboutItem>(); item = CreateAboutItem(baseUrl + Resource.AboutUrlFilterOccurrence, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlFilterTaxa, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlFilterSpatial, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlFilterTemporal, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlFilterQuality, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } } return(model); }
/// <summary> /// General method for cration of single about items. /// </summary> /// <param name="url"></param> /// <param name="localeIsoCode"></param> /// <returns></returns> private static AboutItem CreateAboutItem(string url, string localeIsoCode) { AboutItem item = new AboutItem(); string html = GetPageAsText(url); item.Header = GetTitleLabelFromHtml(html); item.Description = GetDescriptionFromHtml(html); item.ReadMoreLinkUrl = url; if (localeIsoCode == "sv-SE") { item.ReadMoreLinkLabel = "Läs mer..."; item.ReadMoreLinkHint = "Läs mer om " + item.Header.ToLower(); } else { item.ReadMoreLinkLabel = "Read more..."; item.ReadMoreLinkHint = "Read more about " + item.Header.ToLower(); } return(item); }
/// <summary> /// This method creates a new updated version of a locale specific view model for presentations. /// </summary> /// <param name="baseUrl"></param> /// <param name="localeIsoCode"></param> /// <returns></returns> private static AboutViewModel CreateAboutPresentationFormatViewModel(string baseUrl, string localeIsoCode) { AboutViewModel model = new AboutViewModel(); AboutItem item = null; string html = GetPageAsText(baseUrl + Resource.AboutUrlFormat); if (html.IsNotEmpty()) { model.TitleLabel = GetTitleLabelFromHtml(html); model.Description = GetDescriptionFromHtml(html); model.Items = new List <AboutItem>(); //item = createAboutItem(baseUrl + LOCAL_URL_PRESENTATION_MAP, localeIsoCode); //if (item.Header.IsNotEmpty()) //{ // model.Items.Add(item); //} //item = createAboutItem(baseUrl + LOCAL_URL_PRESENTATION_DIAGRAM, localeIsoCode); //if (item.Header.IsNotEmpty()) //{ // model.Items.Add(item); //} item = CreateAboutItem(baseUrl + Resource.AboutUrlFormatTableColumns, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } //item = createAboutItem(baseUrl + LOCAL_URL_PRESENTATION_REPORT, localeIsoCode); //if (item.Header.IsNotEmpty()) //{ // model.Items.Add(item); //} } return(model); }
/// <summary> /// This method creates a new updated version of a locale specific view model for Data sources. /// </summary> /// <param name="baseUrl"></param> /// <param name="localeIsoCode"></param> /// <returns></returns> private static AboutViewModel CreateAboutDataProvidersViewModel(string baseUrl, string localeIsoCode) { AboutViewModel model = new AboutViewModel(); AboutItem item = null; string html = GetPageAsText(baseUrl + Resource.AboutUrlData); if (html.IsNotEmpty()) { model.TitleLabel = GetTitleLabelFromHtml(html); model.Description = GetDescriptionFromHtml(html); model.Items = new List <AboutItem>(); item = CreateAboutItem(baseUrl + Resource.AboutUrlDataSpeciesObservations, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlDataEnvironmentalData, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlDataMapLayers, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } item = CreateAboutItem(baseUrl + Resource.AboutUrlDataMetadata, localeIsoCode); if (item.Header.IsNotEmpty()) { model.Items.Add(item); } } return(model); }
public About(Guid id, AboutItem aboutItem, string value) { this.Id = id; this.AboutItem = aboutItem; this.AboutValue = value; }