// Constructor
        public EditModeInfo(Plugin plugin, Type type, EditModeAttribute attr)
        {
            // Initialize
            this.plugin  = plugin;
            this.type    = type;
            this.attribs = attr;

            // Make switch action info
            if (!string.IsNullOrEmpty(attribs.SwitchAction))
            {
                switchactionattr = new BeginActionAttribute(attribs.SwitchAction);
            }

            // Make button info
            if (attr.ButtonImage != null)
            {
                using (Stream buttonimagestream = plugin.GetResourceStream(attr.ButtonImage))
                {
                    if (buttonimagestream != null)
                    {
                        buttonimage = Image.FromStream(buttonimagestream);
                        buttondesc  = attr.DisplayName;
                        buttonorder = attr.ButtonOrder;
                    }
                }
            }

            // We have no destructor
            GC.SuppressFinalize(this);
        }
        /// <summary>
        /// Provides basic user input interface functionality for a Doom Builder editing mode.
        /// </summary>
        public EditMode()
        {
            // Fetch attributes
            object[] attrs = this.GetType().GetCustomAttributes(true);
            foreach (object a in attrs)
            {
                if (a is EditModeAttribute)
                {
                    attributes = (EditModeAttribute)a;
                    break;
                }
            }

            // No attributes found?
            if (attributes == null)
            {
                throw new Exception("Editing mode \"" + this.GetType().Name + "\" is missing EditMode attributes!");
            }

            // We have no destructor
            GC.SuppressFinalize(this);
        }