예제 #1
0
        private void DisplayFeed(int day, SampleDataItem item, FlipViewItem selectedFlipViewItem)
        {
            TextBlock    t;
            PanchangData pdata = item.GetPanchangData(_currentMonth, day);

            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "SunriseTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Sunrise];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "SunsetTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Sunset];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "MoonRiseTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Moonrise];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "TamilYearTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.TamilYear];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "NorthYearTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.NorthYear];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "GujaratYearTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.GujaratYear];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "AyanaTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Ayana];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "RituTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Ritu];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "VedicRituTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.VedicRitu];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "TamilMonthTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.TamilMonth];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "SanskritMonthTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.SanskritMonth];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "PakshaTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Paksha];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "TithiTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Tithi];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "NakshatraTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Nakshatra];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "YogaTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Yoga];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "KaranaTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Karana];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "SunRasiTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.SunRasi];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "MoonRasiTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.MoonRasi];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "RahuKalamTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.RahuKalam];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "YamaKandamTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.YamaGandam];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "GulikaiTextBlock");
            t.Text = pdata._fieldValues[(int)FieldType.Gulikai];
            t      = (TextBlock)FindNamedElement(selectedFlipViewItem, "FestivalTextBlock");
            String festival = pdata._fieldValues[(int)FieldType.Festival];

            if (String.IsNullOrEmpty(festival))
            {
                festival = "No festival";
            }
            t.Text = festival;
        }
        //Update tile for today
        private void UpdateTile(CalendarDataReader reader, DateTime dueTime)
        {
            int          month = dueTime.Month;
            int          day   = dueTime.Day;
            PanchangData pdata = reader.GetPanchangData(month, day);
            //create the wide template
            ITileWideText01 tileContent = TileContentFactory.CreateTileWideText01();

            tileContent.TextHeading.Text = dueTime.ToString("d");
            // Uncomment the following line to enable debugging
            tileContent.TextBody1.Text = pdata._fieldValues[(int)FieldType.SanskritMonth];
            tileContent.TextBody2.Text = pdata._fieldValues[(int)FieldType.TamilMonth];
            tileContent.TextBody3.Text = pdata._fieldValues[(int)FieldType.Festival];

            //create the square template and attach it to the wide template
            ITileSquareText01 squareContent = TileContentFactory.CreateTileSquareText01();

            squareContent.TextHeading.Text = dueTime.ToString("d");
            squareContent.TextBody1.Text   = pdata._fieldValues[(int)FieldType.SanskritMonth];
            squareContent.TextBody2.Text   = pdata._fieldValues[(int)FieldType.TamilMonth];
            squareContent.TextBody3.Text   = pdata._fieldValues[(int)FieldType.Festival];
            tileContent.SquareContent      = squareContent;


            if (dueTime > DateTime.Now)
            {
                ScheduledTileNotification futureTile = new ScheduledTileNotification(tileContent.GetXml(), dueTime);
                TileUpdateManager.CreateTileUpdaterForApplication().AddToSchedule(futureTile);
            }
            else
            {
                //send the notification
                //TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());
            }

            //Send another notification. this gives a nice animation in mogo
            tileContent.TextBody1.Text = pdata._fieldValues[(int)FieldType.Paksha];
            tileContent.TextBody2.Text = pdata._fieldValues[(int)FieldType.Tithi];
            tileContent.TextBody3.Text = pdata._fieldValues[(int)FieldType.Nakshatra];

            if (dueTime > DateTime.Now)
            {
                ScheduledTileNotification futureTile = new ScheduledTileNotification(tileContent.GetXml(), dueTime);
                TileUpdateManager.CreateTileUpdaterForApplication().AddToSchedule(futureTile);
            }
            else
            {
                //send the notification
                //TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());
            }
        }
