public Tile(SerializationInfo info, StreamingContext ctx) : base(info, ctx) { m_strName = null; try { m_strName = info.GetString("Name"); } catch { m_strName = info.GetInt32("Cookie").ToString(); } m_afVisible = (bool[, ])info.GetValue("Visibility", typeof(bool[, ])); try { m_afOccupancy = (bool[, ])info.GetValue("Occupancy", typeof(bool[, ])); } catch { TemplateDoc tmpd = (TemplateDoc)DocManager.GetActiveDocument(typeof(TemplateDoc)); Template tmpl = tmpd.FindTemplate(m_strName); if (tmpl != null) { m_afOccupancy = tmpl.OccupancyMap; } else { m_afOccupancy = new bool[1, 1]; } } InitCommon(); }
void TemplateDocTemplate_TemplateChanged(TemplateDoc tmpd, string strProperty, string strName, string strParam) { ComboItem ci = FindComboItem(tmpd); foreach (PictureBox picb in ci.m_alsPictureBoxes) { Tile tile = (Tile)picb.Tag; if (tile.Name == strName) { Template tmpl = tmpd.FindTemplate(strProperty == "Name" ? strParam : strName); picb.Image = Misc.TraceEdges(tmpl.Bitmap, 1, Color.Azure); break; } } if (tmpd == m_tmpdActive) { FillPanel(ci.m_alsPictureBoxes); } }
public Template GetTemplate(TemplateDoc tmpd) { if (tmpd == m_tmpdCache) { return(m_tmplCache); } m_tmpdCache = null; m_tmplCache = null; m_bmCache = null; if (tmpd == null) { return(null); } Template tmpl = tmpd.FindTemplate(m_strName); if (tmpl != null) { m_tmpdCache = tmpd; m_tmplCache = tmpl; m_afOccupancy = tmpl.OccupancyMap; return(tmpl); } return(null); }
public Template GetTemplate(TemplateDoc tmpd) { if (tmpd == m_tmpdCache) return m_tmplCache; m_tmpdCache = null; m_tmplCache = null; m_bmCache = null; if (tmpd == null) return null; Template tmpl = tmpd.FindTemplate(m_strName); if (tmpl != null) { m_tmpdCache = tmpd; m_tmplCache = tmpl; m_afOccupancy = tmpl.OccupancyMap; return tmpl; } return null; }
void TemplateDocTemplate_TemplateChanged(TemplateDoc tmpd, string strProperty, string strName, string strParam) { ComboItem ci = FindComboItem(tmpd); foreach (PictureBox picb in ci.m_alsPictureBoxes) { Tile tile = (Tile)picb.Tag; if (tile.Name == strName) { Template tmpl = tmpd.FindTemplate(strProperty == "Name" ? strParam : strName); picb.Image = Misc.TraceEdges(tmpl.Bitmap, 1, Color.Azure); break; } } if (tmpd == m_tmpdActive) FillPanel(ci.m_alsPictureBoxes); }