Exemplo n.º 1
0
        public DateTimePanel()
        {
            InitializeComponent();

            for (int i = 1; i < 32; i++)
            {
                cbDay.Items.Add(i.ToString());
            }
            for (int j = 1; j < 12; j++)
            {
                cbMonth.Items.Add(GregorianDateTime.GetMonthName(j));
            }
        }
Exemplo n.º 2
0
        public DateSpecifyDstPanel()
        {
            InitializeComponent();
            int i;

            for (i = 0; i < 7; i++)
            {
                comboBoxDayOfWeek.Items.Add(GCCalendar.GetWeekdayName(i));
            }

            for (i = 1; i < 32; i++)
            {
                comboBoxDayOfMonth.Items.Add(i.ToString());
            }

            for (i = 1; i < 13; i++)
            {
                comboBoxMonth.Items.Add(GregorianDateTime.GetMonthName(i));
            }
        }
Exemplo n.º 3
0
        public StartDatePanel()
        {
            InitializeComponent();
            int i;

            for (i = 1; i <= 31; i++)
            {
                cbDay.Items.Add(i.ToString());
            }
            for (i = 1; i <= 12; i++)
            {
                cbMonth.Items.Add(GregorianDateTime.GetMonthName(i));
            }
            for (i = 0; i < 30; i++)
            {
                cbTithi.Items.Add(GCTithi.GetName(i));
            }
            for (i = 0; i <= 12; i++)
            {
                cbMasa.Items.Add(GCMasa.GetName(i));
            }
        }
Exemplo n.º 4
0
 public string GetTitleString(int nYear, int nMonth)
 {
     return(string.Format("{0} {1}", GregorianDateTime.GetMonthName(nMonth), nYear));
 }