예제 #3
0
        public void ShowDetail(int currentMonth, int day, SampleDataItem item)
        {
            PanchangData pdata    = item.GetPanchangData(currentMonth, day);
            DateTime     dateTime = new DateTime(item.Year, currentMonth, day);

            DateTextBlock.Text        = dateTime.ToString("d");
            SunriseTextBlock.Text     = pdata._fieldValues[(int)FieldType.Sunrise];
            SunsetTextBlock.Text      = pdata._fieldValues[(int)FieldType.Sunset];
            MoonRiseTextBlock.Text    = pdata._fieldValues[(int)FieldType.Moonrise];
            TamilYearTextBlock.Text   = (pdata._fieldValues[(int)FieldType.TamilYear] == null) ? "None" : pdata._fieldValues[(int)FieldType.TamilYear];
            NorthYearTextBlock.Text   = pdata._fieldValues[(int)FieldType.NorthYear];
            GujaratYearTextBlock.Text = pdata._fieldValues[(int)FieldType.GujaratYear];
            AyanaTextBlock.Text       = pdata._fieldValues[(int)FieldType.Ayana];
            RituTextBlock.Text        = pdata._fieldValues[(int)FieldType.Ritu];
            VedicRituTextBlock.Text   = pdata._fieldValues[(int)FieldType.VedicRitu];
            TamilMonthTextBlock.Text  = pdata._fieldValues[(int)FieldType.TamilMonth];
            // there is a whitespace in front of this string
            SanskritMonthTextBlock.Text = (pdata._fieldValues[(int)FieldType.SanskritMonth]).Trim();
            PakshaTextBlock.Text        = (pdata._fieldValues[(int)FieldType.Paksha]).Trim();
            TithiTextBlock.Text         = pdata._fieldValues[(int)FieldType.Tithi];
            NakshatraTextBlock.Text     = pdata._fieldValues[(int)FieldType.Nakshatra];
            YogaTextBlock.Text          = pdata._fieldValues[(int)FieldType.Yoga];
            KaranaTextBlock.Text        = pdata._fieldValues[(int)FieldType.Karana];
            SunRasiTextBlock.Text       = pdata._fieldValues[(int)FieldType.SunRasi];
            MoonRasiTextBlock.Text      = pdata._fieldValues[(int)FieldType.MoonRasi];
            RahuKalamTextBlock.Text     = pdata._fieldValues[(int)FieldType.RahuKalam];
            YamaKandamTextBlock.Text    = pdata._fieldValues[(int)FieldType.YamaGandam];
            GulikaiTextBlock.Text       = pdata._fieldValues[(int)FieldType.Gulikai];
            String festival = item.GetFestival(currentMonth, day);

            if (String.IsNullOrEmpty(festival))
            {
                festival = "No data";
            }
            FestivalTextBlock.Text = festival;
            PersonalEventListScroller.Visibility = Visibility.Collapsed;
            Separator.BorderThickness            = new Thickness(0, 0, 0, 0);
            PersonalEventList.Items.Clear();
            if (_privateEvents != null)
            {
                List <PrivateEvent> privateEventList = _privateEvents.GetEventsForDate(dateTime);
                foreach (PrivateEvent evt in privateEventList)
                {
                    AddPrivateEvent(dateTime, evt._eventText, false, evt);
                }
            }
        }
예제 #4
0
        // Update tile for today
        private void UpdateTile(SampleDataItem item, DateTime dueTime, DateTime expiryTime)
        {
            DateTime date  = dueTime;
            int      month = date.Month;
            int      day   = date.Day;
            String   festival;
            var      notifier = TileUpdateManager.CreateTileUpdaterForApplication();

            Debug.WriteLine("Update tile {0} {1}", dueTime, expiryTime);
            festival = item.GetFestival(month, day);
            PanchangData pdata = item.GetPanchangData(month, day);
            // create the wide template
            ITileWideText01 tileContent = TileContentFactory.CreateTileWideText01();

            tileContent.TextHeading.Text = date.ToString("d");
            tileContent.TextBody1.Text   = pdata._fieldValues[(int)FieldType.SanskritMonth];
            tileContent.TextBody2.Text   = pdata._fieldValues[(int)FieldType.TamilMonth];
            tileContent.TextBody3.Text   = festival;

            // create the square template and attach it to the wide template
            ITileSquareText01 squareContent = TileContentFactory.CreateTileSquareText01();

            squareContent.TextHeading.Text = date.ToString("d");
            squareContent.TextBody1.Text   = pdata._fieldValues[(int)FieldType.SanskritMonth];
            squareContent.TextBody2.Text   = pdata._fieldValues[(int)FieldType.TamilMonth];
            squareContent.TextBody3.Text   = festival;
            tileContent.SquareContent      = squareContent;

            // send the notification
            ScheduledTileNotification futureTile = new ScheduledTileNotification(tileContent.GetXml(), dueTime);

            futureTile.ExpirationTime = expiryTime;
            notifier.AddToSchedule(futureTile);


            // Send another notification. this gives a nice animation in mogo
            tileContent.TextBody1.Text = pdata._fieldValues[(int)FieldType.Paksha];
            tileContent.TextBody2.Text = pdata._fieldValues[(int)FieldType.Tithi];
            tileContent.TextBody3.Text = pdata._fieldValues[(int)FieldType.Nakshatra];
            futureTile = new ScheduledTileNotification(tileContent.GetXml(), dueTime);
            futureTile.ExpirationTime = expiryTime;
            notifier.AddToSchedule(futureTile);
            Debug.WriteLine("Count of scheduled notifications {0}", notifier.GetScheduledTileNotifications().Count);
        }
