コード例 #1
0
        public static bool Save(this GlueProjectSave glueProjectSave, string tag, string fileName, out Exception lastException)
        {
            int failures = 0;
            // This gives Glue 2 chances to save....but not like weekend sales at RC Willey
            const int maxFailures = 3;

            bool succeeded = false;

            lastException = null;

            while (failures < maxFailures)
            {
                try
                {
                    glueProjectSave.SaveToFile(fileName, tag);

                    succeeded = true;
                    break;
                }
                catch (IOException ioe)
                {
                    lastException = ioe;
                    System.Threading.Thread.Sleep(200);
                    failures++;
                }
                catch (UnauthorizedAccessException uae)
                {
                    lastException = uae;
                    System.Threading.Thread.Sleep(200);
                    failures++;
                }
            }

            return(succeeded);
        }
コード例 #2
0
 public static void Save(this GlueProjectSave glueprojectsave, string tag, string fileName)
 {
     glueprojectsave.SaveToFile(fileName, tag);
 }