Beispiel #1
0
        public ProfileConfiguration GetActiveProfileConfiguration(string id, string [] mimetypes)
        {
            Initialize();

            ProfileConfiguration config = GetActiveProfileConfiguration(id);

            if (config != null)
            {
                // Ensure the profile configuration is valid for the mimetype restriction
                foreach (string profile_mimetype in config.Profile.MimeTypes)
                {
                    foreach (string mimetype in mimetypes)
                    {
                        if (mimetype == profile_mimetype)
                        {
                            return(config);
                        }
                    }
                }
            }

            foreach (string mimetype in mimetypes)
            {
                Profile profile = GetProfileForMimeType(mimetype);
                if (profile != null)
                {
                    profile.LoadConfiguration(id);
                    return(profile.Configuration);
                }
            }

            return(null);
        }
        public static ProfileConfiguration Load(Profile profile, string id)
        {
            ProfileConfiguration configuration = new ProfileConfiguration(profile, id);

            configuration.Load();
            return(configuration);
        }
Beispiel #3
0
 public void SetConfiguration(ProfileConfiguration configuration)
 {
     this.configuration = configuration;
     foreach (KeyValuePair <string, string> variable in configuration)
     {
         pipeline[variable.Key] = variable.Value;
     }
 }
Beispiel #4
0
 public void LoadConfiguration(string configurationId)
 {
     SetConfiguration(ProfileConfiguration.Load(this, configurationId));
 }
Beispiel #5
0
        public ProfileConfiguration GetActiveProfileConfiguration(string id)
        {
            Initialize();

            return(ProfileConfiguration.LoadActive(this, id));
        }