예제 #5
0
        private void BuildCalendar(Grid monthView, int month, SampleDataItem item)
        {
            int row, col;

            DateItem[,] dateItems;

            if (monthView.Tag == null)
            {
                dateItems = new DateItem[numRows, numCols];

                for (row = 0; row < numRows; row++)
                {
                    for (col = 0; col < numCols; col++)
                    {
                        DateItem dateItem = new DateItem();
                        dateItem.SetValue(Grid.RowProperty, row);
                        dateItem.SetValue(Grid.ColumnProperty, col);
                        monthView.Children.Add(dateItem);
                        dateItems[row, col] = dateItem;
                        if (row == 0)
                        {
                            DayOfWeek day = (DayOfWeek)col;
                            dateItem.SetDay(_dayStrings[(int)day]);
                        }
                        else
                        {
                            dateItem.SetDay(" ");
                            dateItem.PointerReleased += dateItem_PointerReleased;
                        }
                    }
                }
                monthView.Tag = dateItems;
            }

            // collapse them all to be opened later
            dateItems = (DateItem[, ])monthView.Tag;
            for (row = 1; row < numRows; row++)
            {
                for (col = 0; col < numCols; col++)
                {
                    dateItems[row, col].Visibility = Visibility.Collapsed;
                }
            }

            String   previousTamilMonth, tamilMonth;
            String   previousSanskritMonth, sanskritMonth;
            String   previousPaksha, paksha;
            bool     fullMoonDayFound = false;
            bool     newMoonDayFound  = false;
            DateItem currentDateItem  = null;

            row = 1;
            previousTamilMonth    = null;
            previousSanskritMonth = null;

            previousPaksha          = "";
            tamilMonthTitle.Text    = "";
            sanskritMonthTitle.Text = "";
            for (int day = 1; day <= 31; day++)
            {
                DateTime dateTime;
                try
                {
                    dateTime = new DateTime(item.Year, month, day);
                    col      = (int)dateTime.DayOfWeek;

                    String festival, nakshatra;
                    bool   isNewMoonDay, isFullMoonDay;
                    bool   highlight;

                    item.GetDateData(month, day, out isNewMoonDay, out isFullMoonDay, out festival, out paksha, out nakshatra, out tamilMonth);
                    PanchangData pdata = item.GetPanchangData(month, day);
                    sanskritMonth = pdata._fieldValues[(int)FieldType.SanskritMonth];

                    if (isNewMoonDay)
                    {
                        newMoonDayFound = true;
                    }

                    if (isFullMoonDay)
                    {
                        fullMoonDayFound = true;
                    }

                    // Sometimes the tithi changes in the middle of the day and is not captured. Lets fix it here
                    if ((previousPaksha.Contains("Shukla") == true) && (paksha.Contains("Krishna") == true) && (fullMoonDayFound == false))
                    {
                        // Set the previous item to full moon day
                        currentDateItem.SetDay(currentDateItem.GetDay(), false, true, null, null, "KeepExisting");
                    }

                    // Sometimes the tithi changes in the middle of the day and is not captured. Lets fix it here
                    if ((previousPaksha.Contains("Krishna") == true) && (paksha.Contains("Shukla") == true) && (newMoonDayFound == false))
                    {
                        // Set the previous item to new moon day
                        currentDateItem.SetDay(currentDateItem.GetDay(), true, false, null, null, "KeepExisting");
                    }

                    previousPaksha = paksha;

                    currentDateItem = dateItems[row, col];
                    PrivateEvent evt = null;
                    if (_privateEvents != null)
                    {
                        evt = _privateEvents.GetFirstEventForDate(dateTime);
                    }

                    if (evt != null)
                    {
                        currentDateItem.SetDay(day,
                                               isNewMoonDay, isFullMoonDay, evt._eventText, null, nakshatra);
                    }
                    else
                    {
                        currentDateItem.SetDay(day,
                                               isNewMoonDay, isFullMoonDay, festival, null, nakshatra);
                    }

                    currentDateItem.Visibility = Visibility.Visible;
                    if (String.Equals(previousTamilMonth, tamilMonth, StringComparison.OrdinalIgnoreCase) == false)
                    {
                        tamilMonthTitle.Text += (previousTamilMonth == null) ? tamilMonth : ("-" + tamilMonth);
                        previousTamilMonth    = tamilMonth;
                    }

                    if (String.Equals(previousSanskritMonth, sanskritMonth, StringComparison.OrdinalIgnoreCase) == false)
                    {
                        sanskritMonthTitle.Text += ((previousSanskritMonth == null) ? sanskritMonth : ("-" + sanskritMonth.Trim()));
                        previousSanskritMonth    = sanskritMonth;
                    }

                    highlight = false;
                    // If its the curent month then highlight the current day
                    if (month == DateTime.Today.Month)
                    {
                        if (day == DateTime.Today.Day)
                        {
                            // Highlight today
                            highlight = true;
                        }
                    }
                    else if (day == 1)
                    {
                        // Highlight the first day of some other month
                        highlight = true;
                    }

                    if (highlight)
                    {
                        currentDateItem.HighlightBorder(true);
                        ShowDetail(month, day, item);
                        _currentHighlightedDateItem = currentDateItem;
                    }

                    if (col == (numCols - 1))
                    {
                        row++;
                        if (row == numRows)
                        {
                            row = 1; // Reset it back to the first row. Provides a foldable calender
                        }
                    }
                }
                catch (ArgumentOutOfRangeException)
                {
                }
            }
        }
