public void UpdateSelectedNamedPolicy() { if (loading) { return; } T pol = GetPolicy(); PolicySet s = PolicyService.GetMatchingSet(pol); TreeIter iter; int i = 0; if (s != null && store.GetIterFirst(out iter)) { do { PolicySet s2 = store.GetValue(iter, 1) as PolicySet; if (s2 != null && s2.Id == s.Id) { policyCombo.Active = i; return; } i++; } while (store.IterNext(ref iter)); } policyCombo.Active = store.IterNChildren() - 1; }
PolicySet IMimeTypePolicyOptionsPanel.GetMatchingSet(IEnumerable <PolicySet> candidateSets) { T pol = GetCurrentPolicy(); if (candidateSets != null) { return(PolicyService.GetMatchingSet(pol, candidateSets, mimeTypeScopes, false)); } else { return(PolicyService.GetMatchingSet(pol, mimeTypeScopes, false)); } }
public void UpdateSelectedNamedPolicy() { if (loading) { return; } if (policyUndefined) { policyCombo.Active = 0; return; } T pol = GetPolicy(); PolicySet s = PolicyService.GetMatchingSet(pol, setsInCombo, false); int active = -1; TreeIter iter; int i = 0; if (s != null && store.GetIterFirst(out iter)) { do { PolicySet s2 = store.GetValue(iter, 1) as PolicySet; if (s2 == s) { active = i; break; } i++; } while (store.IterNext(ref iter)); } if (active != -1) { policyCombo.Active = active; } else { policyCombo.Active = store.IterNChildren() - 1; } warningMessage.Visible = isGlobalPolicy && !((IEquatable <T>)pol).Equals(GetCurrentValue()); }
PolicySet IMimeTypePolicyOptionsPanel.GetMatchingSet() { T pol = GetCurrentPolicy(); return(PolicyService.GetMatchingSet(pol, mimeTypeScopes)); }