예제 #1
0
        public static bool PrepareForSave(MediaCenterLibraryCache cache)
        {
            bool flag = true;

            foreach (string path2 in cache.LoadedFiles)
            {
                string str = Path.Combine(cache.SearchPath, path2);
                if (File.Exists(str))
                {
                    VmcStudioUtil.BackupFile(str);
                    if (!VmcStudioUtil.TakeOwnership(str))
                    {
                        throw new VmcStudioException(string.Format("Could not take ownership of {0}.", (object)str));
                    }
                }
                else
                {
                    Trace.TraceWarning("File not found: {0}", new object[1]
                    {
                        (object)str
                    });
                }
            }
            if (!VmcStudioUtil.EnsureMediaCenterClosed(true))
            {
                flag = false;
            }
            return(flag);
        }