AoMBrgEditor.PssgAttribute.UpdateSize C# (CSharp) Method

UpdateSize() public method

public UpdateSize ( ) : void
return void
        public void UpdateSize()
        {
            if (data is string)
            {
                size = 4 + Encoding.UTF8.GetBytes((string)data).Length;
            }
            else if (data is UInt16)
            {
                size = EndianBitConverter.Big.GetBytes((UInt16)data).Length;
            }
            else if (data is UInt32)
            {
                size = EndianBitConverter.Big.GetBytes((UInt32)data).Length;
            }
            else if (data is Int16)
            {
                size = EndianBitConverter.Big.GetBytes((Int16)data).Length;
            }
            else if (data is Int32)
            {
                size = EndianBitConverter.Big.GetBytes((Int32)data).Length;
            }
            else if (data is Single)
            {
                size = EndianBitConverter.Big.GetBytes((Single)data).Length;
            }
            else if (data is bool)
            {
                size = EndianBitConverter.Big.GetBytes((bool)data).Length;
            }
            else
            {
                size = ((byte[])data).Length;
            }
        }