IPATools.PlistEditor.PlistInfo.Save C# (CSharp) Method

Save() private method

private Save ( string content, bool isBinaryFormat = false, string path = "" ) : bool
content string
isBinaryFormat bool
path string
return bool
        internal bool Save(string content, bool isBinaryFormat = false, string path = "")
        {
            bool returnValue = true;
            object obj = null;
            try
            {
                obj = Plist.readPlist(Encoding.UTF8.GetBytes(content));
                //需要重新写文件
                if (!string.IsNullOrEmpty(path))
                {
                    if (isBinaryFormat)
                    {
                        pt = plistType.Binary;
                    }
                    else
                    {
                        pt = plistType.Xml;
                    }
                    IsBinary = isBinaryFormat;
                }
                else
                {
                    path = Info.FullName;
                }
                returnValue = CreateFileStream(path);

                if (returnValue)
                {
                    if (pt == plistType.Binary)
                    {
                        Plist.writeBinary(obj, fs);
                    }
                    else
                    {
                        Plist.writeXml(obj, fs);
                    }
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                returnValue = false;
            }
            return returnValue;
        }