Ejemplo n.º 1
0
        /// <summary> </summary>
        public override WzVariant Clone()
        {
            WzBool clone = new WzBool(this.Name);

            clone.Value = this.Value;

            return(clone);
        }
Ejemplo n.º 2
0
        private WzVariant ReadVariant(WzFileStream stream)
        {
            WzVariant variant = null;

            string        name = stream.StringPool.Read();
            WzVariantType type = (WzVariantType)stream.Read1u();

            switch (type)
            {
            case WzVariantType.Empty:
                variant = new WzEmpty(name);
                break;

            case WzVariantType.Null:
                variant = new WzNull(name);
                break;

            case WzVariantType.Short:
                variant = new WzShort(name);
                break;

            case WzVariantType.Int:
                variant = new WzInt(name);
                break;

            case WzVariantType.Float:
                variant = new WzFloat(name);
                break;

            case WzVariantType.Double:
                variant = new WzDouble(name);
                break;

            case WzVariantType.String:
                variant = new WzString(name);
                break;

            case WzVariantType.Boolean:     // (0xFFFF = 1, 0x0000 = 0)
                variant = new WzBool(name);
                break;

            case WzVariantType.UInt:
                variant = new WzUInt(name);
                break;

            case WzVariantType.Long:
                variant = new WzLong(name);
                break;

            case WzVariantType.Dispatch:
                variant = new WzDispatch(name);
                break;
            }

            if (variant != null)
            {
                variant.Parent = this;
                variant.Read(stream);
            }

            return(variant);
        }