protected override void customizeEditInterface(EditInterface editInterface)
        {
            base.customizeEditInterface(editInterface);

            this.editInterface = editInterface;

            editInterface.addSubInterfaceForObject(tags, new StringListlikeEditInterface(tags, "Tags",
                                                                                         validateCallback: () =>
            {
                if (this.Tags.Any(t => String.IsNullOrWhiteSpace(t)))
                {
                    throw new ValidationException("Cannot accept blank tags. Please remove any blank entries.");
                }
            }));
            editInterface.addSubInterfaceForObject(systems, new StringListlikeEditInterface(systems, "Systems",
                                                                                            validateCallback: () =>
            {
                if (this.systems.Any(t => String.IsNullOrWhiteSpace(t)))
                {
                    throw new ValidationException("Cannot accept blank systems. Please remove any blank entries.");
                }
            }));
            editInterface.addSubInterfaceForObject(connections, new StringListlikeEditInterface(connections, "Connections",
                                                                                                validateCallback: () =>
            {
                if (this.connections.Any(t => String.IsNullOrWhiteSpace(t)))
                {
                    throw new ValidationException("Cannot accept blank connections. Please remove any blank entries.");
                }
            }));

            //Commands
            EditInterface commandsEditInterface = new EditInterface("Commands");

            commandsEditInterface.addCommand(new EditInterfaceCommand("Add Command", cb =>
            {
                if (anatomyCommandBrowser == null)
                {
                    anatomyCommandBrowser = new AnatomyCommandBrowser();
                }
                cb.showBrowser(anatomyCommandBrowser, delegate(Object result, ref String errorMessage)
                {
                    Type commandType = result as Type;
                    if (commandType != null)
                    {
                        this.addCommand((AnatomyCommand)Activator.CreateInstance(commandType));
                        return(true);
                    }
                    return(false);
                });
            }));

            var commandEditInterfaces = commandsEditInterface.createEditInterfaceManager <AnatomyCommand>(i => i.createEditInterface(), Commands);

            commandEditInterfaces.addCommand(new EditInterfaceCommand("Remove", cb => this.removeCommand(commandsEditInterface.resolveSourceObject <AnatomyCommand>(cb.getSelectedEditInterface()))));
            editInterface.addSubInterfaceForObject(commands, commandsEditInterface);
        }
Beispiel #2
0
 protected override void customizeEditInterface(EditInterface editInterface)
 {
     base.customizeEditInterface(editInterface);
     editInterface.addSubInterfaceForObject(weightedEntries, new ReflectedListLikeEditInterface <Entry>(weightedEntries, "Weighted Broadcasters", () => new Entry()));
 }
 protected override void customizeEditInterface(EditInterface editInterface)
 {
     base.customizeEditInterface(editInterface);
     editInterface.addSubInterfaceForObject(poseHandlerMappings, new ReflectedListLikeEditInterface <PoseHandlerMapping>(poseHandlerMappings, "Pose Handler Mappings", () => new PoseHandlerMapping()));
 }