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(); } }
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(); } }