Ejemplo n.º 1
0
        public int getFastType()
        {
            if (nFastType == 0)
            {
                return(nFastType);
            }
            if (GPUserDefaults.BoolForKey("gen.oldstyle.fasting", false))
            {
                return(nFastType);
            }

            if (nClass > 0)
            {
                return(GPConstants.FAST_NULL);
            }

            if (nSpec == GPConstants.SPEC_RADHASTAMI)
            {
                return(GPConstants.FAST_NULL);
            }

            return(GPConstants.FAST_DAY);
        }
Ejemplo n.º 2
0
 public static int HeaderType()
 {
     return(GPUserDefaults.IntForKey("cal.headertype", 0));
 }
Ejemplo n.º 3
0
 private void initialize()
 {
     currentLanguageId = GPUserDefaults.IntForKey("gcal.current.language", -1);
     refreshLanguageList();
 }
Ejemplo n.º 4
0
 public static void SunsetVisible(bool value)
 {
     GPUserDefaults.SetBoolForKey("today.sunset", value);
 }
Ejemplo n.º 5
0
 public static void NoonVisible(bool value)
 {
     GPUserDefaults.SetBoolForKey("today.noon", value);
 }
Ejemplo n.º 6
0
 public static int SankrantiNameFormat()
 {
     return(GPUserDefaults.IntForKey("gen.sankranti.name.format", 0));
 }
Ejemplo n.º 7
0
            // 30

            public static bool NoonVisible()
            {
                return(GPUserDefaults.BoolForKey("today.noon", true));
            }
Ejemplo n.º 8
0
 public static void FastingNotation(int value)
 {
     GPUserDefaults.SetIntForKey("gen.fastingnotation", value);
 }
Ejemplo n.º 9
0
 public static void FirstDayOfWeek(int value)
 {
     GPUserDefaults.SetIntForKey("gen.week.firstday", value);
 }
Ejemplo n.º 10
0
 public static int FirstDayOfWeek()
 {
     return(GPUserDefaults.IntForKey("gen.week.firstday", 0));
 }
Ejemplo n.º 11
0
 public static void CaturmasyaSystem(int value)
 {
     GPUserDefaults.SetIntForKey("gen.caturmasya", value);
 }
Ejemplo n.º 12
0
 public static int CaturmasyaSystem()
 {
     return(GPUserDefaults.IntForKey("gen.caturmasya", 1));
 }
Ejemplo n.º 13
0
 public static void SetMasaVisible(int masa, bool value)
 {
     GPUserDefaults.SetBoolForKey("masa.visible." + masa.ToString(), value);
 }
Ejemplo n.º 14
0
 public static bool MasaVisible(int masa)
 {
     return(GPUserDefaults.BoolForKey("masa.visible." + masa.ToString(), true));
 }
Ejemplo n.º 15
0
 public static void HeaderType(int value)
 {
     GPUserDefaults.SetIntForKey("cal.headertype", value);
 }
Ejemplo n.º 16
0
            }   //42

            public static void TimeFormat(int value)
            {
                GPUserDefaults.SetIntForKey("gen.timeformat", value);
            }   //42
Ejemplo n.º 17
0
 public static int FastingNotation()
 {
     return(GPUserDefaults.IntForKey("gen.fastingnotation", 0));
 }
Ejemplo n.º 18
0
 public static bool DefaultEventsEditable()
 {
     return(GPUserDefaults.BoolForKey("gen.defevents.editable", false));
 }
Ejemplo n.º 19
0
 public static int NameMasaFormat()
 {
     return(GPUserDefaults.IntForKey("gen.masaname.format", 0));
 }
Ejemplo n.º 20
0
 public static void DefaultEventsEditable(bool value)
 {
     GPUserDefaults.SetBoolForKey("gen.defevents.editable", value);
 }
Ejemplo n.º 21
0
 public static void NameMasaFormat(int value)
 {
     GPUserDefaults.SetIntForKey("gen.masaname.format", value);
 }
Ejemplo n.º 22
0
 public static bool HighlightEvenLines()
 {
     return(GPUserDefaults.BoolForKey("gen.highlight.oddlines", true));
 }
Ejemplo n.º 23
0
 public static void SankrantiNameFormat(int value)
 {
     GPUserDefaults.SetIntForKey("gen.sankranti.name.format", value);
 }
