internal void CountResourceDictionaryAndSetSource(string url)
                {
                    var target  = new ResourceDictionary();
                    var packUri = ResourceDictionaryUtilities.ToPackUri(url);

                    target.Source = packUri;
                }
Esempio n. 2
0
            public void FixDesignTimeUri(string inUrl, string outUrl)
            {
                var inUri = ResourceDictionaryUtilities.ToPackUri(inUrl);

                var outUri = SharedDictionaryManager.FixDesignTimeUri(inUri);

                Assert.That(outUri.ToString(), Is.EqualTo(outUrl));
            }
            public void SetInLoadContext(string url)
            {
                var target  = new LoadingResourceDictionary();
                var packUri = ResourceDictionaryUtilities.ToPackUri(url);

                target.Source = packUri;

                Assert.That(target.MergedDictionaries.Count, Is.GreaterThan(0));
            }
Esempio n. 4
0
                public void ReturnsResourceDictionary()
                {
                    using (var factory = new SharedDictionaryManager.CachingFactory())
                    {
                        var uri   = ResourceDictionaryUtilities.ToPackUri(Urls.Test_SharedDictionary_PackUrl);
                        var owner = new ResourceDictionary();

                        var resourceDictionary = factory.GetOrCreateResourceDictionary(owner, uri);

                        Assert.That(resourceDictionary, Is.Not.Null);
                    }
                }
Esempio n. 5
0
            public void IsEqualToSet(string url)
            {
                using (SharedDictionaryManager.CachingFactory.GetInstanceForDomain())
                {
                    var uri    = ResourceDictionaryUtilities.ToPackUri(url);
                    var target = new SharedDictionaryManager();

                    target.Source = uri;

                    Assert.That(target.Source, Is.EqualTo(uri));
                }
            }
            public void SetInLoadFromContext(string url)
            {
                var setup = new AppDomainSetup {
                    ApplicationBase = "NOTHING_HERE"
                };

                AppDomainContext.Invoke(setup, () =>
                {
                    var target  = new LoadingResourceDictionary();
                    var packUri = ResourceDictionaryUtilities.ToPackUri(url);

                    target.Source = packUri;

                    Assert.That(target.MergedDictionaries.Count, Is.GreaterThan(0));
                });
            }
Esempio n. 7
0
            public void SetResourceDictionarySourceOnDifferentInstances_ExpectDifferentObjects(string url)
            {
                var setup = new AppDomainSetup {
                    ApplicationBase = "NOTHING_HERE"
                };

                AppDomainContext.Invoke(setup, () =>
                {
                    var shared     = new SharedDictionaryManager();
                    var expectDump = ResourceDictionaryUtilities.DumpMergedDictionaries(shared, url);

                    var loading = new LoadingResourceDictionary();
                    var dump    = ResourceDictionaryUtilities.DumpMergedDictionaries(loading, url);

                    Assert.That(dump, Is.Not.EqualTo(expectDump));
                });
            }
Esempio n. 8
0
                internal string DumpMergedDictionariesSharedDictionaryManager(string url)
                {
                    var target = new SharedDictionaryManager();

                    return(ResourceDictionaryUtilities.DumpMergedDictionaries(target, url));
                }
Esempio n. 9
0
                internal string DumpMergedDictionariesLoadingResourceDictionary(string url)
                {
                    var target = new LoadingResourceDictionary();

                    return(ResourceDictionaryUtilities.DumpMergedDictionaries(target, url));
                }