예제 #1
0
        /// <summary>
        /// Doc
        /// </summary>
        public void Commit()
        {
            bool bDifferent = Lines.Count != OriginalLines.Count;

            if (!bDifferent)
            {
                for (int i = 0; i < Lines.Count; ++i)
                {
                    if (Lines[i] != OriginalLines[i])
                    {
                        bDifferent = true;
                        break;
                    }
                }
            }

            if (bDifferent)
            {
                MakeFileWriteable(MyFile.FullName);
                if (!InternalUtils.SafeWriteAllLines(MyFile.FullName, Lines.ToArray()))
                {
                    throw new AutomationException("Unable to update version info in {0}", MyFile.FullName);
                }
                OriginalLines = Lines;
            }
        }
예제 #2
0
 /// <summary>
 /// Doc
 /// </summary>
 public void Commit()
 {
     MyFile.IsReadOnly = false;
     if (!InternalUtils.SafeWriteAllLines(MyFile.FullName, Lines.ToArray()))
     {
         throw new AutomationException("Unable to update version info in {0}", MyFile.FullName);
     }
 }