예제 #1
0
 static void ExpandProviders(ComponentResourceOptions options)
 {
     if (options.Provider != null)
     {
         options.Providers = new List <ProviderResource> {
             options.Provider
         };
         options.Provider = null;
     }
 }
예제 #2
0
            static ComponentResourceOptions MergeComponentOptions(ComponentResourceOptions options1, ComponentResourceOptions options2)
            {
                ExpandProviders(options1);
                ExpandProviders(options2);

                // first, merge all the normal option values over
                MergeNormalOptions(options1, options2);

                options1.Providers.AddRange(options2.Providers);

                if (options1.Providers.Count == 1)
                {
                    options1.Provider = options1.Providers[0];
                    options1.Providers.Clear();
                }

                return(options1);
            }