public void ITRSNotUsedWhenNodeCreatedNew ()
		{
			ResXDataNode node;
			node = new ResXDataNode ("along", 34L);

			string returnedType = node.GetValueTypeName (new ReturnIntITRS ());
			Assert.AreEqual ((typeof (long)).AssemblyQualifiedName, returnedType, "#A1");
		}
예제 #2
0
        public IconEntry(ResourceCatalog _owner, ResXDataNode _node, bool isMeta)
        {
            if (_node == null)
                throw new ArgumentNullException ("node");

            string nodeTypeName = _node.GetValueTypeName ((AssemblyName []) null);
            if (!nodeTypeName.StartsWith ("System.Drawing.Icon, System.Drawing"))
                throw new ArgumentException ("node","Invalid resource type");

            if (_owner == null)
                throw new ArgumentNullException ("owner");
            IsMeta = isMeta;
            Owner = _owner;
            node = _node;
            SetRelativePos ();
        }
        public StringEntry(ResourceCatalog _owner, ResXDataNode _node, bool isMeta)
        {
            if (_node == null)
                throw new ArgumentNullException ("node");
            if (!_node.GetValueTypeName ((AssemblyName []) null).StartsWith ("System.String, mscorlib"))
                throw new ArgumentException ("node","Should be string resource");
            if (_node.FileRef != null)
                throw new ArgumentException ("node", "FileRef should not be set");
            if (_owner == null)
                throw new ArgumentNullException ("owner");

            IsMeta = isMeta;
            Owner = _owner;
            node = _node;
            SetRelativePos ();
        }
        public BinaryOrStringEntry(ResourceCatalog _owner, ResXDataNode _node, bool isMeta)
        {
            if (_node == null)
                throw new ArgumentNullException ("node");
            if (_node.FileRef == null)
                throw new ArgumentNullException ("node","FileRef should be set");

            string nodeTypeName = _node.GetValueTypeName ((AssemblyName []) null);
            if (!nodeTypeName.StartsWith ("System.String, mscorlib") &&
                !nodeTypeName.StartsWith ("System.Byte[], mscorlib"))
                throw new ArgumentException ("node","Only string or byte[] TypeName allowed");

            if (_owner == null)
                throw new ArgumentNullException ("owner");
            IsMeta = isMeta;
            Owner = _owner;
            node = _node;
            SetRelativePos ();
        }
        public OtherFileEntry(ResourceCatalog _owner, ResXDataNode _node, bool isMeta)
        {
            if (_node == null)
                throw new ArgumentNullException ("node");
            if (_node.FileRef == null)
                throw new ArgumentNullException ("node","FileRef should be set");

            string nodeTypeName = _node.GetValueTypeName ((AssemblyName []) null);
            if (nodeTypeName.StartsWith ("System.String, mscorlib") ||
                nodeTypeName.StartsWith ("System.Drawing.Bitmap, System.Drawing") ||
                nodeTypeName.StartsWith ("System.Drawing.Icon, System.Drawing") ||
                nodeTypeName.StartsWith ("System.IO.MemoryStream, mscorlib"))
                throw new ArgumentException ("node","Invalid resource type");

            if (_owner == null)
                throw new ArgumentNullException ("owner");
            IsMeta = isMeta;
            Owner = _owner;
            node = _node;
            SetRelativePos ();
        }
예제 #6
0
		public void NullObjectGetValueTypeNameIsNull ()
		{
			ResXDataNode node = new ResXDataNode ("aname", (object) null);
			Assert.IsNull (node.GetValueTypeName ((AssemblyName []) null), "#A1");
		}
		public void IfTypeResolutionFailsReturnsOrigString()
		{
			ResXFileRef fileRef = new ResXFileRef ("afile.name", "a.type.name");
			ResXDataNode node = new ResXDataNode ("aname", fileRef);

			string returnedType = node.GetValueTypeName ((AssemblyName []) null);
			Assert.AreEqual ("a.type.name", returnedType);
		}
		public void AttemptsTypeResolution ()
		{
			ResXFileRef fileRef = new ResXFileRef ("afile.name", "System.String");
			ResXDataNode node = new ResXDataNode ("aname", fileRef);

			string returnedType = node.GetValueTypeName ((AssemblyName []) null);
			Assert.AreEqual (typeof (string).AssemblyQualifiedName, returnedType);
		}