Ejemplo n.º 1
0
        public FormEditOptions(FormOptionsMenu optionsMenu, Options option = null)
        {
            InitializeComponent();

            OptionsMenu = optionsMenu;

            if (option != null)
            {
                FormAction = FormAction.EDIT;
                Option     = option;
                FillCamps(option);
            }
            else
            {
                Text = "New Options";

                FillCamps(new Options {
                    SourcePath        = "C:\\origin...",
                    DestinyPath       = "C:\\destiny...",
                    IncludeSubFolders = true
                });
            }

            KeyDown   += new KeyEventHandler(FormEditOption_KeyDown);
            KeyPreview = true;
        }
Ejemplo n.º 2
0
        //public void ResizeForm()
        //{
        //    //-- CHANGING FORM HEIGHT RESPONSIVELY DEPENDING ON NUMBER OF PROFILES
        //    if (Profiles.Count() > InitialListViewItemCount && Profiles.Count() < MaximumListViewItemCount)
        //        Size = new System.Drawing.Size(InitialFormWidth, InitialFormHeight + (Profiles.Count() - InitialListViewItemCount) * ListProfileHeight);
        //    else if (Profiles.Count() >= MaximumListViewItemCount)
        //        Size = new System.Drawing.Size(InitialFormWidth, InitialFormHeight + (ListProfileHeight * AditionalListViewItemCount));
        //    else if (Bounds.Height != InitialFormHeight)
        //        Size = new System.Drawing.Size(InitialFormWidth, InitialFormHeight);
        //}

        //private void ListViewProfileItem_DoubleClick(object sender, EventArgs args)
        //{
        //    OpenSelectedProfile();
        //}

        private void OpenSelectedProfile()
        {
            try
            {
                FormOptionsMenu optionsMenu = new FormOptionsMenu(this,
                                                                  Profiles.Find(x => x.Id == (int)listViewProfile.SelectedItems[0].Tag));

                optionsMenu.Show(this);
                Hide();
            }
            catch (ArgumentOutOfRangeException)
            {
                MessageBox.Show("Select a profile.");
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
        }
Ejemplo n.º 3
0
 public FileControlImpl(FormOptionsMenu menu)
 {
     Menu = menu;
 }
Ejemplo n.º 4
0
        public FormReport(FormOptionsMenu menu, List <TransferedFilesReport> transferedFiles,
                          List <NotTransferedFilesReport> notTransferedFiles, List <RenamedFilesReport> renamedFiles,
                          List <CreatedDirectoriesReport> createdDirectories, List <ReplacedFilesReport> replacedFiles,
                          List <RemovedFilesAndDirectoriesReport> removedFilesAndDirectories)
        {
            InitializeComponent();
            this.OptionsMenu                       = menu;
            this.TransferedFilesReports            = transferedFiles;
            this.NotTransferedFilesReports         = notTransferedFiles;
            this.RenamedFilesReports               = renamedFiles;
            this.CreatedDirectoriesReports         = createdDirectories;
            this.ReplacedFilesReports              = replacedFiles;
            this.RemovedFilesAndDirectoriesReports = removedFilesAndDirectories;

            foreach (TransferedFilesReport report in TransferedFilesReports)
            {
                ListViewItem item = new ListViewItem(report.File);
                item.SubItems.Add(report.Destiny);
                listViewTransferedFiles.Items.Add(item);
            }
            foreach (NotTransferedFilesReport report in NotTransferedFilesReports)
            {
                ListViewItem item = new ListViewItem(report.File);
                item.SubItems.Add(report.Destiny);
                item.SubItems.Add(report.Reason);
                listViewNotTransferedFiles.Items.Add(item);
            }
            foreach (RenamedFilesReport report in RenamedFilesReports)
            {
                ListViewItem item = new ListViewItem(report.File);
                item.SubItems.Add(report.Destiny);
                listViewRenamedFiles.Items.Add(item);
            }
            foreach (CreatedDirectoriesReport report in CreatedDirectoriesReports)
            {
                ListViewItem item = new ListViewItem(report.Directory);
                item.SubItems.Add(report.Origin);
                listViewCreatedDirectories.Items.Add(item);
            }
            foreach (ReplacedFilesReport report in ReplacedFilesReports)
            {
                ListViewItem item = new ListViewItem(report.File);
                item.SubItems.Add(report.Destiny);
                listViewReplacedFiles.Items.Add(item);
            }
            foreach (RemovedFilesAndDirectoriesReport report in RemovedFilesAndDirectoriesReports)
            {
                ListViewItem item = new ListViewItem(report.Entry);
                item.SubItems.Add(report.Description);
                listViewRemovedFilesAndDirectories.Items.Add(item);
            }

            if (transferedFiles.Count != 0)
            {
                tabControlReport.SelectedTab = tabPageTransfered;
            }
            else if (notTransferedFiles.Count != 0)
            {
                tabControlReport.SelectedTab = tabPageNotTransfered;
            }
            else if (replacedFiles.Count != 0)
            {
                tabControlReport.SelectedTab = tabPageReplacedFiles;
            }
            else if (renamedFiles.Count != 0)
            {
                tabControlReport.SelectedTab = tabPageRenamedFiles;
            }
            else if (createdDirectories.Count != 0)
            {
                tabControlReport.SelectedTab = tabPageCreatedDirectories;
            }
            else if (removedFilesAndDirectories.Count != 0)
            {
                tabControlReport.SelectedTab = tabPageRemovedFilesAndDirectories;
            }
        }