private static ICollection GetResourceKeys(IServiceProvider serviceProvider, string classKey)
            {
                IResourceProvider provider;
                DesignTimeResourceProviderFactory designTimeResourceProviderFactory = ControlDesigner.GetDesignTimeResourceProviderFactory(serviceProvider);

                if (string.IsNullOrEmpty(classKey))
                {
                    provider = designTimeResourceProviderFactory.CreateDesignTimeLocalResourceProvider(serviceProvider);
                }
                else
                {
                    provider = designTimeResourceProviderFactory.CreateDesignTimeGlobalResourceProvider(serviceProvider, classKey);
                }
                if (provider != null)
                {
                    IResourceReader resourceReader = provider.ResourceReader;
                    if (resourceReader != null)
                    {
                        ArrayList list = new ArrayList();
                        foreach (DictionaryEntry entry in resourceReader)
                        {
                            list.Add(entry.Key);
                        }
                        list.Sort(StringComparer.CurrentCultureIgnoreCase);
                        return(list);
                    }
                }
                return(null);
            }
        public override object EvaluateExpression(string expression, object parseTimeData, Type propertyType, IServiceProvider serviceProvider)
        {
            System.Web.Compilation.ResourceExpressionFields fields;
            IResourceProvider provider;

            if (parseTimeData is System.Web.Compilation.ResourceExpressionFields)
            {
                fields = (System.Web.Compilation.ResourceExpressionFields)parseTimeData;
            }
            else
            {
                fields = ResourceExpressionBuilder.ParseExpression(expression);
            }
            if (string.IsNullOrEmpty(fields.ResourceKey))
            {
                return(null);
            }
            object obj2 = null;
            DesignTimeResourceProviderFactory designTimeResourceProviderFactory = ControlDesigner.GetDesignTimeResourceProviderFactory(serviceProvider);

            if (string.IsNullOrEmpty(fields.ClassKey))
            {
                provider = designTimeResourceProviderFactory.CreateDesignTimeLocalResourceProvider(serviceProvider);
            }
            else
            {
                provider = designTimeResourceProviderFactory.CreateDesignTimeGlobalResourceProvider(serviceProvider, fields.ClassKey);
            }
            if (provider != null)
            {
                obj2 = provider.GetObject(fields.ResourceKey, CultureInfo.InvariantCulture);
            }
            if (obj2 != null)
            {
                Type c = obj2.GetType();
                if (!propertyType.IsAssignableFrom(c))
                {
                    TypeConverter converter = TypeDescriptor.GetConverter(propertyType);
                    if ((converter != null) && converter.CanConvertFrom(c))
                    {
                        return(converter.ConvertFrom(obj2));
                    }
                }
            }
            return(obj2);
        }
            private IDictionary GetPageResources()
            {
                if (this._owner.Component == null)
                {
                    return(null);
                }
                IServiceProvider site = this._owner.Component.Site;

                if (site == null)
                {
                    return(null);
                }
                DesignTimeResourceProviderFactory designTimeResourceProviderFactory = ControlDesigner.GetDesignTimeResourceProviderFactory(site);

                if (designTimeResourceProviderFactory == null)
                {
                    return(null);
                }
                IResourceProvider provider2 = designTimeResourceProviderFactory.CreateDesignTimeLocalResourceProvider(site);

                if (provider2 == null)
                {
                    return(null);
                }
                IResourceReader resourceReader = provider2.ResourceReader;

                if (resourceReader == null)
                {
                    return(null);
                }
                IDictionary dictionary = new HybridDictionary(true);

                if (resourceReader != null)
                {
                    foreach (DictionaryEntry entry in resourceReader)
                    {
                        string str  = (string)entry.Key;
                        string str2 = string.Empty;
                        if (str.IndexOf(':') > 0)
                        {
                            string[] strArray = str.Split(new char[] { ':' });
                            if (strArray.Length > 2)
                            {
                                continue;
                            }
                            str2 = strArray[0];
                            str  = strArray[1];
                        }
                        int index = str.IndexOf('.');
                        if (index > 0)
                        {
                            string    str3 = str.Substring(0, index);
                            string    str4 = str.Substring(index + 1);
                            ArrayList list = (ArrayList)dictionary[str3];
                            if (list == null)
                            {
                                list             = new ArrayList();
                                dictionary[str3] = list;
                            }
                            ImplicitResourceKey key = new ImplicitResourceKey {
                                Filter    = str2,
                                Property  = str4,
                                KeyPrefix = str3
                            };
                            list.Add(key);
                        }
                    }
                }
                return(dictionary);
            }