Ejemplo n.º 24
0
 public static void HighlightEvenLines(bool value)
 {
     GPUserDefaults.SetBoolForKey("gen.highlight.oddlines", value);
 }
Ejemplo n.º 25
0
            // 31

            public static bool SunsetVisible()
            {
                return(GPUserDefaults.BoolForKey("today.sunset", true));
            }
Ejemplo n.º 26
0
 public static bool TimeFormat24()
 {
     GPGregorianTime.timeFormat24 = (GPUserDefaults.IntForKey("gen.timeformat", 1) == 1);
     return(GPGregorianTime.timeFormat24);
 }   //42
Ejemplo n.º 27
0
        public void calculateAppearanceDayData(GPLocationProvider aLocation, GPGregorianTime aEvente)
        {
            //MOONDATA moon;
            //SUNDATA sun;
            location = aLocation;
            evente   = new GPGregorianTime(aEvente);
            double          dd;
            GPAstroData     d     = details;
            GPGregorianTime vc    = evente;
            GPGregorianTime vcsun = evente;

            b_adhika = false;

            d.calculateDayData(aEvente, aLocation);
            //d.nTithi = GetPrevTithiStart(m_earth, vc, dprev);
            //GetNextTithiStart(m_earth, vc, dnext);
            //vcsun.setDayHours(vcsun.getDayHours() - vcsun.getTimeZoneOffsetHours() / 24.0);
            vcsun.normalizeValues();
            d.sun.calculateCoordinatesMethodC(vcsun, -1);
            d.moon.MoonCalc(vcsun.getJulianGreenwichTime());
            d.msDistance = GPMath.putIn360(d.moon.longitude_deg - d.sun.eclipticalLongitude - 180.0);
            d.msAyanamsa = GPAyanamsa.GetAyanamsa(vc.getJulianGreenwichTime());

            // tithi
            dd             = d.msDistance / 12.0;
            d.nTithi       = Convert.ToInt32(Math.Floor(dd));
            d.nTithiElapse = GPMath.frac(dd) * 100.0;
            d.nPaksa       = (d.nTithi >= 15) ? 1 : 0;


            // naksatra
            dd                = GPMath.putIn360(d.moon.longitude_deg - d.msAyanamsa);
            dd                = (dd * 3.0) / 40.0;
            d.nNaksatra       = Convert.ToInt32(Math.Floor(dd));
            d.nNaksatraElapse = GPMath.frac(dd) * 100.0;
            d.nMasa           = d.determineMasa(vc, out d.nGaurabdaYear);
            d.nMoonRasi       = GPEngine.GetRasi(d.moon.longitude_deg, d.msAyanamsa);
            d.nSunRasi        = GPEngine.GetRasi(d.sun.eclipticalLongitude, d.msAyanamsa);

            if (d.nMasa == GPMasa.ADHIKA_MASA)
            {
                d.nMasa  = GPEngine.GetRasi(d.sun.eclipticalLongitude, d.msAyanamsa);
                b_adhika = true;
            }
            string dstApplicable = "";

            //List<string> gstr = GPStrings.getSharedStrings().gstr;
            output.Add(new GPStringPair(GPStrings.getString(25), "", true));
            output.Add(new GPStringPair(GPStrings.getString(7), vc.ToString()));
            output.Add(new GPStringPair(GPStrings.getString(8), vc.getShortTimeString(true, ref dstApplicable)));
            output.Add(new GPStringPair(GPStrings.getString(9), vc.getLocation().getFullName()));
            //output.Add(new GPStringPair(gstr[10], vc.getLocation().getLatitudeString()));
            //output.Add(new GPStringPair(gstr[11], vc.getLocation().getLongitudeString()));
            //output.Add(new GPStringPair(gstr[12], vc.getLocation().getTimeZoneName()));
            //output.Add(new GPStringPair(gstr[1001], dstApplicable));
            output.Add(new GPStringPair(GPStrings.getString(13), GPTithi.getName(d.nTithi)));
            output.Add(new GPStringPair(GPStrings.getString(14), string.Format("{0:0.###} %", d.nTithiElapse)));
            output.Add(new GPStringPair(GPStrings.getString(15), GPNaksatra.getName(d.nNaksatra)));
            output.Add(new GPStringPair(GPStrings.getString(16), string.Format("{0:0.###} % ({1})", d.nNaksatraElapse, GPStrings.getString(811 + Convert.ToInt32(d.nNaksatraElapse / 25.0)))));
            output.Add(new GPStringPair(GPStrings.getString(991), GPSankranti.getName(d.nMoonRasi)));
            output.Add(new GPStringPair(GPStrings.getString(992), GPSankranti.getName(d.nSunRasi)));
            output.Add(new GPStringPair(GPStrings.getString(20), GPPaksa.getName(d.nPaksa)));
            if (b_adhika == true)
            {
                output.Add(new GPStringPair(GPStrings.getString(22), string.Format("{0} {1}", GPMasa.GetName(d.nMasa), GPStrings.getString(21))));
            }
            else
            {
                output.Add(new GPStringPair(GPStrings.getString(22), GPMasa.GetName(d.nMasa)));
            }
            output.Add(new GPStringPair(GPStrings.getString(23), d.nGaurabdaYear.ToString()));

            if (GPDisplays.AppDay.childNameSuggestions())
            {
                output.Add(new GPStringPair());
                output.Add(new GPStringPair(GPStrings.getString(17), "", true));
                output.Add(new GPStringPair());
                output.Add(new GPStringPair(GPStrings.getString(18), string.Format("{0}...", GPAppHelper.GetNaksatraChildSylable(d.nNaksatra, Convert.ToInt32(d.nNaksatraElapse / 25.0)))));
                output.Add(new GPStringPair(GPStrings.getString(19), string.Format("{0}...", GPAppHelper.GetRasiChildSylable(d.nMoonRasi))));
            }

            vc.Today();
            GPVedicTime     va = new GPVedicTime();
            GPGregorianTime vctemp;

            va.tithi = d.nTithi;
            va.masa  = d.nMasa;
            va.gyear = GPGaurabdaYear.getGaurabdaYear(vc, location);
            if (va.gyear < d.nGaurabdaYear)
            {
                va.gyear = d.nGaurabdaYear;
            }


            int countC = GPUserDefaults.IntForKey("appday.celebs", 3);

            if (countC > 0)
            {
                output.Add(new GPStringPair());
                output.Add(new GPStringPair(GPStrings.getString(24), "", true));
                output.Add(new GPStringPair());
            }

            int m = 0;

            for (int i = 0; i < 6; i++)
            {
                GPEngine.VATIMEtoVCTIME(va, out vctemp, location);
                if (va.gyear > d.nGaurabdaYear)
                {
                    if (m < countC)
                    {
                        output.Add(new GPStringPair(string.Format("{0} {1}", GPStrings.getString(994), va.gyear), vctemp.ToString()));
                        m++;
                    }
                }
                va.gyear++;
            }
        }
