Esempio n. 1
0
        private void btnGeoLocationForm_Click(object sender, EventArgs e)
        {
            GeoLocationTimes glt = new GeoLocationTimes();

            glt.Show();
        }
Esempio n. 2
0
        /// <summary>
        /// show Times Based of Geo location
        /// </summary>
        public void LocationTimes()
        {
            string      locationName;
            double      latitude;
            double      longitude;
            double      elevation;
            XmlDocument xmlDoc = new XmlDocument();

            if (!File.Exists("GeoLocation.xml"))
            {
                GeoLocationTimes glt = new GeoLocationTimes();
                glt.CreateFirstGeoLocationXML();
                //glt.SetGeoLocation();
            }
            else
            {
                xmlDoc.Load("GeoLocation.xml");
                XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes("/Table/Geo");
                string      GeoID = "", GeoLocationName = "", Geolatitude = "", Geolongitude = "", Geoelevation = "";
                foreach (XmlNode node in nodeList)
                {
                    GeoID           = node.SelectSingleNode("Geo_Id").InnerText;
                    GeoLocationName = node.SelectSingleNode("Geo_Location_Name").InnerText;
                    Geolatitude     = node.SelectSingleNode("Latitude").InnerText;
                    Geolongitude    = node.SelectSingleNode("Longitude").InnerText;
                    Geoelevation    = node.SelectSingleNode("Elevation").InnerText;
                }
                locationName = GeoLocationName;
                latitude     = Convert.ToDouble(Geolatitude);
                longitude    = Convert.ToDouble(Geolongitude);
                elevation    = Convert.ToDouble(Geoelevation);

                //ITimeZone timeZone = new OlsonTimeZone(PublicDomain.TzTimeZone.CurrentTimeZone);
                ITimeZone             timeZone = new OlsonTimeZone("Asia/Jerusalem");
                GeoLocation           location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
                ComplexZmanimCalendar zc = new ComplexZmanimCalendar(DateTime.Now, location);
                string   TimeFormat = "HH:mm:ss";
                DateTime d1, d2, d3, d4, d5, d6, d7, d8, d9;
                {
                    lblTi1.Text = (locationName);
                    d1          = (zc.GetAlosHashachar().Value);
                    d2          = (zc.GetBeginNauticalTwilight().Value);
                    d3          = (zc.GetSunrise().Value);
                    d4          = (zc.GetSofZmanShmaMGA().Value);
                    d5          = (zc.GetSofZmanShmaGRA().Value);
                    d6          = (zc.GetMinchaGedola72Minutes().Value);
                    d7          = (zc.GetSeaLevelSunset().Value);
                    d8          = (zc.GetTzaisGeonim4Point37Degrees().Value);
                    d9          = (zc.GetCandleLighting().Value);
                    lblTi2.Text = d1.ToString(TimeFormat);
                    lblTi3.Text = d2.ToString(TimeFormat);
                    lblTi4.Text = d3.ToString(TimeFormat);
                    lblTi5.Text = d4.ToString(TimeFormat);
                    lblTi6.Text = d5.ToString(TimeFormat);
                    lblTi7.Text = d6.ToString(TimeFormat);
                    lblTi8.Text = d7.ToString(TimeFormat);
                    //lblTi9.Text = (zc.GetTzaisGeonim8Point5Degrees().ToString());
                    //lblTi9.Text = (zc.GetTzaisGeonim3Point65Degrees().ToString());
                    lblTi9.Text     = d8.ToString(TimeFormat);
                    lblCandles.Text = d9.ToString(TimeFormat);
                }
            }
        }