예제 #6
0
파일: Calender.cs 프로젝트: sai455/DonorApp
        public static PanchangData GetCalendarDataPerCityAndYear(int date, int month, int Year, String UrlToken, TimeZoneValues timeZone)
        {
            var dayResult = new PanchangData();

            HtmlAgilityPack.HtmlWeb web = new HtmlWeb();
            YearlyPanchangData      yearPanchangData = new YearlyPanchangData();

            PanchangData[] panchangData = new PanchangData[12 * 31];
            yearPanchangData._panchangData = panchangData;
            int    day                 = 0;
            String fileName            = String.Format("{0}RssFeed\\Calendar-{1}-{2}.html", AppDomain.CurrentDomain.BaseDirectory, month, Year);
            DataContractSerializer ser = new DataContractSerializer(typeof(YearlyPanchangData));

            try
            {
                HtmlDocument document = new HtmlDocument();
                if (File.Exists(fileName))
                {
                    document.Load(fileName);
                    //using (var stream = File.Open(fileName, FileMode.Open, FileAccess.Write, FileShare.Read))
                    //{

                    //}
                }
                else
                {
                    FileStream fs  = new FileStream(fileName, FileMode.Create);
                    String     url = String.Format("http://www.mypanchang.com/phppanchang.php?yr={0}&cityhead=&cityname={2}&monthtype=0&mn={1}", Year, month - 1, UrlToken);
                    try
                    {
                        var data = web.Load(url);
                        document = data;
                        var sr = new StreamWriter(fs);
                        sr.Write(data.Text);
                    }
                    catch (Exception exp)
                    {
                    }
                }
                day = 0;
                PanchangData pData = null;
                String       log   = null;
                foreach (HtmlNode node in document.DocumentNode.SelectNodes("//table"))
                {
                    HtmlNodeCollection coll = node.ChildNodes;
                    foreach (HtmlNode data in coll)
                    {
                        log += data.InnerText.Trim();
                        log += "\n";
                        log += "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++";
                        log += "\n";
                        //Console.WriteLine(log);
                        String input    = data.InnerText;
                        String pattern1 = @"Panchang for";
                        Match  match    = Regex.Match(input, pattern1);
                        if (match.Success)
                        {
                            if (pData != null)
                            {
                                //    Console.WriteLine("Year {0} Month {1} Day {2}", Year, month, day);
                                for (int j = 0; j < (int)(FieldType.MaxFields); j++)
                                {
                                    if ((j != (int)FieldType.None) && (j != (int)FieldType.TamilYear) && (j != (int)FieldType.Festival))
                                    {
                                        if (pData._fieldValues[j] == null)
                                        {
                                            Console.WriteLine("Field Value {0} is null", ((FieldType)j).ToString());
                                            Console.WriteLine(log);
                                        }
                                    }

                                    //Console.WriteLine("{0}: {1}", (FieldType)j, pData._fieldValues[j]);
                                }
                                // Stash away the old data
                                panchangData[(month - 1) * 31 + (day - 1)] = pData;
                            }
                            ;
                            // A new day got started.
                            pData = new PanchangData(Year, month, day + 1);
                            day++;
                            log = null;
                            //if (day > 30) break;
                        }

                        pattern1 = @"Shalivahan Shaka: (\d\d\d\d) \((\w+) Samvatsara\),\&nbsp;(\w+) Year \(North India\) (\d\d\d\d),\&nbsp;(\w+ \w+) \(Gujarat\) (\d\d\d\d),\&nbsp; Ayana:(\w+) \&nbsp;Ritu:(\w+),  Vedic Ritu:(\w+), Amavasyant\s+(\w+) (\w+) Paksha,\&nbsp;Tamil Month: (\w+)";
                        // Shalivahan Shaka: 1937 (Manmatha Samvatsara),&nbsp;Vikrami Year (North India) 2072,&nbsp;Vikram Samvat (Gujarat) 2071,&nbsp; Ayana:Uttarayana &nbsp;Ritu:Grishma,  Vedic Ritu:Grishma, Amavasyant Adhika Ashaadha Shukla Paksha,&nbsp;Tamil Month: Aani

                        match        = Regex.Match(input, pattern1);
                        currentIndex = 0;
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.TamilYear]     = match.Groups[2].Value + " " + match.Groups[1].Value;
                            pData._fieldValues[(int)FieldType.NorthYear]     = match.Groups[3].Value + " " + match.Groups[4].Value;
                            pData._fieldValues[(int)FieldType.GujaratYear]   = match.Groups[5].Value + " " + match.Groups[6].Value;
                            pData._fieldValues[(int)FieldType.Ayana]         = match.Groups[7].Value;
                            pData._fieldValues[(int)FieldType.Ritu]          = match.Groups[8].Value;
                            pData._fieldValues[(int)FieldType.VedicRitu]     = match.Groups[9].Value;
                            pData._fieldValues[(int)FieldType.SanskritMonth] = match.Groups[10].Value;
                            pData._fieldValues[(int)FieldType.Paksha]        = match.Groups[11].Value;
                            pData._fieldValues[(int)FieldType.TamilMonth]    = match.Groups[12].Value;
                            pData._fieldValues[(int)FieldType.Festival]      = null;
                        }

                        // For some cases there is an extra word after Amavasyant
                        String pattern1_5 = @"Shalivahan Shaka: (\d\d\d\d) \((\w+) Samvatsara\),\&nbsp;(\w+) Year \(North India\) (\d\d\d\d),\&nbsp;(\w+ \w+) \(Gujarat\) (\d\d\d\d),\&nbsp; Ayana:(\w+) \&nbsp;Ritu:(\w+),  Vedic Ritu:(\w+), Amavasyant\s+\w+ (\w+) (\w+) Paksha,\&nbsp;Tamil Month: (\w+)";
                        // Shalivahan Shaka: 1937 (Manmatha Samvatsara),&nbsp;Vikrami Year (North India) 2072,&nbsp;Vikram Samvat (Gujarat) 2071,&nbsp; Ayana:Uttarayana &nbsp;Ritu:Grishma,  Vedic Ritu:Grishma, Amavasyant Adhika Ashaadha Shukla Paksha,&nbsp;Tamil Month: Aani

                        match        = Regex.Match(input, pattern1_5);
                        currentIndex = 0;
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.TamilYear]     = match.Groups[2].Value + " " + match.Groups[1].Value;
                            pData._fieldValues[(int)FieldType.NorthYear]     = match.Groups[3].Value + " " + match.Groups[4].Value;
                            pData._fieldValues[(int)FieldType.GujaratYear]   = match.Groups[5].Value + " " + match.Groups[6].Value;
                            pData._fieldValues[(int)FieldType.Ayana]         = match.Groups[7].Value;
                            pData._fieldValues[(int)FieldType.Ritu]          = match.Groups[8].Value;
                            pData._fieldValues[(int)FieldType.VedicRitu]     = match.Groups[9].Value;
                            pData._fieldValues[(int)FieldType.SanskritMonth] = match.Groups[10].Value;
                            pData._fieldValues[(int)FieldType.Paksha]        = match.Groups[11].Value;
                            pData._fieldValues[(int)FieldType.TamilMonth]    = match.Groups[12].Value;
                            pData._fieldValues[(int)FieldType.Festival]      = null;
                        }

                        // @"Sunrise:07:36:10Sunset:17:08:38Moonrise:23:54:46";
                        String pattern2 = @"Sunrise:([\d:]+)Sunset:([\d:]+)Moonrise:([\d:]+)";
                        match = Regex.Match(input, pattern2);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.Sunrise]  = match.Groups[1].Value;
                            pData._fieldValues[(int)FieldType.Sunset]   = match.Groups[2].Value;
                            pData._fieldValues[(int)FieldType.Moonrise] = match.Groups[3].Value;
                        }

                        pattern2 = @"Sunrise:([\d:]+)Sunset:([\d:]+)Moonrise:None";
                        match    = Regex.Match(input, pattern2);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.Sunrise]  = match.Groups[1].Value;
                            pData._fieldValues[(int)FieldType.Sunset]   = match.Groups[2].Value;
                            pData._fieldValues[(int)FieldType.Moonrise] = "None";
                        }

                        String pattern3 = @"Sun:(\w+)Entering";
                        match = Regex.Match(input, pattern3);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.SunRasi] = match.Groups[1].Value;
                        }

                        String pattern4 = @"Chandra:(\w+)Entering";
                        match = Regex.Match(input, pattern4);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.MoonRasi] = match.Groups[1].Value;
                        }

                        String pattern5 = @"Chandra:(\w+)Entering";
                        match = Regex.Match(input, pattern5);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.MoonRasi] = match.Groups[1].Value;
                        }

                        pattern1 = @"Tithi:([\w ]+)End time:[\w \d:+]+Nakshatra:([\w\.]+) ";
                        match    = Regex.Match(input, pattern1);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.Tithi]     = match.Groups[1].Value;
                            pData._fieldValues[(int)FieldType.Nakshatra] = match.Groups[2].Value;
                        }
                        //Rahukalam:11:10:50-12:22:24Yamagandam:14:45:31-15:57:05Gulikai:08:47:43-09:59:17Abhijit Muhurta:12:03:19-12:41:29
                        pattern1 = @"Rahukalam:([\d:-]+)Yamagandam:([\d:-]+)Gulikai:([\d:-]+)";
                        match    = Regex.Match(input, pattern1);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.RahuKalam]  = match.Groups[1].Value;
                            pData._fieldValues[(int)FieldType.YamaGandam] = match.Groups[2].Value;
                            pData._fieldValues[(int)FieldType.Gulikai]    = match.Groups[3].Value;
                        }

                        pattern1 = @"Yoga:(\w+)End";
                        match    = Regex.Match(input, pattern1);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.Yoga] = match.Groups[1].Value;
                        }

                        pattern1 = @"Karana:(\w+)End";
                        match    = Regex.Match(input, pattern1);
                        if (match.Success)
                        {
                            pData._fieldValues[(int)FieldType.Karana] = match.Groups[1].Value;
                        }
                    }
                }
                panchangData[(month - 1) * 31 + (day - 1)] = pData;
                dayResult = panchangData.Where(x => !Object.ReferenceEquals(x, null) && x.Day == date).FirstOrDefault();
            }
            catch (Exception e)
            {
                //List<Process> locks = Win32Processes.GetProcessesLockingFile(fileName);
            }
            return(dayResult);
        }