Exemplo n.º 1
0
 void HandlePolicyContainerPolicyChanged(object sender, PolicyChangedEventArgs e)
 {
     if (!loading && e.PolicyType == typeof(T))
     {
         FillPolicies();
         InitializePolicy();
         UpdateSelectedNamedPolicy();
     }
 }
Exemplo n.º 2
0
        void HandlePolicyContainerPolicyChanged(object sender, PolicyChangedEventArgs e)
        {
            if (internalPolicyUpdate)
            {
                return;
            }

            // The policy container has changed externally. The panel data has to be reloaded

            foreach (MimeTypePanelData pd in typeSections.Values)
            {
                bool useParentPolicy = false;
                bool modified        = false;
                foreach (IMimeTypePolicyOptionsPanel panel in pd.Panels)
                {
                    // Reload the panel if it is handling the modified policy
                    if (panel.HandlesPolicyType(e.PolicyType, e.Scope))
                    {
                        panel.LoadSetPolicy(policyContainer);
                        modified = true;
                    }
                    if (!panel.HasCustomPolicy)
                    {
                        useParentPolicy = true;
                    }
                }
                if (modified)
                {
                    pd.SetUseParentPolicy(useParentPolicy, e.PolicyType, e.Scope);
                }
                if (pd.SectionLoaded)
                {
                    pd.SectionPanel.FillPolicies();
                    pd.SectionPanel.UpdateSelectedNamedPolicy();
                }
            }
            if (widget != null)
            {
                widget.Refresh();
            }
        }
Exemplo n.º 3
0
 private void PolicyChanged(object sender, PolicyChangedEventArgs e)
 => UpdateTextEditorOptions(sender, e);