예제 #1
0
        public void Share(ShareMethodDataModel dataModel)
        {
            string uri = _publicUri;

            _publicUri = null;

            switch (dataModel.Method)
            {
            case Method.Email:
                if (_book != null)
                {
                    SendEmail(_book, uri);
                }
                else
                {
                    SendEmail(_bookTitle, _text);
                }

                break;

            case Method.SocialNetworks:
                if (_book != null)
                {
                    ShareInSocialNetworks(_book, uri);
                }
                else
                {
                    ShareInSocialNetworks(_bookTitle, _text);
                }
                break;

            default:
                throw new NotSupportedException();
            }
        }
예제 #2
0
        public void Share(ShareMethodDataModel dataModel)
        {
            string uri = _publicUri;
            _publicUri = null;

            switch (dataModel.Method)
            {
                case Method.Email:
                    if (_book != null)
                        SendEmail(_book, uri);
                    else
                        SendEmail(_bookTitle, _text);

                    break;
                case Method.SocialNetworks:
                    if(_book != null)
                        ShareInSocialNetworks(_book, uri);
                    else
                        ShareInSocialNetworks(_bookTitle, _text);
                    break;
                default:
                    throw new NotSupportedException();
            }
        }