コード例 #1
0
        private void HandleSelectedItem(object listBox, object selectedItem)
        {
            GroupHeader groupHeader = selectedItem as GroupHeader;

            if (groupHeader == null)
            {
                return;
            }
            if (this._pickManaged)
            {
                if (this._ownerId != 0L && this._picId != 0L)
                {
                    this.Share(this._text ?? "", groupHeader.Group.id, groupHeader.Group.name ?? "");
                }
                ParametersRepository.SetParameterForId("PickedGroupForRepost", (object)groupHeader.Group);
                EventAggregator.Current.Publish((object)new PhotoIsRepostedInGroup());
                ((Page)this).NavigationService.GoBackSafe();
            }
            else if (this._shareContentDataProvider != null)
            {
                this._shareContentDataProvider.StoreDataToRepository();
                ShareContentDataProviderManager.StoreDataProvider(this._shareContentDataProvider);
                Navigator.Current.NavigateToNewWallPost(groupHeader.Group.id, true, groupHeader.Group.admin_level, groupHeader.Group.GroupType == GroupType.PublicPage, false, false);
            }
            else
            {
                Navigator.Current.NavigateToGroup(groupHeader.Group.id, groupHeader.Group.name, false);
            }
        }
コード例 #2
0
ファイル: ProfileAppPage.cs プロジェクト: Makzz90/VKClient_re
        private void PrepareForSharing(string message)
        {
            ShareInternalContentDataProvider contentDataProvider = new ShareInternalContentDataProvider();

            contentDataProvider.Message = message;
            contentDataProvider.StoreDataToRepository();
            ShareContentDataProviderManager.StoreDataProvider((IShareContentDataProvider)contentDataProvider);
        }
コード例 #3
0
 protected override void HandleOnNavigatedFrom(NavigationEventArgs e)
 {
     base.HandleOnNavigatedFrom(e);
     if (e.NavigationMode == NavigationMode.Back || this._shareContentDataProvider == null)
     {
         return;
     }
     this._shareContentDataProvider.StoreDataToRepository();
     ShareContentDataProviderManager.StoreDataProvider(this._shareContentDataProvider);
 }
コード例 #4
0
ファイル: ShareContentUC.cs プロジェクト: Makzz90/VKClient_re
 private void ConversationsUCOnConversationTap(object sender, Action callback)
 {
     this.ShareContentDataProvider.StoreDataToRepository();
     ShareContentDataProviderManager.StoreDataProvider(this.ShareContentDataProvider);
     if (callback == null)
     {
         return;
     }
     callback();
 }
コード例 #5
0
        private void buttonSend_Click(object sender, EventArgs eventArgs)
        {
            ShareInternalContentDataProvider contentDataProvider = new ShareInternalContentDataProvider();

            contentDataProvider.Message  = this._sharePostUC.Text;
            contentDataProvider.WallPost = this.PostCommentsVM.WallPost;
            contentDataProvider.StoreDataToRepository();
            ShareContentDataProviderManager.StoreDataProvider((IShareContentDataProvider)contentDataProvider);
            this._dc.Hide();
            Navigator.Current.NavigateToPickConversation();
        }
コード例 #6
0
        private void ButtonSend_Click(object sender, EventArgs eventArgs)
        {
            if (this.PhotoVM.Photo == null)
            {
                return;
            }
            this._ds.Hide();
            ShareInternalContentDataProvider contentDataProvider = new ShareInternalContentDataProvider();

            contentDataProvider.Message = this._sharePostUC.Text;
            contentDataProvider.Photo   = this.PhotoVM.Photo;
            contentDataProvider.StoreDataToRepository();
            ShareContentDataProviderManager.StoreDataProvider((IShareContentDataProvider)contentDataProvider);
            Navigator.Current.NavigateToPickConversation();
        }
コード例 #7
0
        private void ButtonSend_Click(object sender, EventArgs eventArgs)
        {
            PhotoViewModel currentPhotoVm1 = this.CurrentPhotoVM;

            if ((currentPhotoVm1 != null ? currentPhotoVm1.Photo : null) == null)
            {
                PhotoViewModel currentPhotoVm2 = this.CurrentPhotoVM;
                if ((currentPhotoVm2 != null ? currentPhotoVm2.Document : null) == null)
                {
                    return;
                }
            }
            this._ds.Hide();
            ShareInternalContentDataProvider contentDataProvider = new ShareInternalContentDataProvider();

            contentDataProvider.Message  = this._sharePostUC.Text;
            contentDataProvider.Photo    = this.CurrentPhotoVM.Document == null ? this.CurrentPhotoVM.Photo : null;
            contentDataProvider.Document = this.CurrentPhotoVM.Document;
            contentDataProvider.StoreDataToRepository();
            ShareContentDataProviderManager.StoreDataProvider((IShareContentDataProvider)contentDataProvider);
            Navigator.Current.NavigateToPickConversation();
        }
