Exemplo n.º 1
0
 /// <summary>
 /// Callback to destroy a resource group.
 /// </summary>
 /// <param name="callback"></param>
 /// <param name="caller"></param>
 private void destroyResourceGroup(EditUICallback callback)
 {
     removeResourceGroup(editInterface.resolveSourceObject <ResourceGroup>(callback.getSelectedEditInterface()).Name);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Callback to remove an MovableObjectDefinition.
 /// </summary>
 /// <param name="callback"></param>
 /// <param name="command"></param>
 private void removeMovableObject(EditUICallback callback)
 {
     removeMovableObjectDefinition(editInterface.resolveSourceObject <MovableObjectDefinition>(callback.getSelectedEditInterface()));
 }
Exemplo n.º 3
0
 private void destroyGroupCallback(EditUICallback callback)
 {
     removeGroup(editInterface.resolveSourceObject <InstanceGroup>(callback.getSelectedEditInterface()));
 }
Exemplo n.º 4
0
 private void removeTrack(EditUICallback callback)
 {
     removeTrack(editInterface.resolveSourceObject <ShowPropSubActionPrototype>(callback.getSelectedEditInterface()));
 }
 private void removeAction(EditUICallback callback)
 {
     timeline.removePostAction(editInterface.resolveSourceObject <TimelineInstantAction>(callback.getSelectedEditInterface()));
 }
Exemplo n.º 6
0
        /// <summary>
        /// Callback to destroy a SimSubSceneDefinition.
        /// </summary>
        /// <param name="callback">The EditUICallback to get more info from the user.</param>
        /// <param name="caller">The command that initiated this funciton call.</param>
        private void destroySimSubSceneDefinition(EditUICallback callback)
        {
            EditInterface currentInterface = callback.getSelectedEditInterface();

            removeSimSubSceneDefinition(subScenes.resolveSourceObject <SimSubSceneDefinition>(currentInterface));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Callback to destroy a SimElementManagerDefinition.
        /// </summary>
        /// <param name="callback">The EditUICallback to get more info from the user.</param>
        /// <param name="caller">The command that initiated this funciton call.</param>
        private void destroySimElementManagerDefinition(EditUICallback callback)
        {
            EditInterface currentInterface = callback.getSelectedEditInterface();

            removeSimElementManagerDefinition(simElementEditor.resolveSourceObject <SimElementManagerDefinition>(currentInterface));
        }
Exemplo n.º 8
0
 /// <summary>
 /// Remove a SimElementDefinition.
 /// </summary>
 /// <param name="callback"></param>
 /// <param name="command"></param>
 private void removeSimElementDefinition(EditUICallback callback)
 {
     removeElement(editInterface.resolveSourceObject <SimElementDefinition>(callback.getSelectedEditInterface()));
 }
Exemplo n.º 9
0
        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);
        }