Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
		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;
		}
Exemplo n.º 4
0
		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;
		}
Exemplo n.º 5
0
 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);
         }
     }
 }