Ejemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            txtName.Text   = inspector.Name;
            txtPath.Text   = inspector.Path;
            slPeriod.Value = inspector.CheckPeriod;
            txtPeriod.Text = InspectorDetail.GetPeriodText(inspector.CheckPeriod);

            if (inspector.Action == (int)Inspector.TypeActions.MoveSubDir)
            {
                rbtMoveSubDir.IsChecked = true;

                if (!String.IsNullOrEmpty(inspector.SubDirAction))
                {
                    txtPathAction.Text = inspector.SubDirAction;
                }
            }
            else
            {
                rbtDeleteFiles.IsChecked = true;
            }

            if (inspector.InspectorId != 0)
            {
                rbtMoveSubDir.IsEnabled  = false;
                rbtDeleteFiles.IsEnabled = false;
            }

            RulesRefresh(null);
        }
Ejemplo n.º 2
0
        private void pnlNewRastreador_MouseUp(object sender, MouseButtonEventArgs e)
        {
            InspectorDetail inspDetail = new InspectorDetail();

            inspDetail.ShowDialog();

            this.Focus();
        }
Ejemplo n.º 3
0
        private void pnlNewInspector_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var inspector = new Inspector {
                Path = "Seleccione una carpeta para rastrear"
            };

            InspectorDetail inspDetail = new InspectorDetail(inspector);

            inspDetail.ShowDialog();

            inspector = inspDetail.inspector;

            InspectorsRefresh(inspector, true);
        }
Ejemplo n.º 4
0
        private void FillRulesAux(Inspector inspector)
        {
            if (inspector.Enable)
            {
                inspector.ImageEnable = @"/Resources/play.png";
            }
            else
            {
                inspector.ImageEnable = @"/Resources/pausa.png";
            }

            inspector.CheckPeriodText = InspectorDetail.GetPeriodText(inspector.CheckPeriod) + " ";

            inspector.RulesAux = new List <InspectorHelper>(3);

            var queryRule = from rule in inspector.Rules
                            where rule.RuleType.Equals((int)RuleFile.TypeFileRule.FileName)
                            select rule;

            InspectorHelper inspHelper = new InspectorHelper();

            inspHelper.CountRuleType = queryRule.Count();
            inspHelper.Type          = RuleFile.TypeFileRule.FileName;
            inspHelper.ImagePath     = @"/images/icon_ruleFileName.png";

            inspector.RulesAux.Add(inspHelper);

            queryRule = from rule in inspector.Rules
                        where rule.RuleType.Equals((int)RuleFile.TypeFileRule.Extension)
                        select rule;

            inspHelper = new InspectorHelper();
            inspHelper.CountRuleType = queryRule.Count();
            inspHelper.Type          = RuleFile.TypeFileRule.Extension;
            inspHelper.ImagePath     = @"/images/icon_ruleFileExtension.png";

            inspector.RulesAux.Add(inspHelper);

            queryRule = from rule in inspector.Rules
                        where rule.RuleType.Equals((int)RuleFile.TypeFileRule.Date)
                        select rule;

            inspHelper = new InspectorHelper();
            inspHelper.CountRuleType = queryRule.Count();
            inspHelper.Type          = RuleFile.TypeFileRule.Date;
            inspHelper.ImagePath     = @"/images/icon_ruleFileDate.png";

            inspector.RulesAux.Add(inspHelper);
        }
Ejemplo n.º 5
0
        private void lstVInspectors_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (lstVInspectors.SelectedIndex != -1)
            {
                Inspector inspSelected = (Inspector)lstVInspectors.SelectedValue;

                InspectorDetail inspDetail = new InspectorDetail(inspSelected);
                inspDetail.ShowDialog();

                List <Inspector> lstInspectors = (List <Inspector>)lstVInspectors.ItemsSource;

                inspSelected = inspDetail.inspector;

                FillRulesAux(inspSelected);

                lstVInspectors.ItemsSource = null;
                lstVInspectors.ItemsSource = lstInspectors;
            }
        }
Ejemplo n.º 6
0
        private void pnlNewInspector_MouseUp(object sender, MouseButtonEventArgs e)
        {
            var inspector = new Inspector { Path = "Seleccione una carpeta para rastrear" };

            InspectorDetail inspDetail = new InspectorDetail(inspector);
            inspDetail.ShowDialog();

            inspector = inspDetail.inspector;

            InspectorsRefresh(inspector, true);
        }
Ejemplo n.º 7
0
        private void lstVInspectors_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (lstVInspectors.SelectedIndex != -1)
            {
                Inspector inspSelected = (Inspector)lstVInspectors.SelectedValue;

                InspectorDetail inspDetail = new InspectorDetail(inspSelected);
                inspDetail.ShowDialog();

                List<Inspector> lstInspectors = (List<Inspector>)lstVInspectors.ItemsSource;

                inspSelected = inspDetail.inspector;

                FillRulesAux(inspSelected);

                lstVInspectors.ItemsSource = null;
                lstVInspectors.ItemsSource = lstInspectors;
            }
        }
Ejemplo n.º 8
0
        private void pnlNewRastreador_MouseUp(object sender, MouseButtonEventArgs e)
        {
            InspectorDetail inspDetail = new InspectorDetail();
            inspDetail.ShowDialog();

            this.Focus();
        }
        private void mnFileR_Click(object sender, RoutedEventArgs e)
        {
            var inspector = new FileInspector { Path = "Seleccione una carpeta para rastrear" };

            var inspDetail = new InspectorDetail(inspector);
            inspDetail.ShowDialog();

            inspector = inspDetail.Inspector;

            if (inspector.InspectorId.HasValue)
            {
                InspectorsRefresh(inspector, true);
            }
        }
Ejemplo n.º 10
0
 private void slPeriod_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
 {
     txtPeriod.Text        = InspectorDetail.GetPeriodText((int)e.NewValue);
     inspector.CheckPeriod = (int)e.NewValue;
 }