private void AddMosaicInfoItem(MosaicInfo mosaicInfo) { if (mosaicInfo == null) { return; } string path = DataPathHelper.DataServerMosaicPath + mosaicInfo.datapath; if (!System.IO.File.Exists(path)) { return; } MosaicInfoItem item = MosaicInfoItem.Create(mosaicInfo); if (item == null) { return; } foreach (MosaicInfoItem match in _lstMosaicInfo) { if (match.MosaicInfo.datapath == item.MosaicInfo.datapath) { return; } } _lstMosaicInfo.Add(item); }
void tool_Click(object sender, EventArgs e) { ToolStripItem tool = sender as ToolStripItem; if (tool.Tag is BlockInfoItem) { BlockInfoItem item = tool.Tag as BlockInfoItem; string filename = (DataPathHelper.DataServerBlockPath + item.BlockInfo.datapath); OpenFile(filename); } else if (tool.Tag is OverViewObject) { OverViewObject item = tool.Tag as OverViewObject; string filename = DataPathHelper.ProjectionRootPath + item.ProjectionInfo.datapath; OpenFile(filename); } if (tool.Tag is MosaicInfoItem) { MosaicInfoItem item = tool.Tag as MosaicInfoItem; string filename = (DataPathHelper.DataServerMosaicPath + item.MosaicInfo.datapath); OpenFile(filename); } }
public static MosaicInfoItem Create(MosaicInfo info) { if (info == null) { return(null); } if (string.IsNullOrWhiteSpace(info.datapath)) { return(null); } string fullfilename = DataPathHelper.DataServerMosaicPath + info.datapath; if (!System.IO.File.Exists(fullfilename)) { return(null); } MosaicInfoItem item = new MosaicInfoItem(); item.MosaicInfo = info; item.Name = info.envname; item.Envelope = new CoordEnvelope(info.minx.GetValueOrDefault(), info.maxx.GetValueOrDefault(), info.miny.GetValueOrDefault(), info.maxy.GetValueOrDefault()); return(item); }