Save() public method

public Save ( bool isBinaryFormat = false, string path = "" ) : void
isBinaryFormat bool
path string
return void
Example #1
0
 internal void Save(PlistEditControl edit = null, bool saveAs = false, bool isBinaryFormat = false)
 {
     if (edit == null)
     {
         edit = curEditor;
     }
     if (edit == null)
     {
         return;
     }
     //正常打开的文件
     if (!saveAs && !edit.Pinfo.IsTemp)
     {
         edit.Save();
     }
     else
     {
         //新建或者另存为的文件
         using (SaveFileDialog sfd = new SaveFileDialog())
         {
             sfd.Filter = "PList(*.plist)|*.plist|All files|*.*";
             if (sfd.ShowDialog() == DialogResult.OK)
             {
                 edit.Save(isBinaryFormat, sfd.FileName);
             }
         }
     }
 }
Example #2
0
        internal void Save(PlistEditControl edit =null, bool saveAs = false, bool isBinaryFormat =false)
        {
            if (edit == null)
            {
                edit = curEditor;
            }
            if (edit == null)
            {
                return;
            }
            //正常打开的文件
            if (!saveAs && !edit.Pinfo.IsTemp)
            {
                edit.Save();
            }
            else
            {
                //新建或者另存为的文件
                using (SaveFileDialog sfd = new SaveFileDialog())
                {
                    sfd.Filter = "PList(*.plist)|*.plist|All files|*.*";
                    if (sfd.ShowDialog() == DialogResult.OK)
                    {
                        edit.Save(isBinaryFormat, sfd.FileName);
                    }

                }
            }
        }