Пример #1
0
		public void DefaultValues ()
		{
			var s = new XamlReaderSettings ();
			Assert.IsFalse (s.AllowProtectedMembersOnRoot, "#1");
			Assert.IsNull (s.BaseUri, "#2");
			Assert.IsFalse (s.IgnoreUidsOnPropertyElements, "#3");
			Assert.IsNull (s.LocalAssembly, "#4");
			Assert.IsFalse (s.ProvideLineInfo, "#5");
			Assert.IsFalse (s.ValuesMustBeString, "#6");
		}
 public XamlReaderSettings(XamlReaderSettings settings) : this()
 {
     if (settings != null)
     {
         this.AllowProtectedMembersOnRoot = settings.AllowProtectedMembersOnRoot;
         this.ProvideLineInfo = settings.ProvideLineInfo;
         this.BaseUri = settings.BaseUri;
         this.LocalAssembly = settings.LocalAssembly;
         this.IgnoreUidsOnPropertyElements = settings.IgnoreUidsOnPropertyElements;
         this.ValuesMustBeString = settings.ValuesMustBeString;
     }
 }
Пример #3
0
 public XamlReaderSettings(XamlReaderSettings settings) : this()
 {
     if (settings != null)
     {
         AllowProtectedMembersOnRoot = settings.AllowProtectedMembersOnRoot;
         ProvideLineInfo             = settings.ProvideLineInfo;
         BaseUri       = settings.BaseUri;
         LocalAssembly = settings.LocalAssembly;
         IgnoreUidsOnPropertyElements = settings.IgnoreUidsOnPropertyElements;
         ValuesMustBeString           = settings.ValuesMustBeString;
     }
 }
Пример #4
0
		public XamlReaderSettings (XamlReaderSettings settings)
		{
			// null settings is allowed (!)
			var s = settings;
			if (s == null)
				return;

			AllowProtectedMembersOnRoot = s.AllowProtectedMembersOnRoot;
			BaseUri = s.BaseUri;
			IgnoreUidsOnPropertyElements = s.IgnoreUidsOnPropertyElements;
			LocalAssembly = s.LocalAssembly;
			ProvideLineInfo = s.ProvideLineInfo;
			ValuesMustBeString = s.ValuesMustBeString;
		}
Пример #5
0
        public XamlReaderSettings(XamlReaderSettings settings)
        {
            // null settings is allowed (!)
            var s = settings;

            if (s == null)
            {
                return;
            }

            AllowProtectedMembersOnRoot = s.AllowProtectedMembersOnRoot;
            BaseUri = s.BaseUri;
            IgnoreUidsOnPropertyElements = s.IgnoreUidsOnPropertyElements;
            LocalAssembly      = s.LocalAssembly;
            ProvideLineInfo    = s.ProvideLineInfo;
            ValuesMustBeString = s.ValuesMustBeString;
        }
Пример #6
0
		public void CopyConstructor ()
		{
			var s = new XamlReaderSettings ();
			s.AllowProtectedMembersOnRoot = true;
			s.IgnoreUidsOnPropertyElements = true;
			s.ProvideLineInfo = true;
			s.ValuesMustBeString = true;
			s.BaseUri = new Uri ("urn:foo");
			s.LocalAssembly = typeof (object).Assembly;

			s = new XamlReaderSettings (s);

			Assert.IsTrue (s.AllowProtectedMembersOnRoot, "#1");
			Assert.IsTrue (s.BaseUri.Equals (new Uri ("urn:foo")), "#2");
			Assert.IsTrue (s.IgnoreUidsOnPropertyElements, "#3");
			Assert.AreEqual (typeof (int).Assembly, s.LocalAssembly, "#4");
			Assert.IsTrue (s.ProvideLineInfo, "#5");
			Assert.IsTrue (s.ValuesMustBeString, "#6");
		}
Пример #7
0
        public Baml2006Reader(Stream stream, XamlReaderSettings xamlReaderSettings) 
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream"); 
            }
            if (xamlReaderSettings == null) 
            { 
                throw new ArgumentNullException("xamlReaderSettings");
            } 
            Baml2006SchemaContext schemaContext;
            if (xamlReaderSettings.ValuesMustBeString)
            {
                schemaContext = new Baml2006SchemaContext(xamlReaderSettings.LocalAssembly, System.Windows.Markup.XamlReader.XamlV3SharedSchemaContext); 
            }
            else 
            { 
                schemaContext = new Baml2006SchemaContext(xamlReaderSettings.LocalAssembly);
            } 
            var settings = new Baml2006ReaderSettings(xamlReaderSettings);

            Initialize(stream, schemaContext, settings);
        } 
Пример #8
0
 public Baml2006ReaderSettings(XamlReaderSettings settings)
     : base(settings)
 {
 }