Ejemplo n.º 28
0
            }   //42

            public static void TimeFormat24(bool value)
            {
                GPGregorianTime.timeFormat24 = value;
                GPUserDefaults.SetIntForKey("gen.timeformat", (value ? 1 : 0));
            }   //42
Ejemplo n.º 29
0
        public static void FormatTodayInfoRtf(GPGregorianTime vc, GPLocationProvider loc, StringBuilder str)
        {
            string str2, str3 = string.Empty;

            GPCalendarResults db = new GPCalendarResults();

            GPGregorianTime vc2 = new GPGregorianTime(vc);

            vc2.PreviousDay();
            vc2.PreviousDay();
            vc2.PreviousDay();
            vc2.PreviousDay();
            db.CalculateCalendar(vc2, 9);

            int           i = db.FindDate(vc);
            GPCalendarDay p = db.get(i);

            if (p == null)
            {
                return;
            }

            str.Remove(0, str.Length);
            AppendRtfHeader(str);
            str2 = string.Format("\\f2\\fs{0} {1} ", g_HeaderSize, GPAppHelper.getDateText(vc));
            str.Append(str2);

            str.AppendFormat("\\par\\f2\\fs{0} {{\\fs{1} {2}}\\line {3} ({4}, {5}, {6}: {7})",
                             g_TextSize, g_TextSize + 4, getSharedStringRtf(p.date.getDayOfWeek()), loc.getFullName(), loc.getLocation(0).getLatitudeString(),
                             loc.getLocation(0).getLongitudeString(), getSharedStringRtf(12),
                             loc.getLocation(0).getTimeZoneName());
            str.AppendLine("\\par");
            str.AppendLine("\\par");
            str.AppendFormat("  {0}, {1}", p.getTithiName(), p.getPaksaName());
            str.AppendLine("\\par");
            str.AppendFormat("  {0}, {1}", p.getMasaLongName(), p.getGaurabdaYearLongString());
            str.AppendLine("\\par");
            str.AppendLine("\\par");


            // adding mahadvadasi
            // adding spec festivals

            foreach (GPCalendarDay.Festival fest in p.CompleteFestivalList(db.get(i - 1), db.get(i + 1)))
            {
                if (GPUserDefaults.BoolForKey(fest.ShowSettingItem, true))
                {
                    if (fest.ShowSettingItem == GPDisplays.Keys.CalendarSankranti)
                    {
                        str.AppendLine(fest.Text.PadLeft((80 + str2.Length) / 2, '-').PadRight(80, '-'));
                        str.AppendLine("\\par");
                    }
                    else
                    {
                        str.Append("\\tab");
                        str.Append(fest.Text);
                        str.AppendLine("\\par");
                    }
                }
            }

            str.AppendLine("\\par");


            if (GPDisplays.Today.BrahmaMuhurtaVisible())
            {
                str.AppendLine("\\par");
                str.AppendFormat("{0} {1}", getSharedStringRtf(988), p.astrodata.sun.arunodaya.getShortMuhurtaRange(0));
            }

            if (GPDisplays.Today.SunriseVisible())
            {
                str.AppendLine("\\par");
                str.AppendFormat("{0} {1} ", getSharedStringRtf(51), p.astrodata.sun.rise.getShortTimeString());
                if (GPDisplays.Today.SandhyaTimesVisible())
                {
                    str.AppendFormat(" {0} {1} ", getSharedStringRtf(989), p.astrodata.sun.rise.getShortSandhyaRange());
                }
                str.AppendFormat(" ({0})", GPAppHelper.GetDSTSignature(p.isDaylightInEffect()));
                str.AppendLine("\\par");
            }
            if (GPDisplays.Today.NoonVisible())
            {
                str2 = string.Format("{0} {1} ", getSharedStringRtf(857), p.astrodata.sun.noon.getShortTimeString());
                str.Append(str2);
                if (GPDisplays.Today.SandhyaTimesVisible())
                {
                    str.AppendFormat(" {0} {1} ", getSharedStringRtf(989), p.astrodata.sun.noon.getShortSandhyaRange());
                }
                str.AppendFormat(" ({0})", GPAppHelper.GetDSTSignature(p.isDaylightInEffect()));
                str.AppendLine("\\par");
            }
            if (GPDisplays.Today.SunsetVisible())
            {
                str.AppendFormat("{0}  {1} ", getSharedStringRtf(52), p.astrodata.sun.set.getShortTimeString());
                if (GPDisplays.Today.SandhyaTimesVisible())
                {
                    str.AppendFormat(" {0} {1} ", getSharedStringRtf(989), p.astrodata.sun.set.getShortSandhyaRange());
                }
                str.AppendFormat(" ({0})", GPAppHelper.GetDSTSignature(p.isDaylightInEffect()));
                str.AppendLine("\\par");
            }
            if (GPDisplays.Today.SunriseInfo())
            {
                str.AppendLine("\\par");
                str.Append(getSharedStringRtf(990));
                str.AppendLine("\\par");
                str.AppendFormat("   {1} {2}", GPNaksatra.getName(p.astrodata.nNaksatra), getSharedStringRtf(15));
                if (GPDisplays.Today.NaksatraPadaVisible())
                {
                    str.AppendFormat(", {0} {1} ({2})", p.astrodata.nNaksatraElapse, getSharedStringRtf(993), getSharedStringRtf(811 + p.getNaksatraPada()));
                }
                if (GPDisplays.Today.RasiOfMoonVisible())
                {
                    str.AppendFormat(", {0}: {1}", getSharedStringRtf(991), GPSankranti.getName(p.astrodata.nMoonRasi));
                }
                str.AppendFormat(", {0} {1}", GPYoga.getName(p.astrodata.nYoga), getSharedStringRtf(104));
                str.AppendLine("\\par");
                str.AppendFormat("  {0} {1}", getSharedStringRtf(992), GPSankranti.getName(p.astrodata.nSunRasi));
                str.AppendLine("\\par");
            }
            /* END GCAL 1.4.3 */

            AddNoteRtf(str);
        }
Ejemplo n.º 30
0
            }   //42

            public static int TimeFormat()
            {
                return(GPUserDefaults.IntForKey("gen.timeformat", 1));
            }   //42