Slight refactoring in TextInputBuffer

internals
Eric Mellino 8 years ago
parent 4e897f7534
commit 8ad4d8511f
  1. 15
      src/ImGui.NET/TextInputBuffer.cs

@ -56,11 +56,20 @@ namespace ImGuiNET
Length = 0;
}
public string GetString()
public string StringValue
{
return Marshal.PtrToStringAnsi(Buffer);
get
{
return Marshal.PtrToStringAnsi(Buffer);
}
set
{
FreeNativeBuffer();
Buffer = Marshal.StringToHGlobalAnsi(value);
Length = (uint)value.Length;
}
}
public override string ToString() => GetString();
public override string ToString() => StringValue;
}
}

Loading…
Cancel
Save