Ejemplo n.º 1
0
 public static void ReportWallPost(WallPost wallPost, string adData = "")
 {
     if (string.IsNullOrEmpty(adData))
     {
         PageBase currentPage = FramePageUtils.CurrentPage;
         if (currentPage != null && currentPage.NavigationContext != null && currentPage.NavigationContext.QueryString.ContainsKey("AdData"))
         {
             adData = currentPage.NavigationContext.QueryString["AdData"];
         }
     }
     if (string.IsNullOrEmpty(adData))
     {
         PickerUC.ShowPickerFor(ReportContentHelper.GetPredefinedReportReasons(), (PickableItem)null, (Action <PickableItem>)(pi =>
         {
             if (wallPost.IsReply)
             {
                 WallService.Current.ReportComment(wallPost.from_id, wallPost.id, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)));
             }
             else
             {
                 WallService.Current.Report(wallPost.to_id, wallPost.id, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)));
             }
         }), (Action <PickableItem>)null, null, CommonResources.PostContains);
     }
     else
     {
         ReportContentHelper.ReportAdWallPost(adData);
     }
 }
Ejemplo n.º 2
0
 private static void ReportAdWallPost(string adData)
 {
     PickerUC.ShowPickerFor(ReportContentHelper.GetPredefinedAdReportReasons(), (PickableItem)null, (Action <PickableItem>)(pi => AdsIntService.ReportAd(adData, (ReportAdReason)pi.ID, (Action <BackendResult <VKClient.Audio.Base.ResponseWithId, ResultCode> >)(res =>
     {
         EventAggregator.Current.Publish((object)new AdReportedEvent()
         {
             AdData = adData
         });
         GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null);
     }))), (Action <PickableItem>)null, null, CommonResources.PostContains);
 }
Ejemplo n.º 3
0
        internal static void ReportComment(long fromId, long id, LikeObjectType likeObjectType)
        {
            PickerUC.ShowPickerFor(ReportContentHelper.GetPredefinedReportReasons(), (PickableItem)null, (Action <PickableItem>)(pi =>
            {
                switch (likeObjectType)
                {
                case LikeObjectType.comment:
                    WallService.Current.ReportComment(fromId, id, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)));
                    break;

                case LikeObjectType.photo_comment:
                    PhotosService.Current.ReportComment(fromId, id, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)));
                    break;

                case LikeObjectType.video_comment:
                    VideoService.Instance.ReportComment(fromId, id, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)));
                    break;
                }
            }), (Action <PickableItem>)null, null, CommonResources.CommentContains);
        }
Ejemplo n.º 4
0
 public static void ReportVideo(long ownerId, long videoId)
 {
     PickerUC.ShowPickerFor(ReportContentHelper.GetPredefinedReportReasons(), (PickableItem)null, (Action <PickableItem>)(pi => VideoService.Instance.Report(ownerId, videoId, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)))), (Action <PickableItem>)null, null, CommonResources.VideoContains);
 }
Ejemplo n.º 5
0
 public static void ReportPhoto(long ownerId, long photoId)
 {
     PickerUC.ShowPickerFor(ReportContentHelper.GetPredefinedReportReasons(), null, (pi => PhotosService.Current.Report(ownerId, photoId, (ReportReason)pi.ID, (Action <BackendResult <VKClient.Common.Backend.DataObjects.ResponseWithId, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)))), null, null, CommonResources.PhotoContains);
 }
Ejemplo n.º 6
0
 public static void ReportApp(long appId, long ownerId = 0)
 {
     PickerUC.ShowPickerFor(ReportContentHelper.GetPredefinedAppReportReasons(), null, (pi => AppsService.Instance.Report(appId, (ReportAppReason)pi.ID, ownerId, "", (Action <BackendResult <int, ResultCode> >)(res => GenericInfoUC.ShowBasedOnResult((int)res.ResultCode, CommonResources.ReportSent, (VKRequestsDispatcher.Error)null)))), null, null, CommonResources.Report.ToUpperInvariant());
 }
Ejemplo n.º 7
0
 private void DoNotDisturbClick(object sender, RoutedEventArgs e)
 {
     PickerUC.ShowPickerFor(new ObservableCollection <PickableItem>(SettingsNotificationsViewModel.DoNotDisturbOptions), null, (pi => this.VM.Disable((int)(pi.ID * 3600L))), null, null, CommonResources.Settings_Notifications_DoNotDisturb.ToUpperInvariant());
 }