Esempio n. 1
0
        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (contextMenuNode == null)
            {
                return;
            }
            // allow user to copy entire entity (along with key valeus and brushes)
            MapEntity entity = contextMenuNode.Tag as MapEntity;

            if (entity != null)
            {
                Clipboard.SetText(entity.ToString());
                return;
            }
            // allow user to copy single brushdef block
            MapBrushBase brush = contextMenuNode.Tag as MapBrushBase;

            if (brush != null)
            {
                Clipboard.SetText(brush.ToString());
                return;
            }
            // allow user to copy single keyvalues list
            KeyValuesList epairs = contextMenuNode.Tag as KeyValuesList;

            if (epairs != null)
            {
                Clipboard.SetText(epairs.ToString());
                return;
            }
        }
Esempio n. 2
0
        public override string ToString()
        {
            string r = "{\n";

            r += keyValues.ToString();
            for (int i = 0; i < brushes.Count; i++)
            {
                r += "// brush " + i + "\n";
                r += brushes[i].ToString();
            }
            r += "}\n";
            return(r);
        }