private void initialize() { content.AutoScroll = false; // title this.titleBar.Text = poi.getName(); int moreLinkHeight = 15; // description this.descr = new TextBox(); this.descr.AcceptsReturn = true; this.descr.AcceptsTab = true; this.descr.Multiline = true; this.descr.ReadOnly = true; this.descr.ScrollBars = ScrollBars.Vertical; this.descr.Location = new Point(MARGIN, MARGIN); this.descr.Width = this.Width - 2 * MARGIN; this.descr.Height = this.Height - this.closeButton.Height - 3 * MARGIN - moreLinkHeight; this.descr.Text = poi.getDescr(); this.content.Controls.Add(this.descr); this.moreLink = new LinkLabel(); this.moreLink.Text = "more"; this.moreLink.Height = moreLinkHeight; this.moreLink.Width = 50; this.moreLink.Location = new Point(MARGIN, 2 * MARGIN + this.descr.Height); this.moreLink.Click += new EventHandler(gotoPoiBrowser); this.content.Controls.Add(this.moreLink); }
public override string serialize(object obj) { Poi p = (Poi)obj; StringBuilder builder = new StringBuilder(); // opening tag builder.Append("<"); builder.Append(getXmlNodeName()); builder.Append(">"); // lang builder.Append("<lang>"); builder.Append(p.getLang()); builder.Append("</lang>"); // name builder.Append("<name>"); builder.Append(p.getName()); builder.Append("</name>"); // latitude builder.Append("<latitude>"); builder.Append(p.getLatitude()); builder.Append("</latitude>"); // longitude builder.Append("<longitude>"); builder.Append(p.getLongitude()); builder.Append("</longitude>"); // type builder.Append("<type>"); builder.Append(p.getType()); builder.Append("</type>"); // description builder.Append("<descr><![CDATA["); builder.Append(p.getDescr()); builder.Append("]]></descr>"); // media files MediaFilesXmlAdapter mfxa = new MediaFilesXmlAdapter(p.getMediaFiles()); string mediaFilesXml = mfxa.serialize(); builder.Append(mediaFilesXml); // main details MainDetailsXmlAdapter mdxa = new MainDetailsXmlAdapter(p.getMainDetails()); string mainDetailsXml = mdxa.serialize(); builder.Append(mainDetailsXml); // closing tag builder.Append("</"); builder.Append(getXmlNodeName()); builder.Append(">"); return(builder.ToString()); }
/** * Returns poi sub dir by poi and named area */ private string getPoiSubDir(Poi p, NamedArea namedArea) { string dirName = p.getName() + "_" + p.getLatitude() + "_" + p.getLongitude(); return(getPoiSubDir(dirName, namedArea)); }