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 ();
		}
Exemple #2
0
        void HandlePolicyChanged(object sender, MonoDevelop.Projects.Policies.PolicyChangedEventArgs args)
        {
            var mimeTypes     = IdeServices.DesktopService.GetMimeTypeInheritanceChain(textEditor.MimeType);
            var currentPolicy = policyContainer.Get <TextStylePolicy> (mimeTypes);

            ((DefaultSourceEditorOptions)textEditor.Options).UpdateStylePolicy(currentPolicy);
        }
Exemple #3
0
 void HandlePolicyChanged(object sender, MonoDevelop.Projects.Policies.PolicyChangedEventArgs args)
 {
     currentPolicy = policyContainer.Get <TextStylePolicy> (mimeTypes);
     if (changed != null)
     {
         this.changed(this, EventArgs.Empty);
     }
 }
        static void HandleInvariantPolicySetChanged(object sender, PolicyChangedEventArgs e)
        {
            PolicySet pset = GetPolicySet("Invariant");
            object    p    = pset.Get(e.PolicyType, e.Scope);

            if (p != null)
            {
                invariantPolicies.InternalSet(e.PolicyType, e.Scope, p);
            }
            else
            {
                invariantPolicies.InternalSet(e.PolicyType, e.Scope, Activator.CreateInstance(e.PolicyType));
            }
        }
Exemple #5
0
        internal void PropagatePolicyChangeEvent(PolicyChangedEventArgs args)
        {
            SolutionFolder solFol = Owner as SolutionFolder;

            if (solFol != null)
            {
                foreach (SolutionItem item in solFol.Items)
                {
                    if (!item.Policies.DirectHas(args.PolicyType, args.Scope))
                    {
                        item.Policies.OnPolicyChanged(args.PolicyType, args.Scope);
                    }
                }
            }
        }
Exemple #6
0
		internal void PropagatePolicyChangeEvent (PolicyChangedEventArgs args)
		{
			SolutionFolder solFol = Owner as SolutionFolder;
			if (solFol != null)
				foreach (SolutionItem item in solFol.Items)
					if (!item.Policies.DirectHas (args.PolicyType, args.Scope))
						item.Policies.OnPolicyChanged (args.PolicyType, args.Scope);
		}
 static void DefaultPoliciesPolicyChanged(object sender, PolicyChangedEventArgs e)
 {
     defaultPolicyBag.PropagatePolicyChangeEvent(e);
 }