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

Save() public method

public Save ( ) : void
return void
        public override void Save()
        {
            if (this.isNulledOutReflexive == true)
                return;
            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));
            }
            bool openedMap = false;
            if (map.isOpen == false)
            {
                map.OpenMap(MapTypes.Internal);
                openedMap = true;
            }
            try
            {
                map.BW.BaseStream.Position = this.offsetInMap;
                switch (_ValueType)
                {
                    case IFPIO.ObjectEnum.Short:
                        {
                            map.BW.Write(Convert.ToInt16(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Int:
                        {
                            map.BW.Write(Convert.ToInt32(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.UShort:
                        {
                            map.BW.Write(Convert.ToUInt16(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.UInt:
                        {
                            map.BW.Write(Convert.ToUInt32(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Float:
                        {
                            map.BW.Write(Convert.ToSingle(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Unknown:
                        {
                            map.BW.Write(Convert.ToSingle(this.Value));
                            break;
                        }
                    case IFPIO.ObjectEnum.Byte:
                        {
                            map.BW.Write(Convert.ToByte(this.Value));
                            break;
                        }
                }
            }
            catch
            {
                MessageBox.Show("Something is wrong with this " + this._ValueType.ToString() + this.EntName + " Offset " + this.chunkOffset.ToString());
            }
            if (openedMap == true)
                map.CloseMap();
        }