public bool Save(string FilePath, string Version, List <String> Lines, MSGParser FOObj, Dictionary <String, ItemProtoCustomField> CustomFields)
        {
            List <int> ProcessedPids  = new List <int>();
            bool       DuplicateFound = false;

            _saveLines.Clear();
            _saveLines.Add("# " + Version);
            _saveLines.Add("");

            _saveProtos.Sort();

            int j = _saveProtos.Count;

            for (int i = 0; i < j; i++)
            {
                _saveLines.Add("[Proto]");
                ItemProto Prot = _saveProtos[i];

                ParseData(ref Prot, false, false);

                if (ProcessedPids.Contains(Prot.ProtoId))
                {
                    Utils.Log("An object with the ProtoId " + Prot.ProtoId + " was already saved. Skipping proto '" + Prot.Name + '\'');
                    //Message.Show("An object with the ProtoId " + Prot.ProtoId + " was already saved. Skipping proto '"+Prot.Name+'\'',
                    //    System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error, true);
                    DuplicateFound = true;
                    continue;
                }
                if (Prot != null && Prot.CustomFields != null)
                {
                    foreach (KeyValuePair <String, ItemProtoCustomField> kvp in Prot.CustomFields)
                    {
                        if (kvp.Value.Value is bool)
                        {
                            _saveLines.Add(kvp.Key + "=" + ((bool)kvp.Value.Value == true?"1":"0"));
                        }
                        else
                        {
                            _saveLines.Add(kvp.Key + "=" + kvp.Value.Value.ToString());
                        }
                    }
                }
                if (!String.IsNullOrEmpty(Prot.Name))
                {
                    FOObj.WriteMSGLine(Prot.ProtoId * 100, Prot.Name, 0);
                }
                if (!String.IsNullOrEmpty(Prot.Description))
                {
                    FOObj.WriteMSGLine(Prot.ProtoId * 100 + 1, Prot.Description, 0);
                }
                _saveLines.Add("");

                ProcessedPids.Add(Prot.ProtoId);
            }

            FOObj.WriteFile(); // Flush file.
            return(DuplicateFound);
        }