private void menuItemImportBitmap_Click(object sender, System.EventArgs e) { Tile tile = GetMapItem(sender) as Tile; if (tile == null) { return; } Template tmpl = tile.GetTemplate(m_tmpdActive); OpenFileDialog frmOpen = new OpenFileDialog(); frmOpen.FileName = tmpl.ImportPath; if (frmOpen.ShowDialog() == DialogResult.Cancel) { return; } tmpl.Import(frmOpen.FileName); }
public void AddTemplates(string[] astrFileBitmap) { ArrayList alsNamesAdded = new ArrayList(); foreach (string strFileBitmap in astrFileBitmap) { Template tmpl = new Template(this, "tmpl" + m_cookie); m_cookie++; if (tmpl.Import(strFileBitmap)) { alsNamesAdded.Add(tmpl.Name); m_alsTemplates.Add(tmpl); } } if (alsNamesAdded.Count != 0) { TemplateDocTemplate doct = (TemplateDocTemplate)m_doct; doct.OnTemplatesAdded(this, (string[])alsNamesAdded.ToArray(typeof(string))); } SetModified(true); }
public void AddTemplates(string[] astrFileBitmap) { ArrayList alsNamesAdded = new ArrayList(); foreach (string strFileBitmap in astrFileBitmap) { Template tmpl = new Template(this, "tmpl" + m_cookie); m_cookie++; if (tmpl.Import(strFileBitmap)) { alsNamesAdded.Add(tmpl.Name); m_alsTemplates.Add(tmpl); } } if (alsNamesAdded.Count != 0) { TemplateDocTemplate doct = (TemplateDocTemplate)m_doct; doct.OnTemplatesAdded(this, (string[])alsNamesAdded.ToArray(typeof(string))); } SetModified(true); }