Disable editing byte/int arrays under Mono runtime

This commit is contained in:
Justin Aquadro 2012-09-02 19:29:23 -04:00
parent dee77873ba
commit e036dbfacc
3 changed files with 26 additions and 4 deletions

View file

@ -1,4 +1,5 @@
using Substrate.Nbt; using System;
using Substrate.Nbt;
namespace NBTExplorer.Model namespace NBTExplorer.Model
{ {
@ -13,6 +14,11 @@ namespace NBTExplorer.Model
get { return base.Tag as TagNodeByteArray; } get { return base.Tag as TagNodeByteArray; }
} }
public override bool CanEditNode
{
get { return !IsMono(); }
}
public override bool EditNode () public override bool EditNode ()
{ {
return EditByteHexValue(Tag); return EditByteHexValue(Tag);
@ -22,5 +28,10 @@ namespace NBTExplorer.Model
{ {
get { return NodeDisplayPrefix + Tag.Data.Length + " bytes"; } get { return NodeDisplayPrefix + Tag.Data.Length + " bytes"; }
} }
private bool IsMono ()
{
return Type.GetType("Mono.Runtime") != null;
}
} }
} }

View file

@ -1,4 +1,5 @@
using Substrate.Nbt; using System;
using Substrate.Nbt;
namespace NBTExplorer.Model namespace NBTExplorer.Model
{ {
@ -13,6 +14,11 @@ namespace NBTExplorer.Model
get { return base.Tag as TagNodeIntArray; } get { return base.Tag as TagNodeIntArray; }
} }
public override bool CanEditNode
{
get { return !IsMono(); }
}
public override bool EditNode () public override bool EditNode ()
{ {
return EditIntHexValue(Tag); return EditIntHexValue(Tag);
@ -22,5 +28,10 @@ namespace NBTExplorer.Model
{ {
get { return NodeDisplayPrefix + Tag.Data.Length + " integers"; } get { return NodeDisplayPrefix + Tag.Data.Length + " integers"; }
} }
private bool IsMono ()
{
return Type.GetType("Mono.Runtime") != null;
}
} }
} }

View file

@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.1.0")] [assembly: AssemblyVersion("2.0.2.0")]
[assembly: AssemblyFileVersion("2.0.1.0")] [assembly: AssemblyFileVersion("2.0.2.0")]