コード例 #1
0
    public bool GetMySnsInfo(OnRelationNotifyHandle handler)
    {
        if (this.GetAccountInfo(false) == null)
        {
            Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Need_Login);

            return(false);
        }
        if (this.snsService == null)
        {
            this.snsService = IApollo.Instance.GetService(1) as IApolloSnsService;
            if (this.snsService == null)
            {
                return(false);
            }
        }
        this.snsService.onRelationEvent -= handler;
        this.snsService.onRelationEvent += handler;
        switch (Singleton <ApolloHelper> .GetInstance().CurPlatform)
        {
        case ApolloPlatform.Wechat:
            return(this.snsService.QueryMyInfo(ApolloPlatform.Wechat));

        case ApolloPlatform.QQ:
        case ApolloPlatform.WTLogin:
            return(this.snsService.QueryMyInfo(ApolloPlatform.QQ));
        }
        return(false);
    }
コード例 #2
0
ファイル: ApolloHelper.cs プロジェクト: TonyDongGuaPi/joework
    public bool GetMySnsInfo(OnRelationNotifyHandle handler)
    {
        if (this.GetAccountInfo(false) == null)
        {
            Singleton <EventRouter> .GetInstance().BroadCastEvent(EventID.ApolloHelper_Need_Login);

            return(false);
        }
        if (this.snsService == null)
        {
            this.snsService = (IApollo.get_Instance().GetService(1) as IApolloSnsService);
            if (this.snsService == null)
            {
                return(false);
            }
        }
        this.snsService.remove_onRelationEvent(handler);
        this.snsService.add_onRelationEvent(handler);
        switch (Singleton <ApolloHelper> .GetInstance().CurPlatform)
        {
        case 1:
            return(this.snsService.QueryMyInfo(1));

        case 2:
        case 3:
            return(this.snsService.QueryMyInfo(2));

        default:
            return(false);
        }
    }