コード例 #1
0
        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;
        }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
        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());
        }
コード例 #4
0
        PolicySet IMimeTypePolicyOptionsPanel.GetMatchingSet()
        {
            T pol = GetCurrentPolicy();

            return(PolicyService.GetMatchingSet(pol, mimeTypeScopes));
        }