コード例 #1
0
 public override string ToString()
 {
     if (Value is byte[] bval)
     {
         return(HexHelper.ByteArrayToHexViaLookup32(bval));
     }
     else
     {
         return(this.Value.ToString() ?? string.Empty);
     }
 }
コード例 #2
0
 public override string ToString()
 {
     if (ValueType == typeof(byte[]))
     {
         return(HexHelper.ByteArrayToHexViaLookup32((byte[])this.Value));
     }
     else
     {
         return(this.Value.ToString());
     }
 }
コード例 #3
0
ファイル: PssgNode.cs プロジェクト: ptasev/Ego-Engine-Modding
        public override string ToString()
        {
            var valueType = GetValueType();

            if (valueType == typeof(float[]))
            {
                return(ToString <float>(d => BinaryPrimitives.ReadSingleBigEndian(d).ToString("e9", System.Globalization.CultureInfo.InvariantCulture)));
            }
            else if (valueType == typeof(ushort[]))
            {
                return(ToString <ushort>(d => BinaryPrimitives.ReadUInt16BigEndian(d).ToString()));
            }
            else
            {
                return(HexHelper.ByteArrayToHexViaLookup32((byte[])Value, NodeInfo.ElementsPerRow));
            }
        }
コード例 #4
0
 public override string ToString()
 {
     PssgSchema.Node sNode = this.NodeInfo;// PssgSchema.GetNode(this.Name);
     if (ValueType == typeof(Single[]))
     {
         string result = string.Empty;
         for (int i = 0; i < ((Single[])Value).Length; i++)
         {
             if (i % sNode.ElementsPerRow == 0)
             {
                 result += Environment.NewLine;
             }
             result += ((Single[])Value)[i].ToString("e9", System.Globalization.CultureInfo.InvariantCulture);
             result += " ";
         }
         return(result);
     }
     else if (ValueType == typeof(UInt16[]))
     {
         string result = string.Empty;
         for (int i = 0; i < ((UInt16[])Value).Length; i++)
         {
             if (i % sNode.ElementsPerRow == 0)
             {
                 result += Environment.NewLine;
             }
             result += ((UInt16[])Value)[i].ToString();
             result += " ";
         }
         return(result);
     }
     else
     {
         return(HexHelper.ByteArrayToHexViaLookup32((byte[])Value, sNode.ElementsPerRow));
     }
 }