Esempio n. 1
0
        public static string NextStartupTip()
        {
            bool startupTips = GPUserDefaults.BoolForKey("app.startup.tips", true);

            if (startupTips)
            {
                //GPStrings gstr = GPStrings.getSharedStrings();
                int startupTipsCounter = GPUserDefaults.IntForKey("app.startup.tips.counter", 0);
                int count;
                for (count = 1200; count <= 1228; count++)
                {
                    if (GPStrings.getString(count).Length == 0)
                    {
                        break;
                    }
                }
                count -= 1200;

                if (count > 0)
                {
                    startupTipsCounter = startupTipsCounter % count;
                    string ret = GPStrings.getString(1200 + startupTipsCounter);
                    startupTipsCounter = (startupTipsCounter + 1) % count;
                    GPUserDefaults.SetIntForKey("app.startup.tips.counter", startupTipsCounter);
                    return(ret);
                }
            }
            return(null);
        }
Esempio n. 2
0
        public static int FormatCalendarDayRtf(GPCalendarDay pvd, StringBuilder dayText, GPCalendarDay prevd, GPCalendarDay nextd)
        {
            string str;

            dayText.Remove(0, dayText.Length);

            str = GetTextRtf(pvd);

            if (pvd.astrodata.sun.eclipticalLongitude < 0.0)
            {
                dayText.Append("\\par\\tab ");
                dayText.Append(GPStrings.getString(974));
                return(1);
            }
            dayText.Append(str);


            foreach (GPCalendarDay.Festival fest in pvd.CompleteFestivalList(prevd, nextd))
            {
                if (GPUserDefaults.BoolForKey(fest.ShowSettingItem, true))
                {
                    if (fest.ShowSettingItem == GPDisplays.Keys.CalendarSankranti)
                    {
                        dayText.Append("\\par ");
                        dayText.Append(fest.Text.PadLeft((80 + str.Length) / 2, '-').PadRight(80, '-'));
                    }
                    else
                    {
                        AddListRtf(dayText, fest.Text);
                    }
                }
            }

            return(0);
        }
Esempio n. 3
0
        public static int AvcGetOldCalendarDayText(GPCalendarDay pvd, StringBuilder dayText, GPCalendarDay prevd, GPCalendarDay nextd)
        {
            String str = string.Empty, str2, str3;

            dayText.Remove(0, dayText.Length);
            str  = GetTextA(pvd);
            str2 = str.Substring(16);
            str3 = str.Substring(0, 16);
            str  = str3;
            if (pvd.astrodata.sun.eclipticalLongitude < 0.0)
            {
                AddListText(dayText, str, getSharedStringPlain(974));
                return(1);
            }
            AddListText(dayText, str, str2);

            foreach (GPCalendarDay.Festival fest in pvd.CompleteFestivalList(prevd, nextd))
            {
                if (GPUserDefaults.BoolForKey(fest.ShowSettingItem, true))
                {
                    if (fest.ShowSettingItem == GPDisplays.Keys.CalendarSankranti)
                    {
                        dayText.AppendLine(GPAppHelper.CenterString(fest.Text, 80, '-'));
                    }
                    else
                    {
                        AddListText(dayText, fest.Text);
                    }
                }
            }



            return(0);
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
            // 30

            public static bool NoonVisible()
            {
                return(GPUserDefaults.BoolForKey("today.noon", true));
            }
Esempio n. 6
0
 public static bool DefaultEventsEditable()
 {
     return(GPUserDefaults.BoolForKey("gen.defevents.editable", false));
 }
Esempio n. 7
0
 public static bool EkadasiParanaDetails()
 {
     return(GPUserDefaults.BoolForKey("cal.ekadasi.parana.details", true));
 }
Esempio n. 8
0
 public static bool PaksaInfoVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.paksa", true));
 }
Esempio n. 9
0
 public static bool YogaVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.yoga", true));
 }
Esempio n. 10
0
 public static bool AyanamsaValueVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.ayanamsa", false));
 }
Esempio n. 11
0
 public static bool MoonLongitudeVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.moon.longitude", false));
 }
Esempio n. 12
0
 public static bool VriddhiTithiInfoVisible()
 {
     return(GPUserDefaults.BoolForKey(Keys.CalendarVriddhi, false));
 }
Esempio n. 13
0
 //48
 public static bool childNameSuggestions()
 {
     return(GPUserDefaults.BoolForKey("appday.childn", true));
 }
Esempio n. 14
0
 public static bool KsayaTithiInfoVisible()
 {
     return(GPUserDefaults.BoolForKey(Keys.CalendarKsaya, false));
 }
Esempio n. 15
0
 public static bool FestivalsVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.festivals", true));
 }
Esempio n. 16
0
 public static bool DSTNotice()
 {
     return(GPUserDefaults.BoolForKey("cal.dst.info", true));
 }
Esempio n. 17
0
 public static bool NaksatraVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.naksatra", true));
 }
Esempio n. 18
0
 public static bool JulianDayVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.julianday", false));
 }
Esempio n. 19
0
 public static bool FastingFlagVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.fastingflag", true));
 }
Esempio n. 20
0
 public static bool SankrantiInfoVisible()
 {
     return(GPUserDefaults.BoolForKey(Keys.CalendarSankranti, true));
 }
Esempio n. 21
0
 public static bool RasiVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.sunrise.moon.rasi", true));
 }
Esempio n. 22
0
 public static bool EkadasiInfoVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.fastingekadasi.info", true));
 }
Esempio n. 23
0
 public static bool MasaVisible(int masa)
 {
     return(GPUserDefaults.BoolForKey("masa.visible." + masa.ToString(), true));
 }
Esempio n. 24
0
 public static bool HideEmptyDays()
 {
     return(GPUserDefaults.BoolForKey("cal.hide.empty", true));
 }
Esempio n. 25
0
 public static bool HighlightEvenLines()
 {
     return(GPUserDefaults.BoolForKey("gen.highlight.oddlines", true));
 }
Esempio n. 26
0
 public static bool StartMasaVisible()
 {
     return(GPUserDefaults.BoolForKey("cal.masastart.info", true));
 }
Esempio n. 27
0
            // 31

            public static bool SunsetVisible()
            {
                return(GPUserDefaults.BoolForKey("today.sunset", true));
            }
Esempio n. 28
0
 public static bool FestivalClass6()
 {
     return(GPUserDefaults.BoolForKey("cal.festivals.6", true));
 }
Esempio 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);
        }
Esempio n. 30
0
 public static bool NoonTime()
 {
     return(GPUserDefaults.BoolForKey("cal.noon.time", false));
 }