コード例 #1
0
        internal async Task <IFeedbackMessage> PostMessageAsync(FeedbackMessageVM msgVM)
        {
            var msg = await this.FeedbackThread.PostFeedbackMessageAsync(msgVM.Message, msgVM.Email, msgVM.Subject, msgVM.Username, msgVM.Attachments.Select(att => att.FeedbackAttachment));

            FeedbackManager.Current.SaveFeedbackThreadTokens();
            return(msg);
        }
コード例 #2
0
 internal void HandleSentMessage(IFeedbackMessage sentMsg)
 {
     if (!this.Messages.Any(msgVM => msgVM.FeedbackMessage.Id == sentMsg.Id))
     {
         this.Messages.Add(new FeedbackMessageVM(sentMsg as FeedbackMessage));
     }
     this.NewMessage = new FeedbackMessageVM() { FeedbackThreadVM = this };
 }
コード例 #3
0
 internal void HandleSentMessage(IFeedbackMessage sentMsg)
 {
     if (!this.Messages.Any(msgVM => msgVM.FeedbackMessage.Id == sentMsg.Id))
     {
         this.Messages.Add(new FeedbackMessageVM(sentMsg as FeedbackMessage));
     }
     this.NewMessage = new FeedbackMessageVM()
     {
         FeedbackThreadVM = this
     };
 }
コード例 #4
0
        internal static async Task <FeedbackMessageVM> LoadFeedbackMessageVMFromStorageAsync()
        {
            var helper     = HockeyClient.Current.AsInternal().PlatformHelper;
            var feedbackVM = new FeedbackMessageVM();

            if (await helper.FileExistsAsync(ConstantsUniversal.OpenFeedbackMessageFile, ConstantsUniversal.FeedbackAttachmentTmpDir))
            {
                DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(FeedbackMessage));
                using (var stream = await helper.GetStreamAsync(ConstantsUniversal.OpenFeedbackMessageFile, ConstantsUniversal.FeedbackAttachmentTmpDir))
                {
                    feedbackVM.FeedbackMessage = serializer.ReadObject(stream) as FeedbackMessage;
                }
                var files = await helper.GetFileNamesAsync(ConstantsUniversal.FeedbackAttachmentTmpDir, "*" + FeedbackAttachmentVM.AttachmentFileExt);

                foreach (var filename in files.ToList().OrderBy(f => f))
                {
                    feedbackVM.Attachments.Add(await FeedbackAttachmentVM.LoadFromStorageAsync(filename));
                }
            }
            return(feedbackVM);
        }
コード例 #5
0
 internal static async Task<FeedbackMessageVM> LoadFeedbackMessageVMFromStorageAsync()
 {
     var helper = HockeyClient.Current.AsInternal().PlatformHelper;
     var feedbackVM = new FeedbackMessageVM();
     if (await helper.FileExistsAsync(ConstantsUniversal.OpenFeedbackMessageFile, ConstantsUniversal.FeedbackAttachmentTmpDir))
     {
         DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(FeedbackMessage));
         using (var stream = await helper.GetStreamAsync(ConstantsUniversal.OpenFeedbackMessageFile, ConstantsUniversal.FeedbackAttachmentTmpDir))
         {
             feedbackVM.FeedbackMessage = serializer.ReadObject(stream) as FeedbackMessage;
         }
         var files = await helper.GetFileNamesAsync(ConstantsUniversal.FeedbackAttachmentTmpDir,"*" + FeedbackAttachmentVM.AttachmentFileExt);
         foreach(var filename in files.ToList().OrderBy(f => f))
         {
             feedbackVM.Attachments.Add(await FeedbackAttachmentVM.LoadFromStorageAsync(filename));
         }
     }
     return feedbackVM;
 }
コード例 #6
0
 internal async Task<IFeedbackMessage> PostMessageAsync(FeedbackMessageVM msgVM)
 {
     var msg = await this.FeedbackThread.PostFeedbackMessageAsync(msgVM.Message, msgVM.Email, msgVM.Subject, msgVM.Username, msgVM.Attachments.Select(att => att.FeedbackAttachment));
     FeedbackManager.Current.SaveFeedbackThreadTokens();
     return msg;
 }