private void btnStartPreview_Click(object sender, EventArgs e)
 {
     TXT_LOG_HIT_CTR_VALUE = 0;
     OnGenerationProcessing_ButtonsHandlings(true);
     listViewLogs.Items.Clear();
     listViewLogs.BeginUpdate();
     SaveChanges();
     generateSerializableTreeNode.FolderFilterRuleObj = (FolderFilterRule)FolderFilterRule.Clone();
     generateSerializableTreeNode.StartGeneration();
 }
        public FilterRuleFrm(FolderFilterRule originalFolderFilterRule = null)
        {
            InitializeComponent();

            if (originalFolderFilterRule != null)
            {
                this.originalFolderFilterRule = originalFolderFilterRule;
                this.FolderFilterRule         = (FolderFilterRule)originalFolderFilterRule.Clone();
            }
        }
 private void SaveChanges()
 {
     FolderFilterRule.ConsumeAggregatedExcludedList(txtBoxExclude.Text);
     FolderFilterRule.ConsumeAggregatedIncludedList(txtBoxInclude.Text);
     FolderFilterRule.TargetFolderPath      = txtBoxTargetDir.Text;
     FolderFilterRule.HasMinimumFileSize    = checkBoxHasMinFileSize.Checked;
     FolderFilterRule.MinimumFileSize       = long.Parse(numericUpDownMinFileSize.Value.ToString());
     FolderFilterRule.HasMaximumFileSize    = checkBoxHasMaxFileSize.Checked;
     FolderFilterRule.MaximumFileSize       = long.Parse(numericUpDownMaxFileSize.Value.ToString());
     FolderFilterRule.TimeSpanOptionValue   = GetSelectedTimeSpanOption();
     FolderFilterRule.LastNumberOfDaysValue = int.Parse(numericUpDownLastXXDays.Value.ToString());
     FolderFilterRule.IncludeEmptyFolder    = checkBoxIncludeEmptyFolder.Checked;
 }
 private int SetTimeSpanDefault()
 {
     if (comboBoxTimeSpanOption.Items.Count <= 0)
     {
         return(0);
     }
     for (int ctr = 0; ctr < comboBoxTimeSpanOption.Items.Count; ctr++)
     {
         if (FolderFilterRule.GetTypeBaseOnValue(comboBoxTimeSpanOption.Items[ctr].ToString())
             == FolderFilterRule.TimeSpanOptionValue)
         {
             return(ctr);
         }
     }
     return(0);
 }
        private void FilterRuleFrm_Load(object sender, EventArgs e)
        {
            txtBoxTargetDir.Text               = FolderFilterRule.TargetFolderPath;
            checkBoxHasMinFileSize.Checked     = FolderFilterRule.HasMinimumFileSize;
            checkBoxHasMaxFileSize.Checked     = FolderFilterRule.HasMaximumFileSize;
            checkBoxIncludeEmptyFolder.Checked = FolderFilterRule.IncludeEmptyFolder;
            comboBoxTimeSpanOption.Items.AddRange(FolderFilterRule.GetAllTimeSpanOptions());
            comboBoxTimeSpanOption.SelectedIndex = SetTimeSpanDefault();
            numericUpDownLastXXDays.Enabled      = FolderFilterRule.TimeSpanOptionValue == FolderFilterRule.TimeSpanOption.LAST_XX_DAYS;
            numericUpDownLastXXDays.Value        = FolderFilterRule.LastNumberOfDaysValue;
            numericUpDownMinFileSize.Enabled     = FolderFilterRule.HasMinimumFileSize;
            numericUpDownMaxFileSize.Enabled     = FolderFilterRule.HasMaximumFileSize;
            numericUpDownMinFileSize.Value       = FolderFilterRule.MinimumFileSize;
            numericUpDownMaxFileSize.Value       = FolderFilterRule.MaximumFileSize;
            txtBoxInclude.Text = FolderFilterRule.GetAggregatedIncludedList();
            txtBoxExclude.Text = FolderFilterRule.GetAggregatedExcludedList();
            txtBoxHelp.Text    = ResourcesUtil.GetResourceFolderFilterHelpModel().Aggregate((x, y) => x + Environment.NewLine + y);

            //Events
            generateSerializableTreeNode.FinishedGeneration       += GenerateSerializableTreeNode_FinishedGeneration;
            generateSerializableTreeNode.GenerationInitialization += GenerateSerializableTreeNode_GenerationInitialization;
            generateSerializableTreeNode.RuleEnforcementStatus    += GenerateSerializableTreeNode_RuleEnforcementStatus;
            generateSerializableTreeNode.StopGeneration           += GenerateSerializableTreeNode_StopGeneration;
        }
 private FolderFilterRule.TimeSpanOption GetSelectedTimeSpanOption()
 {
     return(FolderFilterRule.GetTypeBaseOnValue(comboBoxTimeSpanOption.SelectedItem.ToString()));
 }
 public GenerateSerializableTreeNode(FolderFilterRule folderFilterRule)
 {
     this.folderFilterRule     = folderFilterRule;
     processingStatusEventArgs = new GeneratingSerializeTreeNodeEventArgs();
 }