当前位置: 首页>>代码示例>>C#>>正文


C# IsolatedStorageFile.MoveFile方法代码示例

本文整理汇总了C#中System.IO.IsolatedStorage.IsolatedStorageFile.MoveFile方法的典型用法代码示例。如果您正苦于以下问题:C# IsolatedStorageFile.MoveFile方法的具体用法?C# IsolatedStorageFile.MoveFile怎么用?C# IsolatedStorageFile.MoveFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.IO.IsolatedStorage.IsolatedStorageFile的用法示例。


在下文中一共展示了IsolatedStorageFile.MoveFile方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Rename

        /// <summary>
        /// Changes the name of this savegame.
        /// </summary>
        /// <param name="tag"></param>
        /// <param name="name"></param>
        public void Rename(CartridgeTag tag, string name, IsolatedStorageFile isf)
        {
            string oldGwsFile = SavegameFile;
            string oldMdFile = MetadataFile;
            
            // Changes the properties.
            Name = name;
            SetFileProperties(tag);

            // Renames the files.
            if (isf.FileExists(oldGwsFile))
            {
                isf.MoveFile(oldGwsFile, SavegameFile);
            }
            if (isf.FileExists(oldMdFile))
            {
                isf.MoveFile(oldMdFile, MetadataFile);
            }
        }
开发者ID:chier01,项目名称:WF.Player.WinPhone,代码行数:24,代码来源:CartridgeSavegame.cs

示例2: recoverAccountItems

        private void recoverAccountItems(IsolatedStorageFile isolatedStorage, Dictionary<string, List<AccountItem>> transactionItems, List<string> fileMessages, List<Guid> accountIds, List<Guid> categoryIds = null)
        {
            var sum = 0;
            foreach (var pair in transactionItems)
            {
                var file = pair.Key;
                int num2 = 0;
                try
                {
                    var allTasks = this.dataContext.TallyScheduleTable.Where(p => p.ProfileRecordType == ScheduleRecordType.ScheduledRecord)
                        .ToList();

                    var taskId = Guid.Empty;

                    TallySchedule taskInfo = allTasks.Count > 0 ? allTasks[0] : null;

                    foreach (var item in pair.Value)
                    {
                        if (accountIds.Count(p => p == item.AccountId) > 0 && categoryIds.Count(p => p == item.CategoryId) > 0)
                        {
                            if (taskInfo != null && taskInfo.Id != item.AutoTokenId)
                            {
                                taskInfo = allTasks.FirstOrDefault(p => p.Id == item
                                    .AutoTokenId);
                            }

                            ExpenseOrIncomeScheduleHanlder.RecoverItemProcessor(item, taskInfo);
                            sum++;
                        }
                        else
                        {
                            fileMessages.Add("Failed to add item: {0}, cause of account or category mismatched.".FormatWith(new object[] { item.Id }));
                        }
                    }
                }
                catch (System.Exception exception2)
                {
                    num2++;
                    string destinationFileName = pair.Key.Replace(".xml", ".err.xml");
                    fileMessages.Add("Failed to add items in file: {0}, cause of account or category mismatched. Have Renamed data file to {1}. details:\r\n{2}".FormatWith(new object[] { pair.Key, destinationFileName, exception2.Message }));
                    isolatedStorage.MoveFile(file, destinationFileName);
                }

                if (num2 > 0)
                {
                    this.SaveErrorsTo("recoveryDataError.log", new string[] { "Some items can't add to database.\r\n" + fileMessages.ToStringLine<string>("\r\n") });
                }
                else
                {
                    isolatedStorage.DeleteFile(file);
                }
            }

            this.dataContext.SubmitChanges();
        }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:55,代码来源:SchedulePlanningManager.cs

示例3: MoveOldCrashlogsIfNeeded

 public void MoveOldCrashlogsIfNeeded(IsolatedStorageFile store)
 {
     try
     {
         if (store.DirectoryExists(Constants.OldCrashDirectoryName))
         {
             var files = store.GetFileNames(Path.Combine(Constants.OldCrashDirectoryName, Constants.CrashFilePrefix + "*.log"));
             if (files.Length > 0)
             {
                 if (!store.DirectoryExists(Constants.CrashDirectoryName))
                 {
                     store.CreateDirectory(Constants.CrashDirectoryName);
                 }
                 foreach (var fileName in files)
                 {
                     store.MoveFile(Path.Combine(Constants.OldCrashDirectoryName, Path.GetFileName(fileName)), Path.Combine(Constants.CrashDirectoryName, Path.GetFileName(fileName)));
                 }
                 if (store.GetFileNames(Path.Combine(Constants.OldCrashDirectoryName, Constants.CrashFilePrefix + "*.*")).Length == 0)
                 {
                     store.DeleteDirectory(Constants.OldCrashDirectoryName);
                 }
             }
         }
     }
     catch (Exception e)
     {
         HockeyClient.Current.AsInternal().HandleInternalUnhandledException(e);
     }
 }
开发者ID:bitstadium,项目名称:HockeySDK-Windows,代码行数:29,代码来源:CrashHandler.cs

示例4: recoverTransferingItems

        private void recoverTransferingItems(IsolatedStorageFile isolatedStorage, Dictionary<string, List<TransferingItem>> transferingItems, List<string> fileMessages, List<Guid> accountIds)
        {
            var sum = 0;
            foreach (var pair in transferingItems)
            {
                var file = pair.Key;
                int num2 = 0;
                try
                {
                    Deployment.Current.Dispatcher.BeginInvoke(() =>
                    {
                        foreach (var item in pair.Value)
                        {
                            if ((accountIds.Count(p => p == item.FromAccountId) > 0)
                                && (accountIds.Count(p => p == item.ToAccountId) > 0))
                            {
                                sum++;
                                TransferingItemTaskHandler.RecoverItemProcessor(item);
                            }
                            else
                            {
                                fileMessages.Add("Failed to add item: {0}, cause of account missed.".FormatWith(new object[] { item.Id }));
                            }
                        }
                    });
                }
                catch (System.Exception exception2)
                {
                    num2++;
                    string destinationFileName = pair.Key.Replace(".xml", ".err.xml");
                    fileMessages.Add("Failed to add items in file: {0}, cause of account or category mismatched. Have Renamed data file to {1}. details:\r\n{2}".FormatWith(new object[] { pair.Key, destinationFileName, exception2.Message }));
                    isolatedStorage.MoveFile(file, destinationFileName);
                }

                if (num2 > 0)
                {
                    this.SaveErrorsTo("recoveryDataError.log", new string[] { "Some items can't add to database.\r\n" + fileMessages.ToStringLine<string>("\r\n") });
                }
                else
                {
                    isolatedStorage.DeleteFile(file);
                }
            }

            this.dataContext.SubmitChanges();
        }
开发者ID:RukaiYu,项目名称:TinyMoneyManager.WP8,代码行数:46,代码来源:SchedulePlanningManager.cs

示例5: RenameNote

 public static void RenameNote(string orig, string change, IsolatedStorageFile iStorage)
 {
     iStorage.MoveFile(orig + ".scribble", change + ".scribble");
 }
开发者ID:tobitech,项目名称:scribbles,代码行数:4,代码来源:Note.cs


注:本文中的System.IO.IsolatedStorage.IsolatedStorageFile.MoveFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。