Exemplo n.º 1
0
        /// <summary>
        /// Generates an <see cref="Authentication"/> instance based on the current credentials and time.
        /// </summary>
        /// <returns></returns>
        private Authentication GetAuthentication()
        {
            DateTime timestamp = System.DateTime.Now;

            // Milliseconds seem to be a problem...
            timestamp = new DateTime(timestamp.Year, timestamp.Month, timestamp.Day,
                                     timestamp.Hour, timestamp.Minute, timestamp.Second, 0).ToUniversalTime();

            WS.Authentication auth = new WS.Authentication();
            auth.user      = _user;
            auth.timestamp = timestamp;

            HMACSHA256 hmac     = new HMACSHA256(System.Text.Encoding.UTF8.GetBytes(_key));
            string     password = Namespace + _user + timestamp.ToString(TimeStampFormat);

            auth.signature = ConvertToHex(hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password)));

            return(auth);
        }
Exemplo n.º 2
0
 public string getTagPaginated(Authentication authentication, string tag, int start, int offset) {
     object[] results = this.Invoke("getTagPaginated", new object[] {
                 authentication,
                 tag,
                 start,
                 offset});
     return ((string)(results[0]));
 }
Exemplo n.º 3
0
 /// <remarks/>
 public void getTagAsync(Authentication authentication, string tag, object userState) {
     if ((this.getTagOperationCompleted == null)) {
         this.getTagOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetTagOperationCompleted);
     }
     this.InvokeAsync("getTag", new object[] {
                 authentication,
                 tag}, this.getTagOperationCompleted, userState);
 }
Exemplo n.º 4
0
 /// <remarks/>
 public void getTagAsync(Authentication authentication, string tag) {
     this.getTagAsync(authentication, tag, null);
 }
Exemplo n.º 5
0
 public string getTag(Authentication authentication, string tag) {
     object[] results = this.Invoke("getTag", new object[] {
                 authentication,
                 tag});
     return ((string)(results[0]));
 }
Exemplo n.º 6
0
 public bool isTag(Authentication authentication, string tag) {
     object[] results = this.Invoke("isTag", new object[] {
                 authentication,
                 tag});
     return ((bool)(results[0]));
 }
Exemplo n.º 7
0
 /// <remarks/>
 public void listAllTagsAsync(Authentication authentication, object userState) {
     if ((this.listAllTagsOperationCompleted == null)) {
         this.listAllTagsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnlistAllTagsOperationCompleted);
     }
     this.InvokeAsync("listAllTags", new object[] {
                 authentication}, this.listAllTagsOperationCompleted, userState);
 }
Exemplo n.º 8
0
 public string[] listAllTags(Authentication authentication) {
     object[] results = this.Invoke("listAllTags", new object[] {
                 authentication});
     return ((string[])(results[0]));
 }
Exemplo n.º 9
0
 /// <remarks/>
 public void createTagAsync(Authentication authentication, string tag) {
     this.createTagAsync(authentication, tag, null);
 }
Exemplo n.º 10
0
 /// <remarks/>
 public void deleteTagAsync(Authentication authentication, string tag) {
     this.deleteTagAsync(authentication, tag, null);
 }
Exemplo n.º 11
0
 /// <remarks/>
 public void sendEmailAsync(Authentication authentication, Email[] subscribers, CampaignParameters parameters, Content content, object userState) {
     if ((this.sendEmailOperationCompleted == null)) {
         this.sendEmailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnsendEmailOperationCompleted);
     }
     this.InvokeAsync("sendEmail", new object[] {
                 authentication,
                 subscribers,
                 parameters,
                 content}, this.sendEmailOperationCompleted, userState);
 }
Exemplo n.º 12
0
 /// <remarks/>
 public void sendEmailAsync(Authentication authentication, Email[] subscribers, CampaignParameters parameters, Content content) {
     this.sendEmailAsync(authentication, subscribers, parameters, content, null);
 }
Exemplo n.º 13
0
 public bool sendEmail(Authentication authentication, [System.Xml.Serialization.XmlArrayItemAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=false)] Email[] subscribers, CampaignParameters parameters, Content content) {
     object[] results = this.Invoke("sendEmail", new object[] {
                 authentication,
                 subscribers,
                 parameters,
                 content});
     return ((bool)(results[0]));
 }
Exemplo n.º 14
0
 /// <remarks/>
 public void getTagPaginatedAsync(Authentication authentication, string tag, int start, int offset) {
     this.getTagPaginatedAsync(authentication, tag, start, offset, null);
 }
Exemplo n.º 15
0
 /// <remarks/>
 public void listAllTagsAsync(Authentication authentication) {
     this.listAllTagsAsync(authentication, null);
 }
Exemplo n.º 16
0
 /// <remarks/>
 public void getTagPaginatedAsync(Authentication authentication, string tag, int start, int offset, object userState) {
     if ((this.getTagPaginatedOperationCompleted == null)) {
         this.getTagPaginatedOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetTagPaginatedOperationCompleted);
     }
     this.InvokeAsync("getTagPaginated", new object[] {
                 authentication,
                 tag,
                 start,
                 offset}, this.getTagPaginatedOperationCompleted, userState);
 }
Exemplo n.º 17
0
        /// <summary>
        /// Generates an <see cref="Authentication"/> instance based on the current credentials and time.
        /// </summary>
        /// <returns></returns>
        private Authentication GetAuthentication()
        {
            DateTime timestamp = System.DateTime.Now;
            // Milliseconds seem to be a problem...
            timestamp = new DateTime(timestamp.Year, timestamp.Month, timestamp.Day,
                timestamp.Hour, timestamp.Minute, timestamp.Second, 0).ToUniversalTime();

            WS.Authentication auth = new WS.Authentication();
            auth.user = _user;
            auth.timestamp = timestamp;

            HMACSHA256 hmac = new HMACSHA256(System.Text.Encoding.UTF8.GetBytes(_key));
            string password = Namespace + _user + timestamp.ToString(TimeStampFormat);

            auth.signature = ConvertToHex(hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password)));

            return auth;
        }