1- //Licensed by AT&T under 'Software Development Kit Tools Agreement.' September 2011
2- //TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
3- //Copyright 2011 AT&T Intellectual Property. All rights reserved. http://developer.att.com
4- //For more information contact [email protected] 1+ // Licensed by AT&T under 'Software Development Kit Tools Agreement.' September 2011
2+ // TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION: http://developer.att.com/sdk_agreement/
3+ // Copyright 2011 AT&T Intellectual Property. All rights reserved. http://developer.att.com
4+ // For more information contact [email protected] 55
66using System ;
77using System . Collections . Generic ;
@@ -59,7 +59,7 @@ public void resetTokenSessionVariables()
5959 Session [ "dc_session_lastTokenTakenTime" ] = null ;
6060 Session [ "dc_session_refreshTokenExpiryTime" ] = null ;
6161 }
62- /* This function resets access token related variable to null */
62+ /* This function resets access token related variable to null */
6363 public void resetTokenVariables ( )
6464 {
6565 access_token = null ;
@@ -69,9 +69,9 @@ public void resetTokenVariables()
6969 refreshTokenExpiryTime = null ;
7070 }
7171
72- /* This function validates access token related variables and returns VALID_ACCESS_TOKEN if its valid
72+ /* This function validates access token related variables and returns VALID_ACCESS_TOKEN if it is valid
7373 * otherwise, returns INVALID_ACCESS_TOKEN if refresh token expired or not able to read session variables
74- * return REFRESH_TOKEN, if access token in expired and refresh token is valid
74+ * return REFRESH_TOKEN, if access token is expired and refresh token is valid
7575 */
7676 public string isTokenValid ( )
7777 {
@@ -128,7 +128,7 @@ public void getAuthCode()
128128
129129 /* This function get the access token based on the type parameter type values.
130130 * If type value is 0, access token is fetch for authorization code flow
131- * If type value is 2, access token is fetch for authorization code floww based on the exisiting refresh token
131+ * If type value is 2, access token is fetch for authorization code flow based on the exisiting refresh token
132132 */
133133 public bool getAccessToken ( int type )
134134 {
@@ -141,7 +141,7 @@ public bool getAccessToken(int type)
141141 accessTokenRequest . Method = "POST" ;
142142 string oauthParameters = "client_id=" + api_key . ToString ( ) + "&client_secret=" + secret_key . ToString ( ) + "&code=" + auth_code . ToString ( ) + "&grant_type=authorization_code" ;
143143 accessTokenRequest . ContentType = "application/x-www-form-urlencoded" ;
144- //sendSmsRequestObject.Accept = "application/json";
144+ // sendSmsRequestObject.Accept = "application/json";
145145 UTF8Encoding encoding = new UTF8Encoding ( ) ;
146146 byte [ ] postBytes = encoding . GetBytes ( oauthParameters ) ;
147147 accessTokenRequest . ContentLength = postBytes . Length ;
@@ -194,7 +194,7 @@ public bool getAccessToken(int type)
194194 accessTokenRequest . Method = "POST" ;
195195 string oauthParameters = "grant_type=refresh_token&client_id=" + api_key . ToString ( ) + "&client_secret=" + secret_key . ToString ( ) + "&refresh_token=" + refresh_token . ToString ( ) ;
196196 accessTokenRequest . ContentType = "application/x-www-form-urlencoded" ;
197- //sendSmsRequestObject.Accept = "application/json";
197+ // sendSmsRequestObject.Accept = "application/json";
198198
199199 UTF8Encoding encoding = new UTF8Encoding ( ) ;
200200 byte [ ] postBytes = encoding . GetBytes ( oauthParameters ) ;
@@ -241,7 +241,7 @@ public bool getAccessToken(int type)
241241 return false ;
242242 }
243243
244- /* This funciton draws table for error response */
244+ /* This function draws table for error response */
245245 private void drawPanelForFailure ( Panel panelParam , string message )
246246 {
247247 Table table = new Table ( ) ;
@@ -254,11 +254,11 @@ private void drawPanelForFailure(Panel panelParam, string message)
254254 rowOneCellOne . Font . Bold = true ;
255255 rowOneCellOne . Text = "ERROR:" ;
256256 rowOne . Controls . Add ( rowOneCellOne ) ;
257- //rowOneCellOne.BorderWidth = 1;
257+ // rowOneCellOne.BorderWidth = 1;
258258 table . Controls . Add ( rowOne ) ;
259259 TableRow rowTwo = new TableRow ( ) ;
260260 TableCell rowTwoCellOne = new TableCell ( ) ;
261- //rowTwoCellOne.BorderWidth = 1;
261+ // rowTwoCellOne.BorderWidth = 1;
262262 rowTwoCellOne . Text = message . ToString ( ) ;
263263 rowTwo . Controls . Add ( rowTwoCellOne ) ;
264264 table . Controls . Add ( rowTwo ) ;
@@ -268,8 +268,8 @@ private void drawPanelForFailure(Panel panelParam, string message)
268268 panelParam . Controls . Add ( table ) ;
269269 }
270270 /*
271- * This function is called when the applicaiton page is loaded into the browser.
272- * This fucntion reads the web.config and gets the values of the attributes
271+ * This function is called when the application page is loaded into the web browser.
272+ * This function reads the web.config file and gets the values of the attributes.
273273 *
274274 */
275275 protected void Page_Load ( object sender , EventArgs e )
@@ -346,7 +346,7 @@ protected void Page_Load(object sender, EventArgs e)
346346 }
347347
348348 }
349- /*This funciton checks the validity of string as msisdn */
349+ /*This function checks the validity of string as msisdn */
350350
351351 private Boolean isValidMISDN ( string number )
352352 {
@@ -421,23 +421,23 @@ private void drawPanelForGetStatusResult(string attribute, string value, bool he
421421 getStatusTable . Font . Size = 9 ;
422422 getStatusTable . Font . Name = "Sans-serif" ;
423423 getStatusTable . Font . Italic = true ;
424- //getStatusTable.HorizontalAlign = HorizontalAlign.Center;
424+ // getStatusTable.HorizontalAlign = HorizontalAlign.Center;
425425 TableRow rowOne = new TableRow ( ) ;
426426 TableCell rowOneCellOne = new TableCell ( ) ;
427427 rowOneCellOne . Font . Bold = true ;
428- //rowOneCellOne.BorderWidth = 1;
428+ // rowOneCellOne.BorderWidth = 1;
429429 rowOneCellOne . Text = "Parameter" ;
430430 rowOneCellOne . HorizontalAlign = HorizontalAlign . Center ;
431431 rowOne . Controls . Add ( rowOneCellOne ) ;
432432 TableCell rowOneCellTwo = new TableCell ( ) ;
433433 rowOneCellTwo . Font . Bold = true ;
434- //rowOneCellTwo.BorderWidth = 1;
434+ // rowOneCellTwo.BorderWidth = 1;
435435 rowOneCellTwo . Text = "Value" ;
436436 rowOneCellTwo . HorizontalAlign = HorizontalAlign . Center ;
437437 rowOne . Controls . Add ( rowOneCellTwo ) ;
438- //getStatusTable.BorderWidth = 2;
439- //getStatusTable.BorderColor = Color.DarkGreen;
440- //getStatusTable.BackColor = System.Drawing.ColorTranslator.FromHtml("#cfc");
438+ // getStatusTable.BorderWidth = 2;
439+ // getStatusTable.BorderColor = Color.DarkGreen;
440+ // getStatusTable.BackColor = System.Drawing.ColorTranslator.FromHtml("#cfc");
441441 getStatusTable . Controls . Add ( rowOne ) ;
442442 dcPanel . Controls . Add ( getStatusTable ) ;
443443 }
@@ -447,11 +447,11 @@ private void drawPanelForGetStatusResult(string attribute, string value, bool he
447447 TableCell cell1 = new TableCell ( ) ;
448448 TableCell cell2 = new TableCell ( ) ;
449449 cell1 . Text = attribute . ToString ( ) ;
450- //cell1.BorderWidth = 1;
450+ // cell1.BorderWidth = 1;
451451 cell1 . HorizontalAlign = HorizontalAlign . Center ;
452452 row . Controls . Add ( cell1 ) ;
453453 cell2 . Text = value . ToString ( ) ;
454- //cell2.BorderWidth = 1;
454+ // cell2.BorderWidth = 1;
455455 cell2 . HorizontalAlign = HorizontalAlign . Center ;
456456 row . Controls . Add ( cell2 ) ;
457457 getStatusTable . Controls . Add ( row ) ;
@@ -516,8 +516,8 @@ protected void getDCCapabilities_Click(object sender, EventArgs e)
516516 Session [ "dc_session_GdeviceID" ] = deviceId . ToString ( ) ;
517517 getAuthCode ( ) ;
518518 }
519- //readCheckVerifyAccessToken();
520- // Form Http Web Request
519+ // readCheckVerifyAccessToken();
520+ // Form Http Web Request
521521 HttpWebRequest deviceInfoRequestObject = ( HttpWebRequest ) System . Net . WebRequest . Create ( "" + FQDN + "/1/devices/tel:" + deviceId . ToString ( ) + "/info?access_token=" + access_token . ToString ( ) ) ;
522522 deviceInfoRequestObject . Method = "GET" ;
523523
@@ -536,7 +536,7 @@ protected void getDCCapabilities_Click(object sender, EventArgs e)
536536 drawPanelForGetStatusResult ( "acwav" , deserializedJsonObj . capabilities . acwav . ToString ( ) , false ) ;
537537 drawPanelForGetStatusResult ( "acwcf" , deserializedJsonObj . capabilities . acwcf . ToString ( ) , false ) ;
538538 drawPanelForGetStatusResult ( "acwtermtype" , deserializedJsonObj . capabilities . acwtermtype . ToString ( ) , false ) ;
539- //Session["DeviceIdForWhichTokenAcquired"] = deviceId.ToString();
539+ // Session["DeviceIdForWhichTokenAcquired"] = deviceId.ToString();
540540 deviceInfoResponseStream . Close ( ) ;
541541 }
542542 }
0 commit comments