public override StringOperation Clone()
        {
            //tạo mới 1 uniqueStringOperation
            var newUniqueStringOperation = new UniqueStringOperation()
            {
                Args = new StringArgs()
                {
                }
            };

            return(newUniqueStringOperation);
        }
Exemple #2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //add các loại prototype mà mình có
            var prototype1 = new ReplaceOperation()
            {
                Args = new ReplaceArgs()
                {
                    From = "From",
                    To   = "To"
                }
            };
            var prototype2 = new MoveOperation()
            {
                Args = new MoveArgs()
                {
                    Size = 0,
                    Type = 0
                }
            };
            var prototype3 = new UniqueStringOperation();
            var prototype4 = new NewCaseOperation()
            {
                Args = new NewCaseArgs()
                {
                    Style = "Style"
                }
            };
            var prototype5 = new FullNameOperation();

            //add vào list prototypes
            _prototypes.Add(prototype1);
            _prototypes.Add(prototype2);
            _prototypes.Add(prototype3);
            _prototypes.Add(prototype4);
            _prototypes.Add(prototype5);
            //load các presets mà mình có
            Directory.CreateDirectory(path);
            //load presets
            var PresetsLocation = new DirectoryInfo(path);

            FileInfo[] files = PresetsLocation.GetFiles("*.txt");
            foreach (var file in files)
            {
                _presets.Add(System.IO.Path.GetFileNameWithoutExtension(file.Name));
            }
            //set source cho prototypesComboBox, filesListView, folderListView, presetsCombobox và operationListBox
            prototypesComboBox.ItemsSource = _prototypes;
            operationsListBox.ItemsSource  = _actions;
            filesListView.ItemsSource      = listFiles;
            foldersListView.ItemsSource    = listFolders;
            presetsComboBox.ItemsSource    = _presets;
        }