public void UpdateSelectedNamedPolicy() { if (selectingPolicy) { return; } synchingPoliciesCombo = true; try { // Find a policy set which is common to all policy types if (!isRoot && panelData.UseParentPolicy) { policyCombo.Active = 0; return; } int active = -1; PolicySet matchedSet = panelData.GetMatchingSet(setsInCombo); TreeIter iter; int i = 0; if (matchedSet != null && store.GetIterFirst(out iter)) { do { PolicySet s2 = store.GetValue(iter, 1) as PolicySet; if (s2 != null && s2.Id == matchedSet.Id) { active = i; break; } i++; }while (store.IterNext(ref iter)); } if (active != -1) { policyCombo.Active = active; } else { policyCombo.Active = store.IterNChildren() - 1; } warningMessage.Visible = isGlobalPolicy && panelData.Modified; } finally { synchingPoliciesCombo = false; } }
public void UpdateSelectedNamedPolicy() { if (loading) { return; } // Find a policy set which is common to all policy types if (!isRoot && panelData.UseParentPolicy) { policyCombo.Active = 0; return; } PolicySet matchedSet = panelData.GetMatchingSet(); TreeIter iter; int i = 0; if (matchedSet != null && store.GetIterFirst(out iter)) { do { PolicySet s2 = store.GetValue(iter, 1) as PolicySet; if (s2 != null && s2.Id == matchedSet.Id) { policyCombo.Active = i; return; } i++; } while (store.IterNext(ref iter)); } policyCombo.Active = store.IterNChildren() - 1; }