예제 #1
0
        private void Folder_Click(object sender, RoutedEventArgs e)
        {
            ActionGrid.Children.Clear();

            RenameController Contrl = new RenameController();

            Contrl.Caller = Folder;
            ActionGrid.Children.Add(Contrl);
            ActionGrid.Visibility = Visibility.Visible;
        }
예제 #2
0
        private void brnStart_Click(object sender, EventArgs e)
        {
            if (edtRootPath.Text.Equals(""))
            {
                MessageBox.Show("Root Path Is Emty", "ERROR");
                return;
            }

            /*if (edtKeyword.Text.Equals(""))
             * {
             *  MessageBox.Show("Keyword Is Emty", "ERROR");
             *  return;
             * } */
            if (radSaveAs.Checked)
            {
                if (edtPathSaveAs.Text.Equals(""))
                {
                    MessageBox.Show("Save Path Is Emty", "ERROR");
                    return;
                }
            }
            List <SortModel> _listSortModel = new List <SortModel>();

            if (!edtPathKewordFilter.Text.Equals(""))
            {
                try
                {
                    string[] lines = File.ReadAllLines(edtPathKewordFilter.Text.Trim());
                    foreach (string line in lines)
                    {
                        if (!line.Equals(""))
                        {
                            SortModel _sortModel = new SortModel();
                            _sortModel.Keywords       = line;
                            _sortModel.PathSave       = edtPathSaveAs.Text.Trim();
                            _sortModel.RootPath       = edtRootPath.Text.Trim();
                            _sortModel.IsCreateFolder = true;
                            _listSortModel.Add(_sortModel);
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
            RunModel _runModel = new RunModel();

            PNGModel model = new PNGModel();

            model.RootPath   = edtRootPath.Text.ToString().Trim();
            model.isReplace  = radReplace.Checked;
            model.isSaveAs   = radSaveAs.Checked;
            model.Keywords   = edtKeyword.Text;
            model.PathSaveAs = edtPathSaveAs.Text.ToString().Trim();

            _runModel.SortModels = _listSortModel;
            _runModel.PNGModel   = model;

            RenameController _renameController = new RenameController(_runModel, this);

            _renameController.Start();
        }
예제 #3
0
        public MainForm()
        {
            InitializeComponent();

            iptcView1.PreInit();
            exifGpsView1.PreInit();
            iptcGpsController                 = new IptcGpsController(this, this.iptcView1, this.exifGpsView1);
            this.buttonGpsViewSave.Click     += iptcGpsController.Save_Click;
            this.buttonGpsViewSaveAll.Click  += iptcGpsController.SaveToAll_Click;
            this.buttonIptcViewSave.Click    += iptcGpsController.Save_Click;
            this.buttonIptcViewSaveAll.Click += iptcGpsController.SaveToAll_Click;
            this.bindingSourceIptcGpsController.DataSource = iptcGpsController;

            renameView1.PreInit();
            renameController         = new RenameController(this, this.renameView1);
            this.buttonRename.Click += renameController.Rename_Click;
            renameController.ProcessFilesInSubdirectories = this.chkRenameSubdirs.Checked;

            pluginView1.PreInit();
            pluginController               = new PluginController(this, this.pluginView1);
            this.buttonPluginRun.Click    += this.pluginController.Execute_Click;
            this.buttonPluginRunAll.Click += this.pluginController.ExecuteForAll_Click;
            pluginController.ProcessFilesInSubdirectories = this.chkPluginSubdirs.Checked;

            exifDateView1.PreInit();
            exifDateController = new ExifDateController(this, exifDateView1);
            this.buttonExifDateViewSave.Click              += exifDateController.Save_Click;
            this.buttonExifDateViewSaveAll.Click           += exifDateController.SaveToAll_Click;
            this.bindingSourceExifDateController.DataSource = exifDateController;

            this.Icon = Resources.PTS;

            this.splitContainer1.Panel1MinSize = 100;
            this.splitContainer1.Panel2MinSize = 400;
            this.splitContainer2.Panel1MinSize = 100;
            this.splitContainer2.Panel2MinSize = 325;
            this.splitContainer3.Panel2MinSize = 100;
            this.splitContainer3.Panel1MinSize = 100;

            displayControls = new PictureDetailControlList();
            displayControls.Add(this.iptcGpsController);
            displayControls.Add(this.pictureDisplay);
            displayControls.Add(this.exifDisplay1);
            displayControls.Add(this.completeTagList1);
            displayControls.Add(this.imageDisplay1);
            displayControls.Add(this.renameController);
            displayControls.Add(this.pluginController);
            displayControls.Add(this.exifDateController);

            displayControls.RegisterEvents(this.RefreshDetailViews,
                                           this.RefreshCurrentDirectoryView,
                                           this.RefreshDirectoryTree,
                                           this.NavigateFiles,
                                           this.ListAllCheckedFiles,
                                           this.ListSelectedDirectory);

            // add the secondary status display
            this.toolStripProgressBar2         = new ToolStripProgressBar();
            this.toolStripProgressBar2.Margin  = new Padding(735, 3, 1, 3);
            this.toolStripProgressBar2.Name    = "toolStripProgressBar2";
            this.toolStripProgressBar2.Size    = new System.Drawing.Size(100, 16);
            this.toolStripProgressBar2.Visible = false;
            this.statusStrip.Items.Add(this.toolStripProgressBar2);
            secondStatusDisplay = new StatusDisplay(this.toolStripProgressBar2);
            this.pictureDisplay.SetStatusDisplay(secondStatusDisplay);

            UpdateRecentMacros();

            Default_PropertyChanged(null, new PropertyChangedEventArgs("VisibleTabs"));
            Settings.Default.PropertyChanged += new PropertyChangedEventHandler(Default_PropertyChanged);
        }