예제 #1
0
        public static int FormatEventsRtf(GPCoreEventResults inEvents, StringBuilder res)
        {
            int i;

            AppendRtfHeader(res);

            res.AppendFormat("{\\fs{0}\\f2 ", g_Header2Size, g_TextSize);
            res.AppendFormat(getSharedStringRtf(983), inEvents.m_vcStart, inEvents.m_vcEnd);
            res.AppendLine("} \\par");
            List <GPLocation> locList = inEvents.getLocationList();

            foreach (GPLocation loc in locList)
            {
                res.Append(loc.getFullName());
                res.AppendLine("\\par");
            }
            res.AppendLine();

            //res.AppendFormat(inEvents.m_location.getFullName());
            //res.AppendLine("\\par");
            res.AppendLine("\\par");

            DateTime prevd = new DateTime(1970, 1, 1);
            int      prevt = -1;

            for (i = 0; i < inEvents.getCount(); i++)
            {
                GPCoreEvent dnr = inEvents.get(i);

                if (inEvents.b_sorted)
                {
                    DateTime dt = dnr.Time.getLocalTime();
                    if (prevd.Day != dt.Day || prevd.Month != dt.Month || prevd.Year != dt.Year)
                    {
                        res.AppendLine("\\par");
                        res.Append(GPAppHelper.CenterString(dnr.Time.getCompleteLongDateString(), 60, '-'));
                        res.AppendLine("\\par");
                        res.AppendLine("\\par");
                    }
                    prevd = dt;
                }
                else
                {
                    if (prevt != dnr.nType)
                    {
                        string s = " " + dnr.getTypeTitle() + " ";
                        res.AppendLine("\\par");
                        res.Append(GPAppHelper.CenterString(s, 60, '-'));
                        res.AppendLine("\\par");
                        res.AppendLine("\\par");
                    }
                    prevt = dnr.nType;
                }

                if (!inEvents.b_sorted)
                {
                    res.Append(dnr.Time.ToString().PadLeft(20));
                }

                GPLocation loc = dnr.Time.getLocation();
                res.AppendFormat("  {0}  {1} {2} {3} {4}", dnr.Time.getLongTimeString(), dnr.getEventTitle().PadRight(45),
                                 loc.getTimeZoneName().PadRight(32), loc.getLongitudeString().PadLeft(6), loc.getLatitudeString().PadLeft(6));
                res.AppendLine("\\par");
            }

            res.AppendLine("\\par");

            AddNoteRtf(res);

            res.AppendLine("}");


            return(1);
        }
예제 #2
0
 public object getLocationDescription()
 {
     return(String.Format("{0} {1}, {2}", defaultLocation.getLatitudeString(), defaultLocation.getLongitudeString(), defaultLocation.getTimeZoneString()));
 }