public ICheckBox CreateCheckBox(string canvas) { IPrototype clone = _checkBoxPrototype.Clone(); clone.Init(canvas); ICheckBox box = (ICheckBox)clone; box.Toggle(); return(box); }
public ICheckBox CreateCheckBox(string canvas) { object[] args = new object[2]; args[0] = canvas; args[1] = _window; args = _checkbox.GetConstructors().Any(c => c.GetParameters().Length == 2) ? args : null; ICheckBox box = (ICheckBox)System.Activator.CreateInstance(_checkbox, args); box.Toggle(); return(box); }