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); }
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); }
private void slPeriod_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e) { txtPeriod.Text = InspectorDetail.GetPeriodText((int)e.NewValue); inspector.CheckPeriod = (int)e.NewValue; }