C# Класс MMS_App1, API-Platform

MMS_App1 class
This application allows an end user to send an MMS message with up to three attachments of any common format, and check the delivery status of that MMS message.
Наследование: System.Web.UI.Page
Показать файл Открыть проект

Открытые методы

Метод Описание
BypassCertificateError ( ) : void

This method neglects the ssl handshake error with authentication server

Защищенные методы

Метод Описание
GetStatusButton_Click ( object sender, EventArgs e ) : void

This method will be called when user click on get status button

Page_Load ( object sender, EventArgs e ) : void

Event, that triggers when the application page is loaded into the web browser, reads the web.config file and gets the values of the attributes

SendMMSMessageButton_Click ( object sender, EventArgs e ) : void

This method will be called when user clicks on send mms button

Приватные методы

Метод Описание
DrawGetStatusSuccess ( string status, string url ) : void

Displays Resource url upon success of GetMmsDelivery

DrawPanelForFailure ( Panel, panelParam, string message ) : void

Displays error message

DrawPanelForSuccess ( Panel, panelParam, string message ) : void

Display success message

FormMIMEParts ( string boundary, string &data ) : byte[]

Form mime parts for the user input files

GetAccessToken ( AccessTokenType type ) : bool

This method gets access token based on either client credentials mode or refresh token.

GetBytesOfFile ( string boundary, string &data, string filePath ) : byte[]

Gets the bytes representation of file along with mime part

GetMmsDeliveryStatus ( ) : void

This function calls get message delivery status api to fetch the delivery status

GetPhoneNumber ( ) : string

Gets formatted phone number

IsTokenValid ( ) : string

Validates he expiry of the access token and refresh token

JoinTwoByteArrays ( byte firstByteArray, byte secondByteArray ) : MemoryStream

This function adds two byte arrays

ReadAccessTokenFile ( ) : bool

This function reads the Access Token File and stores the values of access token, expiry seconds, refresh token, last access token time and refresh token expiry time.

ReadAndGetAccessToken ( ) : bool

This function reads access token file, validates the access token and gets a new access token

ReadConfigFile ( ) : bool

This method reads config file and assigns values to local variables

SendMMS ( ) : void

This function initiates send mms api call to send selected files as an mms

SendMessageNoAttachments ( string mmsAddress, string mmsMessage ) : void

Invokes messaging api to send message without any attachments

SendMultimediaMessage ( string mmsAddress, string mmsMessage ) : void

Sends MMS by calling messaging api

Описание методов

BypassCertificateError() публичный статический Метод

This method neglects the ssl handshake error with authentication server
public static BypassCertificateError ( ) : void
Результат void

GetStatusButton_Click() защищенный Метод

This method will be called when user click on get status button
protected GetStatusButton_Click ( object sender, EventArgs e ) : void
sender object object, that caused this event
e EventArgs Event that invoked this function
Результат void

Page_Load() защищенный Метод

Event, that triggers when the application page is loaded into the web browser, reads the web.config file and gets the values of the attributes
protected Page_Load ( object sender, EventArgs e ) : void
sender object object, that caused this event
e EventArgs Event that invoked this function
Результат void

SendMMSMessageButton_Click() защищенный Метод

This method will be called when user clicks on send mms button
protected SendMMSMessageButton_Click ( object sender, EventArgs e ) : void
sender object object, that caused this event
e EventArgs Event that invoked this function
Результат void