示例#1
0
        private void NewFile_Click(object sender, EventArgs e)
        {
            //this.Controls.Clear();
            NewFileCommand newFile = new NewFileCommand(this.editor);

            newFile.Execute();
        }
示例#2
0
 public ImageController(IImageServiceModal modal)
 {
     imageModal = modal;                    // Storing the Modal Of The System
     commands   = new Dictionary <int, ICommand>()
     {
     };
     commands[0] = new NewFileCommand(modal);
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EditorControl"/> class.
 /// </summary>
 public EditorControl()
 {
     SaveAsCommand      = new SaveAsCommand(this);
     SaveCommand        = new SaveCommand(this);
     OpenFileCommand    = new OpenFileCommand(this);
     NewFileCommand     = new NewFileCommand(this);
     InsertImageCommand = new InsertImageCommand(this);
 }
示例#4
0
        /// <summary>
        /// ImageController constructor
        /// </summary>
        /// <param name="modal"> the service modal</param>
        public ImageController(IImageServiceModal modal)
        {
            m_modal = modal;                    // Storing the Modal Of The System
            NewFileCommand nfc = new NewFileCommand(m_modal);

            commands = new Dictionary <int, ICommand>()
            {
                { 1, nfc }
            };
        }
示例#5
0
 /// <summary>
 /// ImageController constructor from IImageServiceModal (that actually handles the image).
 /// </summary>
 /// <param name="modal"> IImageServiceModal the handles pictures </param>
 public ImageController(IImageServiceModal modal, ILoggingService loggingService)
 {
     imageModal = modal;                    // Storing the Modal Of The System
     commands   = new Dictionary <int, ICommand>()
     {
     };
     commands[0] = new NewFileCommand(modal);
     commands[1] = new GetConfigCommand();
     commands[2] = new LogCommand(loggingService);
 }
示例#6
0
        /// <summary>
        /// Create a commands dictionary.
        /// </summary>
        private void CreateDictionary()
        {
            ICommand commandValue = new NewFileCommand(_modal);
            int      commandKey   = (int)CommandEnum.NewFileCommand;

            // Match values and keys:
            _commandsDict = new Dictionary <int, ICommand>()
            {
                { commandKey, commandValue }
            };
        }
示例#7
0
        public IDE(string args)
        {
            InitializeComponent();
            DataContext = this;
            Defaults();

            if (args.Contains("--test"))
            {
                NewFileCommand.Execute(null);
            }
        }
示例#8
0
        private void ToolbarButton_Click(object sender, RoutedEventArgs e)
        {
            try {
                switch ((sender as FrameworkElement).Tag.ToString().Replace("toolbar.", ""))
                {
                case "new":
                    NewFileCommand.Execute(null);
                    break;

                case "open":
                    OpenFileCommand.Execute(null);
                    break;

                case "save":
                    SaveFileCommand.Execute(null);
                    break;

                case "cut":
                    CutCommand.Execute(null);
                    break;

                case "copy":
                    CopyCommand.Execute(null);
                    break;

                case "paste":
                    PasteCommand.Execute(null);
                    break;

                case "build":
                    BuildRunCommand.Execute(false);
                    break;

                case "buildrun":
                    BuildRunCommand.Execute(true);
                    break;

                case "close":
                    CloseTabCommand.Execute(null);
                    break;
                }
            } catch (Exception ex) {
                Debug.Fail(ex.Message);
            }
        }
示例#9
0
        /// <summary>
        /// Contructs a new image controller object.
        /// </summary>
        /// <param name="modal">The image service modal the controller will controll.</param>
        public ImageController(IImageServiceModal modal)
        {
            MyModal           = modal;          // Storing the Modal Of The System
            CommandDictionary = new Dictionary <int, ICommand>();
            NewFileCommand   file   = new NewFileCommand(MyModal);
            LogCommand       logger = new LogCommand();
            CloseCommand     close  = new CloseCommand();
            GetConfigCommand conf   = new GetConfigCommand();
            GetStatsCommand  stats  = new GetStatsCommand();

            //link new file command with stats command
            file.InformNewFile += stats.PhotoAdded;
            close.InformClose  += conf.HandlerRemoved;
            //close.inform_close += logger.OnLogChange; //TODO: check this
            file.InformNewFile += logger.OnLogChange;
            CommandDictionary.Add((int)CommandEnum.NewFileCommand, file);
            CommandDictionary.Add((int)CommandEnum.LogCommand, logger);
            CommandDictionary.Add((int)CommandEnum.CloseCommand, close);
            CommandDictionary.Add((int)CommandEnum.GetConfigCommand, conf);
        }
示例#10
0
        private void WCDoAction(object sender, RoutedEventArgs e)
        {
            var action = (sender as TextBlock).Tag as string;

            if (action == null)
            {
                return;
            }

            switch (action)
            {
            default:
                if (action.StartsWith("recent "))
                {
                    action = action.Replace("recent ", "");
                    OpenCodeFile(action);
                    ChangeViewMode(showEnvironment: true);

                    //actualización de archivos recientes.
                    var recentFiles = VoltaSettings.RecentFiles;
                    recentFiles.Remove(action);
                    recentFiles.Insert(0, action);
                    VoltaSettings.RecentFiles = recentFiles;
                }
                break;

            case "openFile":
                OpenFileCommand.Execute(null);
                break;

            case "newFile":
                NewFileCommand.Execute(null);
                break;

            case "about":
                SLDlgShow(nameof(DlgAbout));
                break;
            }
        }
示例#11
0
 public MainWindowViewModel()
 {
     OpenedTabs      = new ObservableCollection <ScriptTab>();
     NewFileCommand  = new NewFileCommand(OpenNewFileTab);
     OpenFileCommand = new OpenFileCommand(OpenFile);
 }
示例#12
0
        private void RemoveFile_Click(object sender, EventArgs e)
        {
            NewFileCommand newFile = new NewFileCommand(this.editor);

            newFile.Execute();
        }
示例#13
0
 private void BtnNewFile_Click(object sender, RoutedEventArgs e)
 => NewFileCommand.Execute(null);