Ejemplo n.º 1
0
 public SaveAsCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput)
     : base(
         project,
         commandsInput,
         Corner2CornerCommandOptions.New().WithoutUndo())
 {
 }
Ejemplo n.º 2
0
 public SaveIfRequiredCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput, IUndoRedoManager undoRedoManager)
 {
     this.saveCommand     = new SaveCommand(project, commandsInput);
     this.project         = project;
     this.commandsInput   = commandsInput;
     this.undoRedoManager = undoRedoManager;
 }
Ejemplo n.º 3
0
 public LoadCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput, IUndoRedoManager undoRedoManager)
     : base(
         project,
         commandsInput,
         Corner2CornerCommandOptions.New().ChangesEverything().ResetsOperations())
 {
     this.undoRedoManager = undoRedoManager;
 }
        public static ICorner2CornerProject Create(ICorner2CornerCommandsInput commandsInput, IUndoRedoManager undoRedoManager)
        {
            Corner2CornerProject result = new Corner2CornerProject();

            result.Commands = new CommandFactory(commandsInput, result, undoRedoManager);
            result.ChangeTracking.Track(ChangeTrackingOperation.SetNew);
            return(result);
        }
Ejemplo n.º 5
0
 protected BaseCorner2CornerCommand(
     Corner2CornerProject project,
     ICorner2CornerCommandsInput commandsInput,
     Corner2CornerCommandOptions options)
 {
     this.Project       = project ?? throw new ArgumentNullException(nameof(project));
     this.options       = options ?? throw new ArgumentNullException(nameof(options));
     this.CommandsInput = commandsInput;
 }
Ejemplo n.º 6
0
        public static SetPaletteItemTextCommand CreateWithContext(
            Corner2CornerProject project,
            ICorner2CornerCommandsInput commandsInput,
            IPaletteItem context)
        {
            SetPaletteItemTextCommand result = new SetPaletteItemTextCommand(project, commandsInput);

            result.context = context;
            return(result);
        }
            public CommandFactory(ICorner2CornerCommandsInput commandsInput, Corner2CornerProject project, IUndoRedoManager undoRedoManager)
            {
                ContainerBuilder builder = new ContainerBuilder();

                builder.RegisterInstance(commandsInput).As <ICorner2CornerCommandsInput>();
                builder.RegisterInstance(project).As <Corner2CornerProject>();
                builder.RegisterInstance(undoRedoManager).As <IUndoRedoManager>();

                var commands = CommandDiscovery.FindCommands <Corner2CornerCommandAttribute, Corner2CornerCommand>(Assembly.GetExecutingAssembly());

                foreach (var command in commands)
                {
                    builder.RegisterType(command.Value).Keyed <ICommand>(command.Key);
                }

                container = builder.Build();
            }
Ejemplo n.º 8
0
 public SetImageGridCellCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput)
     : base(project, commandsInput, Corner2CornerCommandOptions.New().ChangesImage())
 {
 }
Ejemplo n.º 9
0
 public ClickImageCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput)
 {
     this.project       = project;
     this.commandsInput = commandsInput;
 }
Ejemplo n.º 10
0
 public SetGridBackgroundCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput)
     : base(project, commandsInput, Corner2CornerCommandOptions.New().ChangesImage())
 {
 }
Ejemplo n.º 11
0
 public SetWidthCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput)
     : base(project, commandsInput, Corner2CornerCommandOptions.New())
 {
 }
 public SetSelectedPaletteItemCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput)
     : base(project, commandsInput, Corner2CornerCommandOptions.New().ChangesPalette())
 {
 }
Ejemplo n.º 13
0
 public SaveTextPatternCommand(Corner2CornerProject project, ICorner2CornerCommandsInput commandsInput, IUndoRedoManager undoRedoManager)
     : base(project, commandsInput, Corner2CornerCommandOptions.New().WithoutUndo())
 {
     this.undoRedoManager = undoRedoManager;
 }