entity.MetaEditor2.Indices.BaseField_Leave C# (CSharp) Method

BaseField_Leave() public method

public BaseField_Leave ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        public override void BaseField_Leave(object sender, EventArgs e)
        {
            System.IO.BinaryWriter bw = new System.IO.BinaryWriter(meta.MS);
            if (((WinMetaEditor)this.ParentForm).checkSelectionInCurrentTag())
                bw.BaseStream.Position = this.offsetInMap - meta.offset;

            string tempstring1 = this.comboBox1.Text;
            if (tempstring1.Contains(" Is Invalid. On Line ") || tempstring1.Contains("Something is wrong with this ") || tempstring1.Contains(" : Value is Too Small To Be An Index") || tempstring1.Contains(" : Value is Too Large To Be The Indexer"))
                return;
            if (tempstring1 == "nulled")
                this.Value = -1;
            if (tempstring1.Contains(" : "))
            {
                int counter;
                for (counter = 0; counter < tempstring1.Length; counter++)
                {
                    if (tempstring1[counter] == ' ')
                    {
                        break;
                    }
                }
                this.Value = Convert.ToInt32(tempstring1.Substring(0, counter));
            }
            try
            {
                switch (_ValueType)
                {
                    case IFPIO.ObjectEnum.Short:
                        {
                            bw.Write(Convert.ToInt16(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Int:
                        {
                            bw.Write(Convert.ToInt32(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.UShort:
                        {
                            bw.Write(Convert.ToUInt16(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.UInt:
                        {
                            bw.Write(Convert.ToUInt32(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Float:
                        {
                            bw.Write(Convert.ToSingle(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Unknown:
                        {
                            bw.Write(Convert.ToSingle(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Byte:
                        {
                            bw.Write(Convert.ToByte(this.Value));
                            break;
                        }
                }
            }
            catch
            {
                MessageBox.Show("Something is wrong with this " + this._ValueType.ToString() + this.EntName + " Offset " + this.chunkOffset.ToString());
            }
        }