private void ValidateInfo() { if (textBox1.Text.Length == 0) { button1.Enabled = false; label3.Text = GPStrings.getString(285); label3.ForeColor = Color.Red; } else if (GPCountryList.getShared().ExistsCode(textBox1.Text) && textBox1.Text != ValidCode) { button1.Enabled = false; label3.Text = GPStrings.getString(286); label3.ForeColor = Color.Red; } else { button1.Enabled = true; label3.Text = GPStrings.getString(288); label3.ForeColor = Color.Green; } if (textBox2.Text.Length == 0) { button1.Enabled = false; label4.Text = GPStrings.getString(287); label4.ForeColor = Color.Red; } else { label4.Text = GPStrings.getString(288); label4.ForeColor = Color.Green; } }
public void SetUserInterfaceStrings() { this.button1.Text = GPStrings.getString(236); this.button2.Text = GPStrings.getString(237); this.label1.Text = GPStrings.getString(267); this.Text = GPStrings.getString(268); }
public void SetUserInterfaceStrings() { this.toolStripMenuItem1.Text = GPStrings.getString(337); this.saveAsToolStripMenuItem.Text = GPStrings.getString(362); this.printToolStripMenuItem.Text = GPStrings.getString(363); this.editToolStripMenuItem.Text = GPStrings.getString(338); this.selectAllToolStripMenuItem.Text = GPStrings.getString(364); this.copyToolStripMenuItem.Text = GPStrings.getString(365); this.viewToolStripMenuItem.Text = GPStrings.getString(339); this.increaseTextSizeToolStripMenuItem.Text = GPStrings.getString(366); this.toolStripButton4.Text = GPStrings.getString(366); this.decreaseTextSizeToolStripMenuItem.Text = GPStrings.getString(367); this.toolStripButton5.Text = GPStrings.getString(367); this.navigateToolStripMenuItem.Text = GPStrings.getString(368); this.previousDayToolStripMenuItem.Text = GPStrings.getString(369); this.toolStripButton1.ToolTipText = GPStrings.getString(369); this.todayToolStripMenuItem.Text = GPStrings.getString(43); this.toolStripButton3.ToolTipText = GPStrings.getString(371); this.nextDayToolStripMenuItem.Text = GPStrings.getString(370); this.toolStripButton2.ToolTipText = GPStrings.getString(370); this.settingsToolStripMenuItem.Text = GPStrings.getString(372); this.myLocationToolStripMenuItem.Text = GPStrings.getString(373); this.displaySettingsToolStripMenuItem.Text = GPStrings.getString(374); this.windowAutosizeToolStripMenuItem.Text = GPStrings.getString(375); this.visibleAtLaunchToolStripMenuItem.Text = GPStrings.getString(376); this.toolStripMenuItem3.Text = GPStrings.getString(377); this.Text = GPStrings.getString(43); }
public void SetUserInterfaceStrings() { this.button3.Text = GPStrings.getString(237); this.button2.Text = GPStrings.getString(239); this.button1.Text = GPStrings.getString(238); this.label1.Text = GPStrings.getString(304); this.Text = GPStrings.getString(304); }
private void StartForm_FormClosing(object sender, FormClosingEventArgs e) { GPStrings.getSharedStrings().Save(); GPLocationList.getShared().Save(); GPEventList.getShared().Save(); GPCountryList.getShared().Save(); GPTimeZoneList.sharedTimeZones().Save(); GPLocationProvider.SaveRecent(); }
public void SetUserInterfaceStrings() { this.button1.Text = GPStrings.getString(236); this.button2.Text = GPStrings.getString(237); this.label1.Text = GPStrings.getString(296); // "Date of transition"; this.label2.Text = GPStrings.getString(297); // "Time for transition"; this.label3.Text = GPStrings.getString(298); // "New timezone offset (in minutes)"; this.label4.Text = GPStrings.getString(299); // "Abbreviation for given timezone offset"; this.checkBox1.Text = GPStrings.getString(300); // "DST is in effect after this transition"; this.Text = GPStrings.getString(301); // "Timezone Transition Details"; }
private void editTranslationToolStripMenuItem_Click(object sender, EventArgs e) { DialogEditString des = new DialogEditString(ContentServer.currentEditButtonStringIndex); if (des.ShowDialog() == DialogResult.OK) { GPStrings.getSharedStrings().setString(ContentServer.currentEditButtonStringIndex, des.getNewText()); GPStrings.getSharedStrings().Modified = true; content.LoadPage(content.CurrentPage.Name, false); } }
public AboutForm() { InitializeComponent(); this.Text = GPStrings.getString(462); label6.Text = GPAppHelper.getLongVersionText(); label1.Text = GPStrings.getString(463); label2.Text = GPStrings.getString(464); label3.Text = GPStrings.getString(465); label4.Text = GPStrings.getString(466); }
public void SetUserInterfaceStrings() { this.button1.Text = GPStrings.getString(236); this.button2.Text = GPStrings.getString(237); this.label1.Text = GPStrings.getString(9); this.label2.Text = GPStrings.getString(10); this.label3.Text = GPStrings.getString(11); this.label4.Text = GPStrings.getString(252); this.labelMessage.Text = GPStrings.getString(270); this.label5.Text = GPStrings.getString(12); this.Text = GPStrings.getString(269); }
public void ValidateInfo() { double d; if (LocationName.Length == 0) { labelMessage.Text = GPStrings.getString(295); labelMessage.ForeColor = Color.Red; button1.Enabled = false; } else if (Latitude.Length == 0) { labelMessage.Text = GPStrings.getString(294); labelMessage.ForeColor = Color.Red; button1.Enabled = false; } else if (Longitude.Length == 0) { labelMessage.Text = GPStrings.getString(293); labelMessage.ForeColor = Color.Red; button1.Enabled = false; } else if (Country == null) { labelMessage.Text = GPStrings.getString(292); labelMessage.ForeColor = Color.Red; button1.Enabled = false; } else if (TimeZone == null) { labelMessage.Text = GPStrings.getString(291); labelMessage.ForeColor = Color.Red; button1.Enabled = false; } else if (!GPLocation.ConvertStringToCoordinate(Latitude, out d)) { labelMessage.Text = GPStrings.getString(290); labelMessage.ForeColor = Color.Orange; button1.Enabled = false; } else if (!GPLocation.ConvertStringToCoordinate(Longitude, out d)) { labelMessage.Text = GPStrings.getString(289); labelMessage.ForeColor = Color.Orange; button1.Enabled = false; } else { labelMessage.Text = GPStrings.getString(288); labelMessage.ForeColor = Color.Green; button1.Enabled = true; } }
public void SetUserInterfaceStrings() { this.checkBox1.Text = GPStrings.getString(279); this.label7.Text = GPStrings.getString(280); this.label6.Text = GPStrings.getString(277); this.label5.Text = GPStrings.getString(276); this.label4.Text = GPStrings.getString(275); this.label3.Text = GPStrings.getString(281); this.label2.Text = GPStrings.getString(56); this.label1.Text = GPStrings.getString(278); this.button2.Text = GPStrings.getString(237); this.button1.Text = GPStrings.getString(236); this.Text = GPStrings.getString(273); }
public void SetUserInterfaceStrings() { this.groupBox1.Text = GPStrings.getString(258); this.radioButton7.Text = GPStrings.getString(266); this.radioButton6.Text = GPStrings.getString(265); this.radioButton5.Text = GPStrings.getString(264); this.radioButton4.Text = GPStrings.getString(32); this.radioButton3.Text = GPStrings.getString(31); this.radioButton2.Text = GPStrings.getString(263); this.radioButton1.Text = GPStrings.getString(30); this.label1.Text = GPStrings.getString(259); this.groupBox2.Text = GPStrings.getString(260); this.label5.Text = GPStrings.getString(262); this.label2.Text = GPStrings.getString(261); }
public void SetUserInterfaceStrings() { this.label1.Text = GPStrings.getString(240); this.label2.Text = GPStrings.getString(241); this.groupBox1.Text = GPStrings.getString(242); this.linkLabel5.Text = GPStrings.getString(243); this.linkLabel4.Text = GPStrings.getString(244); this.linkLabel3.Text = GPStrings.getString(245); this.linkLabel2.Text = GPStrings.getString(246); this.linkLabel1.Text = GPStrings.getString(43); this.label3.Text = string.Format("{0} / {1}", GPStrings.getString(13), GPStrings.getString(20)); this.label4.Text = GPStrings.getString(22); this.label5.Text = GPStrings.getString(55); this.label6.Text = GPStrings.getString(247); this.label7.Text = GPStrings.getString(248); this.label8.Text = GPStrings.getString(55); }
public void showPrintMenu() { foreach (ToolStripMenuItem item in contextMenuStrip2.Items) { if (item.Tag != null) { string tag = item.Tag.ToString(); if (tag.StartsWith("gstr:")) { int index = 0; if (int.TryParse(tag.Substring(5), out index)) { item.Text = GPStrings.getPlainString(index); } } } } contextMenuStrip2.Show(Cursor.Position); }
public string getNextFestDaysString() { StringBuilder sb = new StringBuilder(); sb.Append("<table cellpadding=12 cellspacing=0 border=0 width=95%>"); sb.AppendFormat("<tr><td class='hed'>{0}</td>", GPStrings.getString(452)); sb.AppendFormat("<td class='hed2'>{0}: {1}</td></tr>", GPStrings.getString(9), loc.getFullName()); sb.Append("</td>"); sb.Append("<table cellpadding=12 cellspacing=0 border=0 width=95%>"); int ic = 0; bool rowStarted = false; foreach (GPStringPair dr in lines) { if (dr.Name.Length > 0) { if (rowStarted) { sb.AppendLine("</td></tr>"); } if (ic % 2 == 0) { sb.Append("<tr class='evenLine'>"); } else { sb.Append("<tr>"); } ic++; sb.AppendFormat("<td><span style='font-weight:bold'>{0}</span><br>", dr.Name); rowStarted = true; } sb.AppendFormat(" {0}<br>", dr.Value); } if (rowStarted) { sb.AppendLine("</td></tr>"); } sb.Append("</table>"); return(sb.ToString()); }
private void InitUserInterface() { checkBox35.Text = GPEventClass.getName(0); checkBox36.Text = GPEventClass.getName(1); checkBox37.Text = GPEventClass.getName(2); checkBox38.Text = GPEventClass.getName(3); checkBox39.Text = GPEventClass.getName(4); checkBox40.Text = GPEventClass.getName(5); checkBox41.Text = GPEventClass.getName(6); for (int i = 0; i < 13; i++) { checkedListBox1.Items.Add(GPMasa.GetName(i), GPDisplays.MasaList.MasaVisible(i)); } for (int i = 0; i < 7; i++) { comboBox4.Items.Add(GPStrings.getString(i)); } }
public void SetUserInterfaceStrings() { this.tabPage1.Text = GPStrings.getString(249); this.label1.Text = GPStrings.getString(250); this.columnHeader1.Text = GPStrings.getString(251); this.columnHeader2.Text = GPStrings.getString(253); this.columnHeader3.Text = GPStrings.getString(10); this.columnHeader4.Text = GPStrings.getString(11); this.columnHeader5.Text = GPStrings.getString(12); this.tabPage2.Text = GPStrings.getString(256); this.label7.Text = GPStrings.getString(257); this.label6.Text = GPStrings.getString(12); this.label5.Text = GPStrings.getString(10); this.label4.Text = GPStrings.getString(11); this.label3.Text = GPStrings.getString(253); this.label2.Text = GPStrings.getString(9); if (wizardDelegate != null) { wizardDelegate.EnableNext(false); } }
public void SetUserInterfaceStrings() { this.tabPage5.Text = GPStrings.getString(174); this.checkBox32.Text = GPStrings.getString(175); this.checkBox31.Text = GPStrings.getString(176); this.checkBox9.Text = GPStrings.getString(1006); this.checkBox8.Text = GPStrings.getString(991); this.checkBox7.Text = GPStrings.getString(177); this.checkBox6.Text = GPStrings.getString(178); this.checkBox5.Text = GPStrings.getString(179); this.checkBox4.Text = GPStrings.getString(180); this.checkBox3.Text = GPStrings.getString(181); this.checkBox2.Text = GPStrings.getString(182); this.tabPage1.Text = GPStrings.getString(45); this.label1.Text = GPStrings.getString(183); this.checkBox1.Text = GPStrings.getString(184); this.tabPage2.Text = GPStrings.getString(44); this.tabPage7.Text = GPStrings.getString(185); this.tabPage8.Text = GPStrings.getString(186); this.checkBox22.Text = GPStrings.getString(187); this.checkBox48.Text = GPStrings.getString(991); this.label2.Text = GPStrings.getString(188); // "Header Type"; this.checkBox47.Text = GPStrings.getString(189); // "Paksa Info"; this.label3.Text = GPStrings.getString(196); // "Anniversary Info"; this.checkBox46.Text = GPStrings.getString(197); // "Fasting Flag"; this.comboBox2.Items.AddRange(new object[] { GPStrings.getString(198), GPStrings.getString(199), GPStrings.getString(200) }); this.checkBox45.Text = GPStrings.getString(190); // "Yoga Info"; this.checkBox43.Text = GPStrings.getString(191); // "DST Change Info"; this.checkBox44.Text = GPStrings.getString(192); //"Naksatra Info"; this.checkBox34.Text = GPStrings.getString(193); // "Masa Start Info"; this.checkBox30.Text = GPStrings.getString(194); // "Ekadashi Info"; this.checkBox29.Text = GPStrings.getString(195); // "Sankranti Info"; this.checkBox33.Text = GPStrings.getString(201); this.comboBox1.Items.AddRange(new object[] { GPStrings.getString(202), GPStrings.getString(203), GPStrings.getString(204) }); this.checkBox49.Text = GPStrings.getString(205); this.tabPage9.Text = GPStrings.getString(206); this.checkBox16.Text = GPStrings.getString(207); this.checkBox17.Text = GPStrings.getString(208); this.checkBox18.Text = GPStrings.getString(51); this.checkBox19.Text = GPStrings.getString(52); this.checkBox20.Text = GPStrings.getString(53); this.checkBox21.Text = GPStrings.getString(54); this.checkBox23.Text = GPStrings.getString(209); this.checkBox24.Text = GPStrings.getString(210); this.checkBox25.Text = GPStrings.getString(100); this.checkBox26.Text = GPStrings.getString(101); this.checkBox27.Text = GPStrings.getString(102); this.checkBox42.Text = GPStrings.getString(181); this.checkBox28.Text = GPStrings.getString(103); this.tabPage3.Text = GPStrings.getString(46); this.checkBox15.Text = GPStrings.getString(211); this.checkBox14.Text = GPStrings.getString(999); this.checkBox13.Text = GPStrings.getString(1000); this.checkBox12.Text = GPStrings.getString(998); this.checkBox11.Text = GPStrings.getString(997); this.checkBox10.Text = GPStrings.getString(996); this.tabPage4.Text = GPStrings.getString(48); this.tabPage6.Text = GPStrings.getString(212); this.comboBox7.Items.AddRange(new object[] { GPStrings.getString(213), GPStrings.getString(214), GPStrings.getString(215), GPStrings.getString(216) }); this.label8.Text = GPStrings.getString(217); this.comboBox6.Items.AddRange(new object[] { GPStrings.getString(218), GPStrings.getString(219), GPStrings.getString(220), GPStrings.getString(221) }); this.label7.Text = GPStrings.getString(222); this.comboBox5.Items.AddRange(new object[] { GPStrings.getString(223), GPStrings.getString(224) }); this.label6.Text = GPStrings.getString(225); this.label5.Text = GPStrings.getString(226); this.label4.Text = GPStrings.getString(227); this.comboBox3.Items.AddRange(new object[] { GPStrings.getString(228), GPStrings.getString(229), GPStrings.getString(230), GPStrings.getString(231) }); this.button1.Text = GPStrings.getString(236); this.button2.Text = GPStrings.getString(237); this.label9.Text = GPStrings.getString(232); this.comboBox8.Items.AddRange(new object[] { GPStrings.getString(233), GPStrings.getString(234) }); this.Text = GPStrings.getString(235); }
public void setStringIndex(int index) { label1.Text = String.Format("Original English Text [{0}]", index); label2.Text = GPStrings.getOriginalString(index); textBox1.Text = GPStrings.getPlainString(index); }
protected override void Execute() { ResultsList.Clear(); //ClearControlList(); int limit; if (Location == null || p_text == null || p_text.Length == 0) { return; } // find in texts StringBuilder sb = new StringBuilder(); Results res = new Results(this, p_text); GPGregorianTime vc = new GPGregorianTime(Location); vc.Today(); // // today results (this day, tomorrow and day after // #region today screen results limit = GPUserDefaults.IntForKey("search.today.days", 3); for (int i = 0; i < limit; i++) { sb.Remove(0, sb.Length); FormaterPlain.AvcGetTodayInfo(vc, Location, sb); res.Title = GPAppHelper.getDateText(vc); res.Type = GPStrings.getString(174); res.ScanText(p_text, sb); if (res.Lines.Count > 0) { res.Operation = GPCalculationOperation.Today; res.Parameters.Add(GPCalculationParameters.LocationProvider, Location); res.Parameters.Add(GPCalculationParameters.StartWesternDate, vc.Copy()); res.ActionScript += string.Format("scriptObject.setMyDate({0},{1},{2});", vc.getYear(), vc.getMonth(), vc.getDay()); res.ActionScript += "window.location.href='today.html'"; ResultsList.Add(res); res = new Results(this, p_text); } vc.NextDay(); } // move results to control if (!ShouldCancel) { FlushResultsToControl(); } #endregion #region calendar results limit = GPUserDefaults.IntForKey("search.calendar.months", 12); GPCalendarResults rcal = new GPCalendarResults(); vc.Today(); vc.AddDays(1 - vc.getDay()); for (int i = 0; i < limit; i++) { rcal.CalculateCalendar(vc, GPGregorianTime.GetMonthMaxDays(vc.getYear(), vc.getMonth())); FormaterPlain.FormatCalendarPlain(rcal, sb); res.Title = string.Format("{0} {1}", GPStrings.getString(759 + vc.getMonth()), vc.getYear()); res.Type = GPStrings.getString(44); res.ScanText(p_text, sb); if (res.Lines.Count > 0) { res.Operation = GPCalculationOperation.Calendar; res.Parameters.Add(GPCalculationParameters.LocationProvider, Location); res.Parameters.Add(GPCalculationParameters.StartWesternDate, vc.Copy()); GPGregorianTime vc2 = vc.Copy(); vc2.AddMonths(1); res.Parameters.Add(GPCalculationParameters.EndWesternDate, vc2); res.ActionScript += "saveString('locationtype', 'mylocation');"; res.ActionScript += "saveString('startyear', '" + vc.getYear() + "');"; res.ActionScript += "saveString('startmonth', '" + vc.getMonth() + "');"; res.ActionScript += "saveString('startday', '" + vc.getDay() + "');"; res.ActionScript += "saveString('endperiodtype', '3');"; res.ActionScript += "saveString('endperiodlength', '1');"; res.ActionScript += "window.location.href='calendar.html'"; ResultsList.Add(res); res = new Results(this, p_text); } vc.AddMonths(1); } // move results to control if (!ShouldCancel) { FlushResultsToControl(); } #endregion #region core events results limit = GPUserDefaults.IntForKey("search.coreevents.months", 1); GPCoreEventResults reve = new GPCoreEventResults(); vc.Today(); vc.AddDays(1 - vc.getDay()); for (int i = 0; i < limit; i++) { sb.Remove(0, sb.Length); GPGregorianTime vcEnd = vc.Copy(); vcEnd.AddDays(31); reve.CalculateEvents(Location, vc, vcEnd); FormaterPlain.FormatEventsText(reve, sb); res.Title = string.Format("{0} {1}", GPStrings.getString(759 + vc.getMonth()), vc.getYear()); res.Type = GPStrings.getString(46); res.ScanText(p_text, sb); if (res.Lines.Count > 0) { res.Operation = GPCalculationOperation.CoreEvents; res.Parameters.Add(GPCalculationParameters.LocationProvider, Location); res.Parameters.Add(GPCalculationParameters.StartWesternDate, vc.Copy()); res.Parameters.Add(GPCalculationParameters.EndWesternDate, vcEnd); res.ActionScript += "saveString('locationtype', 'mylocation');"; res.ActionScript += "saveString('startyear', '" + vc.getYear() + "');"; res.ActionScript += "saveString('startmonth', '" + vc.getMonth() + "');"; res.ActionScript += "saveString('startday', '" + vc.getDay() + "');"; res.ActionScript += "saveString('endperiodtype', '3');"; res.ActionScript += "saveString('endperiodlength', '1');"; res.ActionScript += "window.location.href='coreevents.html'"; ResultsList.Add(res); res = new Results(this, p_text); } vc.AddMonths(1); } // move results to control if (!ShouldCancel) { FlushResultsToControl(); } #endregion #region masa list limit = GPUserDefaults.IntForKey("search.masalist.years", 3); GPMasaListResults rmas = new GPMasaListResults(); vc.Today(); for (int i = 0; i < limit; i++) { sb.Remove(0, sb.Length); rmas.CalcMasaList(Location, vc.getYear(), 1); FormaterPlain.FormatMasaListText(rmas, sb); res.Title = string.Format("{0}", vc.getYear()); res.Type = GPStrings.getString(48); res.ScanText(p_text, sb); if (res.Lines.Count > 0) { res.Operation = GPCalculationOperation.MasaList; res.Parameters.Add(GPCalculationParameters.LocationProvider, Location); res.Parameters.Add(GPCalculationParameters.StartYear, vc.getYear()); res.Parameters.Add(GPCalculationParameters.CountYear, 1); res.ActionScript += "saveString('locationtype', 'mylocation');"; res.ActionScript += "saveString('startyear', '" + vc.getYear() + "');"; res.ActionScript += "saveString('yearcount', '1');"; res.ActionScript += "window.location.href='masalist.html'"; ResultsList.Add(res); res = new Results(this, p_text); } vc.AddYears(1); } // move results to control if (!ShouldCancel) { FlushResultsToControl(); } #endregion finished = true; }
private void button1_Click(object sender, EventArgs e) { GPLocation loc; content.findLocations("Bratislava"); loc = content.getLocation(0); GPLocationProvider provider = new GPLocationProvider(loc); int nCount = 365; GPGregorianTime startDateA = new GPGregorianTime(loc); GPCalendarResults calA = new GPCalendarResults(); GPCalendarResults calB = new GPCalendarResults(); calA.progressReport = this; calB.progressReport = this; if (startDateA != null) { GPSun.sunPosMethod = GPSun.SUNPOSMETHOD_CALCULATOR; calA.CalculateCalendar(startDateA, nCount); GPSun.sunPosMethod = GPSun.SUNPOSMETHOD_CALCULATOREX; calB.CalculateCalendar(startDateA, nCount); } GPSun.sunPosMethod = GPSun.SUNPOSMETHOD_CALCULATOR; StringBuilder sb = new StringBuilder(); GPCalendarTwoLocResults cals = new GPCalendarTwoLocResults(); cals.CalendarA = calA; cals.CalendarB = calB; FormaterHtml.WriteCompareCalendarHTML(cals, sb); string HtmlText = sb.ToString(); webBrowser1.DocumentText = HtmlText; GPObserver obs = new GPObserver(); obs = loc; GPStrings.pushRich(false); StringBuilder sba = new StringBuilder(); GPJulianTime sunRise, sunNoon, sunSet; for (int i = 0; i < calA.getCount(); i++) { GPCalendarDay cd = calA.get(i); GPCalendarDay cd2 = calB.get(i); GPAstroEngine.CalculateTimeSun(cd.date, loc, out sunRise, out sunNoon, out sunSet); GPGregorianTime gt = new GPGregorianTime(loc); GPCelestialBodyCoordinates pos = GPAstroEngine.sun_coordinate(GPDynamicTime.getUniversalTimeFromDynamicTime(2457012.82313)); GPAstroEngine.calcHorizontal(pos, loc); sunRise.setLocalTimezoneOffset(loc.getTimeZoneOffsetHours()); sba.AppendFormat("{0} {1} {2} \n", cd.date.ToString(), cd.getSunriseTime().getLongTimeString(), cd2.getSunriseTime().getLongTimeString()); gt.setDate(1992, 10, 13); //cd.astrodata.sun.calculateCoordinatesMethodM(gt, 360/24.0); } GPStrings.popRich(); richTextBox1.Text = sba.ToString(); GPGregorianTime t1 = new GPGregorianTime(loc); t1.setDate(2015, 4, 4); double jd = t1.getJulianLocalNoon(); sba.Clear(); for (double d = 0.3; d < 1.0; d += 0.01) { double ml = GPAstroEngine.moon_coordinate(jd + d).eclipticalLongitude; double sl1 = GPAstroEngine.sun_coordinate(jd + d).eclipticalLongitude; double sl2 = GPAstroEngine.sunLongitudeMethodM(jd + d); sba.AppendFormat("{0} : {1} {2} {3}\n", jd + d, ml, sl1, sl2); } richTextBox2.Text = sba.ToString(); }
protected override void Execute() { loc = GPAppHelper.getMyLocation(); //Testing.Report(loc, "gcal13"); //loc1.setLatitudeNorthPositive(48.16); //loc1.setLongitudeEastPositive(17.09); //loc1.setTimeZoneName("Europe/Bratislava"); p_today = new GPGregorianTime(loc); p_today.Today(); /* * Debugger.Log(0,"", String.Format("Location: {0} {1} {2}\n", loc.getFullName(), loc1.getLongitudeString(), loc1.getLatitudeString())); * * double date = p_today.getJulianLocalNoon(); * TEclipse te; * for (int i = 0; i < 30; i++) * { * te = MA.Engine.NextEclipse(ref date, true); * int y, m, d; * MA.Engine.DecodeDateCorrect(date, out y, out m, out d); * Debugger.Log(0, "", String.Format("eclipse:{0} date: {1} {2} {3}\n", te, y, m, d)); * date += 20; * } * * //double a1 = MA.GPMeeusEngine.star_time(2456708.3200) ; * //a1 = MA.GPMeeusEngine.star_time(2452083) - a1; * * * double lat1 = 48.16, lat2 = 120; * double lon1 = 17.09, lon2 = 123; * double dStart = 0.287399999999998; * double dEnd = 0.287799999999998; * GPObserver obs = new GPObserver(); * obs.setLatitudeNorthPositive(lat1).setLongitudeEastPositive(lon1).SetAltitude(0.2); * * GPJulianTime rise, trans, set; * * * GPJulianTime time = new GPJulianTime(); * * time.setLocalJulianDay(2456708.5); * time.setLocalTimezoneOffset(1); * for (int l = 0; l < 40; l++) * { * Log("Julian {0} = {1} / {2} / {3} {4}:{5}:{6}\n", time.GetJulianDay(), time.GetYear(), * time.GetMonth(), time.GetDay(), time.GetHour(), time.GetMinute(), time.GetSecond()); * time.AddSeconds(79367.6); * } * * //GPGregorianTime gt = new GPGregorianTime(loc); * //gt.setJulianGreenwichTime(time); * //double rise = MA.GPMeeusEngine.Sun_Rise(p_today.GetJulianDetailed() - 0.5, loc.Latitude, -loc.Longitude); * //GPAstroEngine.CalculateTimeSun(gt, obs, out rise, out trans, out set); * * //Log("Rise: {0}, \nTrans:{1}, \nSet:{2}", rise, trans, set); * * //MA.Testing.TestSunCoordinates(); * //MA.Testing.TestSiderealTime(); * //MA.Testing.TestMoonEvents(); * * //GPSun sun = new GPSun(); * //sun.SunCalc(p_today, loc); * TRiseSet kind; * double deltaphi, epsilon, srt; * GPJulianTime dp = new GPJulianTime(); * dp.setLocalJulianDay(2456710.500000); * * obs.setLongitudeEastPositive(-25.858).setLatitudeNorthPositive(-23.983); * srt = 2452081.000000; * * //MA.Testing.TestMoonEclipse(); * * Testing.TestConjunctions(); * * //MA.GPCelestialBodyCoordinates coord = MA.GPMeeusEngine.moon_coordinate(2448724.5); * //double phi, eps; * //MA.GPMeeusEngine.calc_epsilon_phi(2446895.5, out phi, out eps); * //Log("Sidereal time: {0}", MA.GPMeeusEngine.star_time(2446895.5)); * //Log("Epsilon: {0}, phi: {1}", eps, phi); * //Log("Sunrise {0}", sun.rise.LongTimeString); * * return; */ int maxCount = GPUserDefaults.IntForKey("nextfest.days", 16); if (maxCount < 3) { maxCount = 16; GPUserDefaults.SetIntForKey("nextfest.days", maxCount); } bool onlyFast = GPUserDefaults.BoolForKey("nextfest.onlyfast", true); p_cal.CalculateCalendar(p_today, maxCount); List <string> temp = new List <string>(); for (int i = 0; i < p_cal.getCount(); i++) { temp.Clear(); GPCalendarDay vd = p_cal.get(i); if (onlyFast) { if (vd.sEkadasiVrataName.Length > 0) { temp.Add(string.Format(GPStrings.getString(87), vd.sEkadasiVrataName)); } else if (vd.hasEkadasiParana()) { temp.Add(vd.getEkadasiParanaString()); } } else { if (vd.hasEkadasiParana()) { temp.Add(vd.getEkadasiParanaString()); } foreach (GPCalendarDay.Festival fest in vd.Festivals) { if (GPUserDefaults.BoolForKey(fest.ShowSettingItem, true)) { temp.Add(fest.Text); } } } if (temp.Count > 0) { for (int j = 0; j < temp.Count; j++) { GPStringPair dr = new GPStringPair(); if (j == 0) { dr.Name = vd.date.ToString() + " " + GPStrings.getString(150 + vd.date.getDayOfWeek()); } dr.Value = temp[j]; lines.Add(dr); } } } }
protected override void Execute() { WebResponse response = null; WebRequest request = WebRequest.Create("http://gcal.home.sk/languages/langlist.php"); ((HttpWebRequest)request).UserAgent = "GCAL Application"; List <GPLanguage> list = new List <GPLanguage>(); GPLanguageList shared = GPLanguageList.getShared(); try { setMessage("msg:" + GPStrings.getString(1285)); response = request.GetResponse(); Stream stream = response.GetResponseStream(); StreamReader sr = new StreamReader(stream); string fetchedList = sr.ReadToEnd(); sr.Close(); string[] lines = fetchedList.Split('\n'); foreach (string s in lines) { //Debugger.Log(0, "", "LANG: " + s + "\n"); string[] langRec = s.Split('\t'); if (langRec.Length >= 3) { GPLanguage lang = new GPLanguage(); if (!int.TryParse(langRec[0], out lang.LanguageId)) { lang.LanguageId = -1; } lang.LanguageName = langRec[1]; if (!int.TryParse(langRec[2], out lang.LanguageVersion)) { lang.LanguageVersion = -1; } if (shared.IsNewVersion(lang)) { list.Add(lang); } } } } catch (Exception e) { setMessage("msg:" + e.Message); System.Threading.Thread.Sleep(2000); } finally { if (response != null) { response.Close(); } } int i = 1; int m = list.Count; foreach (GPLanguage language in list) { try { setMessage(string.Format("msg:{0} {1}/{2}", GPStrings.getString(1286), i, m)); request = WebRequest.Create("http://gcal.home.sk/languages/exportraw.php?langid=" + language.LanguageId); response = request.GetResponse(); Stream s = response.GetResponseStream(); StreamReader sr = new StreamReader(s); string file = sr.ReadToEnd(); sr.Close(); string fileName = string.Format("lang{0}.txt", language.LanguageId); string filePath = Path.Combine(Path.Combine(GPFileHelper.getAppExecutableDirectory(), "languages"), fileName); if (File.Exists(filePath)) { File.Delete(filePath); } File.WriteAllText(filePath, file); } catch { } finally { if (response != null) { response.Close(); } } i++; } if (list.Count > 0) { shared.refreshLanguageList(); } else { setMessage("msg:" + GPStrings.getString(1287)); } System.Threading.Thread.Sleep(1000); setMessage("stop:"); }
protected override void Execute() { WebResponse response = null; //setMessage("msg:Send file " + GPStrings.getSharedStrings().getCustomFilePath() + " to email address: " + "*****@*****.**"); setMessage("Connecting"); GPStrings sh = GPStrings.getSharedStrings(); int c = 0, m = 0; foreach (int i in sh.edited.Keys) { if (sh.edited[i]) { m++; } } foreach (int i in sh.edited.Keys) { if (sh.edited[i]) { try { c++; setMessage(string.Format("Sending {0}/{1}", c, m)); String reqString = string.Format("http://gcal.home.sk/languages/mail_update.php?langid={0}&stringid={1}&string={2}", sh.LanguageId, i, HttpUtility.UrlEncode(sh.getStringValue(i))); WebRequest request = WebRequest.Create(reqString); request.Method = "GET"; // request.ContentType = "application/x-www-form-urlencoded"; // Set the ContentLength property of the WebRequest. /* StringBuilder sb = new StringBuilder(); * sb.AppendFormat("langid={0}&", sh.LanguageId); * sb.AppendFormat("stringid={0}&", i); * sb.AppendFormat("string={0}", sh.getStringValue(i)); * //string postData = "langid=2&strings=This is a test that posts this string to a Web server."; * byte[] byteArray = Encoding.UTF8.GetBytes(sb.ToString()); * request.ContentLength = byteArray.Length; * // Get the request stream. * Stream dataStream = request.GetRequestStream(); * // Write the data to the request stream. * dataStream.Write(byteArray, 0, byteArray.Length); * // Close the Stream object. * dataStream.Close(); * // Get the response. */ response = request.GetResponse(); response.Close(); response = null; } catch { } finally { if (response != null) { response.Close(); } } } } setMessage("msg:OK"); System.Threading.Thread.Sleep(1000); setMessage("stop:"); }