コード例 #8
0
ファイル: ShareContentUC.cs プロジェクト: Makzz90/VKClient_re
 private void ListHeader_OnShareCommunityItemSelected(object sender, EventArgs eventArgs)
 {
     this.ShareContentDataProvider.StoreDataToRepository();
     ShareContentDataProviderManager.StoreDataProvider(this.ShareContentDataProvider);
     Navigator.Current.NavigateToGroups(AppGlobalStateManager.Current.LoggedInUserId, "", false, 0, 0, "", false, "", 0L);
 }
コード例 #9
0
ファイル: ShareContentUC.cs プロジェクト: Makzz90/VKClient_re
 private void ListHeader_OnShareWallPostItemSelected(object sender, EventArgs eventArgs)
 {
     this.ShareContentDataProvider.StoreDataToRepository();
     ShareContentDataProviderManager.StoreDataProvider(this.ShareContentDataProvider);
     Navigator.Current.NavigateToNewWallPost(0, false, 0, false, false, false);
 }
コード例 #10
0
        public override Uri MapUri(Uri uri)
        {
            Logger.Instance.Info("Requested uri " + uri.ToString(), new object[0]);
            string originalString       = uri.OriginalString;
            bool   needHandleActivation = this.NeedHandleActivation;

            this.NeedHandleActivation = false;
            if (AppGlobalStateManager.Current.LoggedInUserId == 0L)
            {
                if (originalString.StartsWith("/Protocol"))
                {
                    PageBase.ProtocolLaunchAfterLogin = this.MapProtocolLaunchUri(uri);
                }
                return(uri);
            }
            if (originalString.StartsWith("/Protocol"))
            {
                if (needHandleActivation)
                {
                    StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                    {
                        Reason        = AppActivationReason.other_app,
                        ReasonSubtype = "unknown"
                    });
                }
                return(this.MapProtocolLaunchUri(uri));
            }
            if (originalString.Contains("NewsPage.xaml"))
            {
                Dictionary <string, string> paramDict = uri.ParseQueryString();
                if (paramDict.ContainsKey("msg_id") && paramDict.ContainsKey("uid"))
                {
                    string arg_114_0 = paramDict["uid"];
                    if (needHandleActivation)
                    {
                        StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                        {
                            Reason        = AppActivationReason.push,
                            ReasonSubtype = "message"
                        });
                    }
                    long num;
                    if (long.TryParse(arg_114_0, out num))
                    {
                        bool isChat = false;
                        if (num - 2000000000L > 0L)
                        {
                            num   -= 2000000000L;
                            isChat = true;
                        }
                        return(new Uri(NavigatorImpl.GetNavToConversationStr(num, isChat, false, "", 0, false) + "&ClearBackStack=true", UriKind.Relative));
                    }
                }
                if (paramDict.ContainsKey("type"))
                {
                    string text      = paramDict["type"];
                    bool   arg_1B3_0 = AppGlobalStateManager.Current.GlobalState.GamesSectionEnabled;
                    if (needHandleActivation)
                    {
                        StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                        {
                            Reason        = AppActivationReason.push,
                            ReasonSubtype = text
                        });
                    }
                    if (arg_1B3_0 && (text == "sdk_open" || text == "sdk_request" || text == "sdk_invite"))
                    {
                        long gameId = 0L;
                        if (paramDict.ContainsKey("app_id"))
                        {
                            long.TryParse(paramDict["app_id"], out gameId);
                        }
                        if (text == "sdk_open")
                        {
                            Navigator.Current.OpenGame(gameId);
                        }
                        if (text == "sdk_invite")
                        {
                            return(new Uri(NavigatorImpl.GetGamesNavStr(0, true), UriKind.Relative));
                        }
                        return(new Uri(NavigatorImpl.GetGamesNavStr(gameId, true), UriKind.Relative));
                    }
                    else
                    {
                        if (text == "open_url" && paramDict.ContainsKey("url"))
                        {
                            return(new Uri(NavigatorImpl.GetOpenUrlPageStr(paramDict["url"]), UriKind.Relative));
                        }
                        if (text == "friend_found")
                        {
                            return(new Uri(NavigatorImpl.GetNavigateToUserProfileNavStr(long.Parse(paramDict["uid"]), "", false, "") + "?ClearBackStack=true", UriKind.Relative));
                        }
                        if (text == "friend")
                        {
                            return(new Uri("/VKClient.Common;component/FriendRequestsPage.xaml" + "?ClearBackStack=true", UriKind.Relative));
                        }
                        if (text == "money_transfer")
                        {
                            return(new Uri(NavigatorImpl.GetNavToFeedbackStr() + "?ClearBackStack=true", UriKind.Relative));
                        }
                        if (text == "birthday")
                        {
                            EventAggregator.Current.Publish(new GiftsPurchaseStepsEvent(GiftPurchaseStepsSource.push, GiftPurchaseStepsAction.birthdays));
                            return(new Uri(NavigatorImpl.GetNavToBirthdaysStr() + "?ClearBackStack=true", UriKind.Relative));
                        }
                        return(new Uri(NavigatorImpl.GetNavToFeedbackStr() + "?ClearBackStack=true", UriKind.Relative));
                    }
                }
                else
                {
                    if (paramDict.ContainsKey("place"))
                    {
                        if (needHandleActivation && !paramDict.ContainsKey("type"))
                        {
                            StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                            {
                                Reason        = AppActivationReason.push,
                                ReasonSubtype = "place"
                            });
                        }
                        string text2   = paramDict["place"];
                        long   ownerId = long.Parse(text2.Remove(text2.IndexOf('_')).Remove(0, 4));
                        return(new Uri(NavigatorImpl.GetNavigateToPostCommentsNavStr(long.Parse(text2.Remove(0, text2.IndexOf('_') + 1)), ownerId, false, 0, 0, "") + "&ClearBackStack=true", UriKind.Relative));
                    }
                    if (paramDict.ContainsKey("group_id"))
                    {
                        long groupId = 0L;
                        if (needHandleActivation && !paramDict.ContainsKey("type"))
                        {
                            StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                            {
                                Reason        = AppActivationReason.push,
                                ReasonSubtype = "group"
                            });
                        }
                        if (long.TryParse(paramDict["group_id"], out groupId))
                        {
                            return(new Uri(NavigatorImpl.GetNavigateToGroupNavStr(groupId, "", false) + "&ClearBackStack=true", UriKind.Relative));
                        }
                    }
                    if (paramDict.ContainsKey("uid"))
                    {
                        long uid = 0L;
                        if (needHandleActivation && !paramDict.ContainsKey("type"))
                        {
                            StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                            {
                                Reason        = AppActivationReason.push,
                                ReasonSubtype = "user"
                            });
                        }
                        if (long.TryParse(paramDict["uid"], out uid))
                        {
                            return(new Uri(NavigatorImpl.GetNavigateToUserProfileNavStr(uid, "", false, "") + "&ClearBackStack=true", UriKind.Relative));
                        }
                    }
                    if (paramDict.ContainsKey("from_id"))
                    {
                        long num2 = 0L;
                        if (long.TryParse(paramDict["from_id"], out num2))
                        {
                            if (num2 < 0L)
                            {
                                if (needHandleActivation && !paramDict.ContainsKey("type"))
                                {
                                    StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                                    {
                                        Reason        = AppActivationReason.push,
                                        ReasonSubtype = "group"
                                    });
                                }
                                return(new Uri(NavigatorImpl.GetNavigateToGroupNavStr(-num2, "", false) + "&ClearBackStack=true", UriKind.Relative));
                            }
                            if (needHandleActivation && !paramDict.ContainsKey("type"))
                            {
                                StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                                {
                                    Reason        = AppActivationReason.push,
                                    ReasonSubtype = "user"
                                });
                            }
                            return(new Uri(NavigatorImpl.GetNavigateToUserProfileNavStr(num2, "", false, "") + "&ClearBackStack=true", UriKind.Relative));
                        }
                    }
                    if (paramDict.ContainsKey("device_token") && paramDict.ContainsKey("url"))
                    {
                        return(new Uri(NavigatorImpl.GetWebViewPageNavStr(HttpUtility.UrlDecode(paramDict["url"]), false) + "&ClearBackStack=true", UriKind.Relative));
                    }
                    if (paramDict.ContainsKey("confirm_hash"))
                    {
                        Execute.ExecuteOnUIThread(delegate
                        {
                            MessageBoxResult messageBoxResult   = MessageBox.Show(HttpUtility.UrlDecode(paramDict["confirm"]), CommonResources.VK, MessageBoxButton.OKCancel);
                            Dictionary <string, string> expr_26 = new Dictionary <string, string>();
                            expr_26.Add("confirm", (messageBoxResult == MessageBoxResult.OK) ? "1" : "0");
                            expr_26.Add("hash", paramDict["confirm_hash"]);
                            Dictionary <string, string> parameters = expr_26;
                            Action <BackendResult <object, ResultCode> > arg_7C_0 = new Action <BackendResult <object, ResultCode> >((BackendResult <object, ResultCode> e) => {});

                            Action <BackendResult <object, ResultCode> > callback = arg_7C_0;
                            VKRequestsDispatcher.DispatchRequestToVK <object>("account.validateAction", parameters, callback, null, false, true, default(CancellationToken?), null);
                        });
                    }

                    ShareOperation shareOperation = (Application.Current as IAppStateInfo).ShareOperation;
                    if (shareOperation != null)
                    {
                        DataPackageView data = shareOperation.Data;
                        if (data.Contains(StandardDataFormats.StorageItems) || data.Contains(StandardDataFormats.WebLink) || data.Contains(StandardDataFormats.Text))
                        {
                            ShareContentDataProviderManager.StoreDataProvider(new ShareExternalContentDataProvider(shareOperation));
                            return(new Uri(NavigatorImpl.GetShareExternalContentpageNavStr(), UriKind.Relative));
                        }
                    }
                    if (originalString.Contains("ShareContent") && originalString.Contains("FileId"))
                    {
                        this.SetChoosenPhoto(HttpUtility.UrlDecode(paramDict["FileId"]));
                        ParametersRepository.SetParameterForId("FromPhotoPicker", true);
                        return(new Uri(NavigatorImpl.GetNavToNewPostStr(0, false, 0, false, false, false) + "&ClearBackStack=true", UriKind.Relative));
                    }
                    if (originalString.Contains("Action=WallPost") && paramDict.ContainsKey("PostId") && paramDict.ContainsKey("OwnerId") && paramDict.ContainsKey("FocusComments"))
                    {
                        if (needHandleActivation && !paramDict.ContainsKey("type"))
                        {
                            StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                            {
                                Reason        = AppActivationReason.other_app,
                                ReasonSubtype = "contacts"
                            });
                        }
                        long arg_846_0          = long.Parse(paramDict["PostId"]);
                        long ownerId2           = long.Parse(paramDict["OwnerId"]);
                        bool focusCommentsField = bool.Parse(paramDict["FocusComments"]);
                        long pollId             = long.Parse(paramDict["PollId"]);
                        long pollOwnerId        = long.Parse(paramDict["PollOwnerId"]);
                        return(new Uri(NavigatorImpl.GetNavigateToPostCommentsNavStr(arg_846_0, ownerId2, focusCommentsField, pollId, pollOwnerId, "") + "&ClearBackStack=True", UriKind.Relative));
                    }
                    if (originalString.Contains("Action=ShowPhotos"))
                    {
                        if (needHandleActivation && !paramDict.ContainsKey("type"))
                        {
                            StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                            {
                                Reason        = AppActivationReason.other_app,
                                ReasonSubtype = "contacts"
                            });
                        }
                        return(new Uri(originalString.Replace("/VKClient.Common;component/NewsPage.xaml", "/VKClient.Common;component/ImageViewerBasePage.xaml") + "&ClearBackStack=True", UriKind.Relative));
                    }
                }
            }
            if (originalString.Contains("PeopleExtension"))
            {
                Dictionary <string, string> dictionary = uri.ParseQueryString();
                if (needHandleActivation)
                {
                    StatsEventsTracker.Instance.Handle(new AppActivatedEvent
                    {
                        Reason        = AppActivationReason.other_app,
                        ReasonSubtype = "contacts"
                    });
                }
                if (dictionary.ContainsKey("accountaction") && dictionary["accountaction"] == "manage")
                {
                    return(new Uri(NavigatorImpl.GetNavigateToSettingsStr() + "?ClearBackStack=true", UriKind.Relative));
                }
                if (dictionary.ContainsKey("action"))
                {
                    string[] array = new string[0];
                    if (dictionary.ContainsKey("contact_ids"))
                    {
                        array = dictionary["contact_ids"].FromURL().Split(new char[]
                        {
                            ','
                        });
                    }
                    string text3 = dictionary["action"];
                    if (text3 == "Show_Contact")
                    {
                        Enumerable.FirstOrDefault <string>(array);
                        long   itemIdByRemoteId = RemoteIdHelper.GetItemIdByRemoteId(array[0]);
                        string text4;
                        if (itemIdByRemoteId > 0L)
                        {
                            text4 = NavigatorImpl.GetNavigateToUserProfileNavStr(itemIdByRemoteId, "", true, "");
                        }
                        else
                        {
                            text4 = NavigatorImpl.GetNavigateToGroupNavStr(-itemIdByRemoteId, "", true);
                        }
                        text4 += "&ClearBackStack=True";
                        return(new Uri(text4, UriKind.Relative));
                    }
                    if (text3 == "Post_Update")
                    {
                        return(new Uri(NavigatorImpl.GetNavToNewPostStr(0, false, 0, false, false, false) + "&ClearBackStack=True", UriKind.Relative));
                    }
                }
            }
            return(uri);
        }