예제 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Saves the XLIFFDocument to the specified XLIFF file.
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void Save(string xliffFile)
        {
            var retry = true;

            for (;;)
            {
                try
                {
                    XLiffXmlSerializationHelper.SerializeToFile(xliffFile, this);
                    return;
                }
                catch (IOException)
                {
                    if (retry)
                    {
                        // Maybe the file was locked. Wait and try again.
                        retry = false;
                        Thread.Sleep(20);
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }
예제 #2
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Saves the XLIFFDocument to the specified XLIFF file.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public void Save(string xliffFile)
 {
     XLiffXmlSerializationHelper.SerializeToFile(xliffFile, this);
 }