示例#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);
        }
示例#3
0
 public void SetConfiguration(ProfileConfiguration configuration)
 {
     this.configuration = configuration;
     foreach (KeyValuePair <string, string> variable in configuration)
     {
         pipeline[variable.Key] = variable.Value;
     }
 }
示例#4
0
 public void LoadConfiguration(string configurationId)
 {
     SetConfiguration(ProfileConfiguration.Load(this, configurationId));
 }
示例#5
0
        public ProfileConfiguration GetActiveProfileConfiguration(string id)
        {
            Initialize();

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