public IResource ShowExpirationRuleForm(IResourceList folders, IResource defRule) { if (defRule == null || IsSimpleExpirationRule(defRule)) { EditExpirationRuleSimpleForm form = new EditExpirationRuleSimpleForm(folders, defRule); form.ShowDialog(Core.MainWindow); form.Dispose(); } else { EditExpirationRuleForm form = new EditExpirationRuleForm(folders, defRule); form.ShowDialog(Core.MainWindow); form.Dispose(); } return(null); }
public IResource ShowExpirationRuleForm(IResource resType, IResource defRule, bool forDeletedItems) { if (defRule == null || IsSimpleExpirationRule(defRule)) { EditExpirationRuleSimpleForm form = new EditExpirationRuleSimpleForm(resType, defRule, forDeletedItems); form.ShowDialog(Core.MainWindow); form.Dispose(); } else { EditExpirationRuleForm form = new EditExpirationRuleForm(resType, defRule, forDeletedItems); form.ShowDialog(Core.MainWindow); form.Dispose(); } return(null); }
public IResource ShowEditResourceForm(IResource res) { #region Preconditions if (res == null) { throw new ArgumentNullException("res", "FilteringFormsManager -- Input resource is NULL"); } if (res.Type != FilterManagerProps.ViewResName && res.Type != FilterManagerProps.RuleResName && res.Type != FilterManagerProps.ViewCompositeResName) { throw new ArgumentException("FilteringFormsManager -- Input resource has inappropriate type [" + res.Type + "]"); } #endregion Preconditions Form form; IResource result = null; String name = res.GetStringProp(Core.Props.Name); if (res.HasProp("IsActionFilter")) { form = new EditRuleForm(name); } else if (res.HasProp("IsFormattingFilter")) { form = new EditFormattingRuleForm(name); } else if (res.HasProp("IsTrayIconFilter")) { form = new EditTrayIconRuleForm(name); } else if (res.HasProp("IsExpirationFilter")) { if (IsSimpleExpirationRule(res)) { form = new EditExpirationRuleSimpleForm(res); } else { form = new EditExpirationRuleForm(name); } } else { form = new EditViewForm(name); } if (form.ShowDialog(Core.MainWindow) == DialogResult.OK) { if (form is EditExpirationRuleSimpleForm) { result = (form as EditExpirationRuleSimpleForm).ResultResource; } else { result = (form as ViewCommonDialogBase).ResultResource; } } form.Dispose(); return(result); }