Example #1
0
        public DropDownToolButton(IToolMenu tool, object contextObject)
        {
            _tool          = tool;
            _contextObject = contextObject;

            if (_tool == null || _tool.DropDownTools == null)
            {
                return;
            }

            if (_tool != null && _tool.SelectedTool != null)
            {
                base.Icon   = base.LargeIcon = ImageFactory.FromBitmap(_tool.SelectedTool.Image as System.Drawing.Image);
                base.Header = _tool.SelectedTool.Name;
            }

            foreach (ITool t in _tool.DropDownTools)
            {
                DropDownToolButtonItem item = new DropDownToolButtonItem(this, t);
                item.Click += new RoutedEventHandler(button_Click);
                base.Items.Add(item);
            }
        }
Example #2
0
 public DropDownToolButton(IToolMenu tool)
     : this(tool, null)
 {
 }