Exemplo n.º 5
0
        private CDVPara FormatCalendarLayout(CDVDataTarget requestor, DocCalenarData docData)
        {
            CDVParaStyle pstitle = new CDVParaStyle();

            pstitle.StyleName       = "TitleC";
            pstitle.Align           = CDVAlign.Center;
            pstitle.Padding.All     = 12;
            pstitle.Margin.All      = 12;
            pstitle.BorderWidth.All = 1;
            pstitle.BorderColor     = CDVColor.Black;
            pstitle.BackgroundColor = CDVColor.LightYellow;

            CDVParaStyle pshdr = new CDVParaStyle();

            pshdr.StyleName       = "Hdr";
            pshdr.Margin.Top      = 2;
            pshdr.Margin.Bottom   = 12;
            pshdr.BackgroundColor = new CDVColor(255, 64, 32, 0);

            CDVParaStyle ps = new CDVParaStyle();

            ps.StyleName = "Centered";
            ps.Align     = CDVAlign.Center;

            CDVTextStyle ts = new CDVTextStyle();

            ts.FontSize = 18;

            CDVTextStyle tsWeekday = new CDVTextStyle();

            tsWeekday.FontSize = 9;

            CDVTextStyle tsHdr = new CDVTextStyle();

            tsHdr.Color    = CDVColor.White;
            tsHdr.FontSize = 10;

            CDVRuler atithi     = new CDVRuler(null, 10);
            CDVRuler aday       = new CDVRuler(null, 0);
            CDVRuler apak       = new CDVRuler(null);
            CDVRuler anak       = new CDVRuler(null);
            CDVRuler ayog       = new CDVRuler(null);
            CDVRuler afast      = new CDVRuler(null, 0);
            CDVRuler amr        = new CDVRuler(null);
            CDVRuler amsun1     = new CDVRuler(null);
            CDVRuler amsun2     = new CDVRuler(null);
            CDVRuler amsun3     = new CDVRuler(null);
            CDVRuler amcore     = new CDVRuler(null, 20);
            CDVRuler amcoretime = new CDVRuler(null);

            CDVAtom doc  = requestor.GetDocument();
            CDVPara para = new CDVPara(doc, CDVOrientation.Vertical,
                                       new CDVPara(null, CDVOrientation.Vertical, pstitle, CDVSpan.Maximum,
                                                   new CDVWord(null, string.Format("{0} {1}", GregorianDateTime.GetMonthName(docData.Month), docData.Year), ts, ps, CDVSpan.Maximum),
                                                   new CDVWord(null, calLocation.Format("{locationName}, {longitudeText} {latitudeText}, {timeZoneName}"), ps, CDVSpan.Maximum)
                                                   )
                                       );

            CDVPara subRow;
            CDVPara row = new CDVPara(para, CDVOrientation.Horizontal, pshdr, tsHdr);

            para.Add(row);
            row.Add(new CDVWord(row, "Date"));
            row.Add(aday);
            row.Add(new CDVWord(row, ""));
            row.Add(atithi);
            row.Add(new CDVWord(row, "Tithi/Festival/Paksa"));
            if (GCDisplaySettings.Current.CalColPaksa)
            {
                row.Add(apak);
                row.Add(new CDVWord(row, ""));
            }
            if (GCDisplaySettings.Current.CalColNaksatra)
            {
                row.Add(anak);
                row.Add(new CDVWord(row, "Naksatra"));
            }
            if (GCDisplaySettings.Current.CalColYoga)
            {
                row.Add(ayog);
                row.Add(new CDVWord(row, "Yoga"));
            }
            if (GCDisplaySettings.Current.CalColFast)
            {
                row.Add(afast);
                row.Add(new CDVWord(row, "Fast"));
            }
            if (GCDisplaySettings.Current.CalColMoonRasi)
            {
                row.Add(amr);
                row.Add(new CDVWord(row, "Moon Rasi"));
            }

            if (GCDisplaySettings.Current.CalColCoreEvents)
            {
                row.Add(amcore);
                row.Add(new CDVWord(row, "Core Events"));
            }
            else
            {
                if (GCDisplaySettings.Current.CalColSunrise)
                {
                    row.Add(amsun1);
                    row.Add(new CDVWord(row, "Sunrise"));
                }
                if (GCDisplaySettings.Current.CalColNoon)
                {
                    row.Add(amsun2);
                    row.Add(new CDVWord(row, "Noon"));
                }
                if (GCDisplaySettings.Current.CalColSunset)
                {
                    row.Add(amsun3);
                    row.Add(new CDVWord(row, "Sunset"));
                }
            }

            for (int i = 0; i < docData.Calendar.m_PureCount; i++)
            {
                VAISNAVADAY vd = docData.Calendar.GetDay(i);
                row = new CDVPara(para, CDVOrientation.Horizontal);
                para.Add(row);
                row.Add(new CDVWord(row, vd.date.ToString()));
                row.Add(aday);
                row.Add(new CDVWord(row, GCCalendar.GetWeekdayAbbr(vd.date.dayOfWeek), tsWeekday));
                row.Add(atithi);
                row.Add(new CDVWord(row, vd.GetFullTithiName()));
                if (GCDisplaySettings.Current.CalColPaksa)
                {
                    row.Add(apak);
                    row.Add(new CDVWord(row, GCPaksa.GetAbbr(vd.astrodata.sunRise.Paksa).ToString()));
                }
                if (GCDisplaySettings.Current.CalColNaksatra)
                {
                    row.Add(anak);
                    row.Add(new CDVWord(row, GCNaksatra.GetName(vd.astrodata.sunRise.Naksatra)));
                }
                if (GCDisplaySettings.Current.CalColYoga)
                {
                    row.Add(ayog);
                    row.Add(new CDVWord(row, GCYoga.GetName(vd.astrodata.sunRise.Yoga)));
                }
                if (GCDisplaySettings.Current.CalColFast)
                {
                    row.Add(afast);
                    row.Add(new CDVWord(row, vd.nFastID > 0 ? "*" : ""));
                }
                if (GCDisplaySettings.Current.CalColMoonRasi)
                {
                    row.Add(amr);
                    row.Add(new CDVWord(row, GCRasi.GetName(vd.astrodata.sunRise.RasiOfMoon)));
                }

                if (!GCDisplaySettings.Current.CalColCoreEvents)
                {
                    if (GCDisplaySettings.Current.CalColSunrise)
                    {
                        row.Add(amsun1);
                        row.Add(new CDVWord(row, vd.astrodata.sunRise.ToShortTimeString()));
                    }

                    if (GCDisplaySettings.Current.CalColNoon)
                    {
                        row.Add(amsun2);
                        row.Add(new CDVWord(row, vd.astrodata.sunNoon.ToShortTimeString()));
                    }

                    if (GCDisplaySettings.Current.CalColSunset)
                    {
                        row.Add(amsun3);
                        row.Add(new CDVWord(row, vd.astrodata.sunSet.ToShortTimeString()));
                    }
                }

                row = new CDVPara(para, CDVOrientation.Horizontal);
                para.Add(row);

                subRow = new CDVPara(row, CDVOrientation.Vertical);
                row.Add(atithi);
                row.Add(subRow);

                List <VAISNAVAEVENT> evs = vd.VisibleEvents;
                if (evs.Count > 0 && vd.astrodata.sunRise.longitude >= 0.0)
                {
                    foreach (VAISNAVAEVENT ve in evs)
                    {
                        subRow.Add(new CDVPara(null, CDVOrientation.Horizontal,
                                               new CDVWord(null, ve.text)
                                               ));
                    }
                }

                if (GCDisplaySettings.Current.CalColCoreEvents)
                {
                    row.Add(amcore);
                    subRow = new CDVPara(row, CDVOrientation.Vertical);
                    row.Add(subRow);
                    bool show = false;

                    foreach (TCoreEvent tce in vd.coreEvents)
                    {
                        if (tce.nType == CoreEventType.CCTYPE_S_ARUN)
                        {
                            show = GCDisplaySettings.Current.CalColSunrise;
                        }
                        else if (tce.nType == CoreEventType.CCTYPE_S_RISE)
                        {
                            show = GCDisplaySettings.Current.CalColSunrise;
                        }
                        else if (tce.nType == CoreEventType.CCTYPE_S_NOON)
                        {
                            show = GCDisplaySettings.Current.CalColNoon;
                        }
                        else if (tce.nType == CoreEventType.CCTYPE_S_SET)
                        {
                            show = GCDisplaySettings.Current.CalColSunset;
                        }
                        else
                        {
                            show = true;
                        }
                        if (show)
                        {
                            subRow.Add(new CDVPara(null, CDVOrientation.Horizontal, tsWeekday,
                                                   new CDVWord(null, tce.TypeString),
                                                   amcoretime,
                                                   new CDVWord(null, vd.GetCoreEventTime(tce))));
                        }
                    }
                }
            }

            return(para);
        }
Exemplo n.º 6
0
 public string GetTitleString()
 {
     return(string.Format("{0} {1}", GregorianDateTime.GetMonthName(currentMonth), currentYear));
 }