public bool SetControllerOutputCount(IControllerDevice controller) { using (NumberDialog nd = new NumberDialog("Controller Output Count", "Outputs on this controller?", controller.OutputCount)) { if (nd.ShowDialog() == DialogResult.OK) { // TODO: blergh, dodgy hack (controller as OutputController).OutputCount = nd.Value; OnControllersChanged(); PopulateControllerTree(); return(true); } } return(false); }
public bool AddNewControllerOfTypeWithPrompts(Guid controllerTypeId) { IModuleDescriptor moduleDescriptor = ApplicationServices.GetModuleDescriptor(controllerTypeId); if (moduleDescriptor == null) { Logging.Error("couldn't get descriptor for controller of type ID: " + controllerTypeId); return(false); } string defaultName = moduleDescriptor.TypeName; string name; using (TextDialog textDialog = new TextDialog("New Controller Name?", "Controller Name", defaultName, true)) { if (textDialog.ShowDialog() != DialogResult.OK) { return(false); } name = textDialog.Response; if (name.Length <= 0) { name = defaultName; } } int outputCount; using (NumberDialog nd = new NumberDialog("Controller Output Count", "Outputs on this controller?", 0)) { if (nd.ShowDialog() != DialogResult.OK) { return(false); } outputCount = nd.Value; } ControllerFactory controllerFactory = new ControllerFactory(); OutputController oc = (OutputController)controllerFactory.CreateDevice(controllerTypeId, name); oc.OutputCount = outputCount; VixenSystem.OutputControllers.Add(oc); //PopulateControllerTree(oc); AddControllerToTree(oc); OnControllersChanged(); return(true); }
public bool SetControllerOutputCount(IControllerDevice controller) { using (NumberDialog nd = new NumberDialog("Controller Output Count", "Outputs on this controller?", controller.OutputCount)) { if (nd.ShowDialog() == DialogResult.OK) { // TODO: blergh, dodgy hack (controller as OutputController).OutputCount = nd.Value; OnControllersChanged(); PopulateControllerTree(); return true; } } return false; }
public bool AddNewControllerOfTypeWithPrompts(Guid controllerTypeId) { IModuleDescriptor moduleDescriptor = ApplicationServices.GetModuleDescriptor(controllerTypeId); if (moduleDescriptor == null) { Logging.Error("couldn't get descriptor for controller of type ID: " + controllerTypeId); return false; } string defaultName = moduleDescriptor.TypeName; string name; using (TextDialog textDialog = new TextDialog("New Controller Name?", "Controller Name", defaultName, true)) { if (textDialog.ShowDialog() != DialogResult.OK) return false; name = textDialog.Response; if (name.Length <= 0) name = defaultName; } int outputCount; using (NumberDialog nd = new NumberDialog("Controller Output Count", "Outputs on this controller?", 0)) { if (nd.ShowDialog() != DialogResult.OK) return false; outputCount = nd.Value; } ControllerFactory controllerFactory = new ControllerFactory(); OutputController oc = (OutputController)controllerFactory.CreateDevice(controllerTypeId, name); oc.OutputCount = outputCount; VixenSystem.OutputControllers.Add(oc); PopulateControllerTree(oc); OnControllersChanged(); return true; }
private void PasteClipboardFiltersMultipleTimes() { Point cursor = Cursor.Position; using ( NumberDialog numberDialog = new NumberDialog("Number of Copies", "How many copies of the given filter(s)?", 1, 1, 1000)) { if (numberDialog.ShowDialog() == DialogResult.OK) { PasteClipboardFilters(cursor, numberDialog.Value); } } }