private void Header_Set() { string date_str = Get.Name_Of_Day_In_Week((int)DateTime.Now.DayOfWeek) + ", " + DateTime.Now.Day + ". " + Get.Name_Of_Month(DateTime.Now.Month) + " " + DateTime.Now.Year + "."; if (Memory.Hijri_Date_In_App) { date_str += " / " + HijriDate.Get(DateTime.Now).day + ". " + Get.Name_Of_Month_Hijri(HijriDate.Get(DateTime.Now).month) + " " + HijriDate.Get(DateTime.Now).year + "."; } if (!Memory.Date_Show_In_App) { date_str = ""; } Set.PageHeader(this, header_Grid, date_str.ToLower(), Memory.location.ime.ToLower(), "ChooseLocation"); }
public WordOfTheDayDto GetWordOfTheDay() { List <WordOfTheDayDto> wordOfTheDays = new (); var hijriDate = HijriDate.GetHijriDate(); wordOfTheDays.Add(new WordOfTheDayDto { Day = 1, Arabic = "ذلك", Meaning = "that, which or that one", Transliteration = "dhâlika", TypeOfWord = "noun", QuranArabic = "ذَٰلِكَ الْكِتَابُ لَا رَيْبَ ۛ فِيهِ ۛ هُدًى لِّلْمُتَّقِينَ", QuranEnglish = "\"That is the Book! There is no doubt about it — a guide for those mindful of Allah.\" (al-Baqarah 2:2)", HijriDate = hijriDate }); return(wordOfTheDays[0]); }
public void RaisePostBackEvent(string eventArgument) { if (eventArgument == "Prev") { HijriDate d = new HijriDate(VisibleDate); if (d.Month > 1) { d.Month -= 1; } else { d.Month = 12; d.Year -= 1; } VisibleDate = d.GDate; } else if (eventArgument == "Next") { HijriDate d = new HijriDate(VisibleDate); if (d.Month < 12) { d.Month += 1; } else { d.Month = 1; d.Year += 1; } VisibleDate = d.GDate; } else { SelectedDate = (new HijriDate(Int32.Parse(eventArgument))).GDate; } OnClick(EventArgs.Empty); }
/// <summary> /// Render this control to the output parameter specified. /// </summary> /// <param name="output"> The HTML writer to write out to </param> protected override void Render(HtmlTextWriter output) { HijriDate date; if (VisibleDate.ToShortDateString().Length > 0) { date = new HijriDate(VisibleDate); } else { date = new HijriDate(); } // TABLE START output.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID); output.AddAttribute("dir", "rtl"); output.AddAttribute(HtmlTextWriterAttribute.Cellpadding, cellPadding.ToString(), true); output.AddAttribute(HtmlTextWriterAttribute.Cellspacing, cellSpacing.ToString(), true); AddAttributesToRender(output); output.RenderBeginTag(HtmlTextWriterTag.Table); output.WriteLine(); if (showTitle) // First Row (Title) { output.RenderBeginTag(HtmlTextWriterTag.Tr); output.AddAttribute(HtmlTextWriterAttribute.Colspan, "7", false); titleStyle.AddAttributesToRender(output); output.RenderBeginTag(HtmlTextWriterTag.Td); output.WriteLine(); if (true) // Title Table { output.AddAttribute(HtmlTextWriterAttribute.Width, "100%", false); output.RenderBeginTag(HtmlTextWriterTag.Table); output.WriteLine(); output.RenderBeginTag(HtmlTextWriterTag.Tr); if (showNextPrevMonth) // Previous { nextPrevStyle.AddAttributesToRender(output); output.AddAttribute(HtmlTextWriterAttribute.Align, "right", false); output.AddAttribute(HtmlTextWriterAttribute.Width, "15%", false); output.RenderBeginTag(HtmlTextWriterTag.Td); output.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:" + Page.GetPostBackEventReference(this, "Prev"), true); nextPrevStyle.AddAttributesToRender(output); output.RenderBeginTag(HtmlTextWriterTag.A); switch (nextPrevFormat) { case NextPrevFormat.CustomText: output.Write(prevMonthText); break; default: output.Write(HijriDate.FarsiMonthNames[date.Month > 1?date.Month - 2:11]); break; } output.RenderEndTag(); // A output.RenderEndTag(); output.WriteLine(); } // Previous output.AddAttribute(HtmlTextWriterAttribute.Width, "70%", false); output.AddAttribute(HtmlTextWriterAttribute.Align, "middle", false); output.RenderBeginTag(HtmlTextWriterTag.Td); output.Write(HijriDate.FarsiMonthNames[date.Month - 1]); if (titleFormat == System.Web.UI.WebControls.TitleFormat.MonthYear) { output.Write(" " + date.Year.ToString()); } if (ViewState["test"] != null) { output.Write(ViewState["test"]); } output.RenderEndTag(); output.WriteLine(); if (showNextPrevMonth) // Next { nextPrevStyle.AddAttributesToRender(output); output.AddAttribute(HtmlTextWriterAttribute.Align, "left", false); output.AddAttribute(HtmlTextWriterAttribute.Width, "15%", false); output.RenderBeginTag(HtmlTextWriterTag.Td); nextPrevStyle.AddAttributesToRender(output); output.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:" + Page.GetPostBackEventReference(this, "Next"), true); output.RenderBeginTag(HtmlTextWriterTag.A); switch (nextPrevFormat) { case NextPrevFormat.CustomText: output.Write(nextMonthText); break; default: output.Write(HijriDate.FarsiMonthNames[date.Month < 12?date.Month:0]); break; } output.RenderEndTag(); // A output.RenderEndTag(); output.WriteLine(); } // Next output.RenderEndTag(); // Tr output.RenderEndTag(); // Table output.WriteLine(); } output.RenderEndTag(); // td output.RenderEndTag(); // tr output.WriteLine(); } if (showDayHeader) // Day Header Row { output.RenderBeginTag(HtmlTextWriterTag.Tr); for (int i = 0; i < 7; i++) { dayHeaderStyle.AddAttributesToRender(output); output.AddAttribute(HtmlTextWriterAttribute.Align, "middle", false); output.AddAttribute(HtmlTextWriterAttribute.Nowrap, "true", false); output.RenderBeginTag(HtmlTextWriterTag.Td); if (dayNameFormat == DayNameFormat.Full) { output.Write(HijriDate.FarsiDayNamesFull[i]); } else { output.Write(HijriDate.FarsiDayNamesShort[i]); } output.RenderEndTag(); // td } output.RenderEndTag(); // tr output.WriteLine(); } // Day Names Row if (true) // Day Counter { HijriDate firstDayOfMonth = new HijriDate(date); firstDayOfMonth.Day = 1; int DayCounter = -firstDayOfMonth.DayOfWeek; int MaxDayCounter = (int)HijriDate.DaysInMonth(firstDayOfMonth.Year, firstDayOfMonth.Month); while (DayCounter < MaxDayCounter) { output.RenderBeginTag(HtmlTextWriterTag.Tr); for (int d = 0; d < 7; d++) { DayCounter++; if (SelectedDate.ToShortDateString() == (new HijriDate(firstDayOfMonth.Year, firstDayOfMonth.Month, DayCounter).GDate.ToShortDateString())) { selectedDayStyle.AddAttributesToRender(output); } else if (System.DateTime.Today.ToShortDateString() == (new HijriDate(firstDayOfMonth.Year, firstDayOfMonth.Month, DayCounter).GDate.ToShortDateString())) { todayDayStyle.AddAttributesToRender(output); } else { dayStyle.AddAttributesToRender(output); } output.AddAttribute(HtmlTextWriterAttribute.Align, "middle", false); output.RenderBeginTag(HtmlTextWriterTag.Td); if (DayCounter > 0 && DayCounter <= MaxDayCounter) { if (dayStyle.ForeColor.IsEmpty) { output.AddStyleAttribute(HtmlTextWriterStyle.Color, ForeColor.Name); } else { output.AddStyleAttribute(HtmlTextWriterStyle.Color, dayStyle.ForeColor.Name); } output.AddAttribute(HtmlTextWriterAttribute.Href, "javascript:" + Page.GetPostBackEventReference(this, (firstDayOfMonth.GetHashCode() + DayCounter - 1).ToString()), true); output.RenderBeginTag(HtmlTextWriterTag.A); output.Write(DayCounter.ToString()); output.RenderEndTag(); } else { output.Write(" "); } output.RenderEndTag(); } output.RenderEndTag(); } } // Day Counter if (RegisterString != "D19D18D8") { output.RenderBeginTag(HtmlTextWriterTag.Tr); output.AddAttribute(HtmlTextWriterAttribute.Colspan, "7", false); output.AddAttribute(HtmlTextWriterAttribute.Align, "left", false); output.RenderBeginTag(HtmlTextWriterTag.Td); output.AddAttribute(HtmlTextWriterAttribute.Size, "-2", false); output.RenderBeginTag(HtmlTextWriterTag.Font); output.RenderBeginTag(HtmlTextWriterTag.I); output.Write("Unregistered version, (C) copyright 2005 "); output.AddAttribute(HtmlTextWriterAttribute.Href, "mailto:[email protected]", true); output.RenderBeginTag(HtmlTextWriterTag.A); output.Write("Ehsan Tabari"); output.RenderEndTag(); // A output.RenderEndTag(); // I output.RenderEndTag(); // Font output.RenderEndTag(); // Td output.RenderEndTag(); // Tr } output.RenderEndTag(); // Table }
private void Make_Calendar() { Grid mainGrid = new Grid { HorizontalAlignment = HorizontalAlignment.Stretch, MaxWidth = 720, Background = new SolidColorBrush(Color.FromArgb(255, 31, 31, 31)), }; if (!Fixed.IsDarkTheme) { mainGrid.Background = new SolidColorBrush(Color.FromArgb(255, 244, 244, 244)); } mainGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); mainGrid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Auto) }); mainGrid.RowDefinitions.Add(new RowDefinition()); #region Hide dialog button ListViewItem hideLVI = new ListViewItem { HorizontalAlignment = HorizontalAlignment.Stretch, HorizontalContentAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, VerticalContentAlignment = VerticalAlignment.Stretch, MinHeight = 0, MinWidth = 0, Background = null, Padding = new Thickness(0), Margin = new Thickness(0), BorderBrush = new SolidColorBrush(Color.FromArgb(31, 0, 0, 0)), BorderThickness = new Thickness(1), }; hideLVI.SetValue(Grid.RowProperty, 0); mainGrid.Children.Add(hideLVI); TextBlock hideTB = new TextBlock { HorizontalAlignment = HorizontalAlignment.Center, FontSize = 18, FontFamily = new FontFamily("Segoe UI Symbol"), Text = "", VerticalAlignment = VerticalAlignment.Center, }; hideLVI.Content = hideTB; hideLVI.Tapped += (s, e) => { Hide_Calendar(); }; #region Manipulation calendar_Grid.ManipulationMode = ManipulationModes.TranslateY; calendar_Grid.ManipulationDelta += (s, e) => { calendarCT.TranslateY += e.Delta.Translation.Y; if (calendarCT.TranslateY < 0) { calendarCT.TranslateY = 0; } if (calendarCT.TranslateY > 50) { hideTB.Text = ""; } else { hideTB.Text = ""; } }; calendar_Grid.ManipulationCompleted += (s, e) => { if (calendarCT.TranslateY > 50) { Hide_Calendar(); } else { calendarCT.TranslateY = 0; } hideTB.Text = ""; }; #endregion #endregion #region Setup panel var panel = new StackPanel { Margin = new Thickness(12), }; panel.SetValue(Grid.RowProperty, 1); mainGrid.Children.Add(panel); StackPanel headerSp = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center }; DatePicker dp = new DatePicker { Margin = new Thickness(0, 12, 0, 0), Header = "Vaktija za datum:", Date = DateTime.Now, HorizontalAlignment = HorizontalAlignment.Center, }; headerSp.Children.Add(dp); TextBlock hijriTB = new TextBlock { Margin = new Thickness(12), FontSize = 20, Text = "", HorizontalAlignment = HorizontalAlignment.Left, }; headerSp.Children.Add(hijriTB); panel.Children.Add(headerSp); #endregion #region Content panel Grid content_Grid = new Grid(); content_Grid.RowDefinitions.Add(new RowDefinition()); content_Grid.RowDefinitions.Add(new RowDefinition()); content_Grid.RowDefinitions.Add(new RowDefinition()); content_Grid.RowDefinitions.Add(new RowDefinition()); content_Grid.RowDefinitions.Add(new RowDefinition()); content_Grid.RowDefinitions.Add(new RowDefinition()); content_Grid.SetValue(Grid.RowProperty, 2); mainGrid.Children.Add(content_Grid); #endregion #region Events dp.DateChanged += (s, args) => { DateTime dttt = new DateTime(dp.Date.Year, dp.Date.Month, dp.Date.Day); Show_Special_Prayers_For_Custom_Date(content_Grid, dttt); hijriTB.Text = Get.Name_Of_Day_In_Week((int)dttt.DayOfWeek).ToLower() + ", " + HijriDate.Get(dttt).day + ". " + Get.Name_Of_Month_Hijri(HijriDate.Get(dttt).month) + " " + HijriDate.Get(dttt).year + "."; }; #endregion #region Show dialog Show_Special_Prayers_For_Custom_Date(content_Grid, DateTime.Now); hijriTB.Text = Get.Name_Of_Day_In_Week((int)DateTime.Now.DayOfWeek).ToLower() + ", " + HijriDate.Get(DateTime.Now).day + ". " + Get.Name_Of_Month_Hijri(HijriDate.Get(DateTime.Now).month) + " " + HijriDate.Get(DateTime.Now).year + "."; Show_Calendar(mainGrid); #endregion }
private void ShareTextHandler(DataTransferManager sender, DataRequestedEventArgs e) { DataRequest request = e.Request; DateTime dt = DateTime.Now; request.Data.Properties.Title = "Vaktija za " + Memory.location.ime.Replace("ž", "z").Replace("ć", "c").Replace("č", "c").Replace("š", "s").Replace("đ", "dj").Replace("Ž", "Z").Replace("Ć", "C").Replace("Č", "C").Replace("Š", "S").Replace("Đ", "Dj"); string desc = dt.Day + ". " + Get.Name_Of_Month(dt.Month) + " " + dt.Year + "." + "\n" + HijriDate.Get(dt).day + ". " + Get.Name_Of_Month_Hijri(HijriDate.Get(dt).month) + " " + HijriDate.Get(dt).year + "."; Day dan = Year.year.months[dt.Month - 1].days[dt.Day - 1]; string content_string = desc; foreach (var it in dan.vakti) { content_string += "\n" + it.time.ToString("HH:mm") + " " + it.name; } content_string += "\n" + "https://www.vaktija.ba"; content_string = content_string.Replace("ž", "z").Replace("ć", "c").Replace("č", "c").Replace("š", "s").Replace("đ", "dj").Replace("Ž", "Z").Replace("Ć", "C").Replace("Č", "C").Replace("Š", "S").Replace("Đ", "Dj").Replace("Izlazak Sunca", "Izl Sunca"); request.Data.SetText(content_string.ToLower()); }