• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CommunicationHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中CommunicationHelper的典型用法代码示例。如果您正苦于以下问题:C# CommunicationHelper类的具体用法?C# CommunicationHelper怎么用?C# CommunicationHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CommunicationHelper类属于命名空间,在下文中一共展示了CommunicationHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Delete

 /// <summary>
 /// Deletes an existing printmark
 /// </summary>
 /// <returns></returns>
 public bool Delete()
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], PrintmarkID [required], Callback, Pretty, Strict
     var resp = ch.ExecuteMethod<SmugMugResponse>("smugmug.printmarks.delete", basic, "PrintmarkID", id);
     if (resp.stat == "ok")
         return true;
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:17,代码来源:Printmark.cs


示例2: Login

 /// <summary>
 /// Authenticates a user based on the specified user id and password hash.
 /// </summary>
 /// <param name="UserId">The id for a specific user</param>
 /// <param name="PasswordHash">The password hash for the user</param>
 /// <param name="Extras">A comma separated string of additional attributes to return in the response</param>
 /// <returns>Login (AccountStatus, AccountType, FileSizeLimit, SessionID, SmugVault, User (id, DisplayName, NickName, URL))</returns>
 public MyUser Login(int UserId, string PasswordHash, string Extras)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // APIKey [required], Callback, Extras, PasswordHash [required], Pretty, Sandboxed, Strict, UserID [required]
     string su;
     var resp = ch.ExecuteMethod<LoginResponse>("smugmug.login.withHash", null, out su, "UserID", UserId, "PasswordHash", PasswordHash, "Extras", Extras);
     if (resp.stat == "ok")
     {
         MyUser u = new MyUser();
         resp.Login.PopulateUser(u);
         u.basic._su = su;
         return u;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:26,代码来源:Site.cs


示例3: StylesGetTemplatesAsync

 /// <summary>
 /// Retrieves a list of style templates
 /// </summary>
 /// <param name="Associative">Returns an associative array. Default: false </param>
 /// <returns>List of Templates (id and Name)</returns>
 public async Task<List<Template>> StylesGetTemplatesAsync(bool Associative)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // Associative, Callback, Pretty, Strict
     var resp = await ch.ExecuteMethod<TemplateResponse>("smugmug.styles.getTemplates", null, "Associative", Associative);
     if (resp.stat == "ok")
     {
         var temp = new List<Template>();
         temp.AddRange(resp.Templates);
         return temp;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:22,代码来源:Site.cs


示例4: PingAsync

 /// <summary>
 /// Pings SmugMug
 /// </summary>
 /// <returns>Returns an empty successful response, if it completes without error.</returns>
 public async Task<bool> PingAsync()
 {
     // APIKey [required], Callback, Pretty
     CommunicationHelper ch = new CommunicationHelper();
     var resp = await ch.ExecuteMethod<SmugMugResponse>("smugmug.service.ping", null);
     if (resp.stat == "ok")
         return true;
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:17,代码来源:Site.cs


示例5: Modify

 /// <summary>
 /// Updates specific settings (Dissolve, ImageID, Location, Name) for the current printmark. If any of the parameters are missing or are empty strings "", they're ignored and the current settings are preserved. Otherwise, they're updated with the new settings.
 /// </summary>
 /// <param name="Name">The name for the printmark</param>
 /// <param name="Location">The location of the printmark on the target image. Values: TopLeft, TopRight, BottomLeft, BottomRight, Top, Bottom</param>
 /// <param name="Dissolve">The opacity of the printmark on the target image. Min: 0. Max: 100</param>
 /// <param name="ImageID">The id for a specific image</param>
 /// <param name="Extras">A comma separated string of additional attributes to return in the response.</param>
 /// <returns>Returns an empty successful response, if it completes without error</returns>
 public bool Modify(string Dissolve, string ImageID, string Location, string Name, string Extras)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], PrintmarkID [required], Callback, Dissolve, Extras, ImageID, Location, Name, Pretty, Strict
     var resp = ch.ExecuteMethod<SmugMugResponse>("smugmug.printmarks.modify", basic, "PrintmarkID", this.id, "Dissolve", Dissolve, "Extras", Extras, "ImageID", ImageID, "Location", Location, "Name", Name);
     if (resp.stat == "ok")
         return true;
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:22,代码来源:Printmark.cs


示例6: GetInfo

 /// <summary>
 /// Retrieves the details for a specified album (id, Key, Backprinting, CanRank, CategoryID and Name, Clean, ColorCorrection, Comments, CommunityID and Name, Description, EXIF, External, FamilyEdit, FriendEdit, Geography, Header, HideOwner, HighlightID and Key, ImageCount, Larges, LastUpdated, NiceName, Originals, Password, PasswordHint, Position, Printable, ProofDays, Protected, Public, Share, SmumugSearchable, SortDirection, SortMethod, SquareThumbs, SubCategoryID and Name, TemplateID, ThemeID and Name and Type, Title, Unique, UnsharpAmount, UnsharpRadius, UnsharpSigma, UnsharpThreshold, WatermarkID and Name, Watermarking, WorldSearchable, X2Larges, X3Larges, XLarges)
 /// </summary>
 /// <param name="SitePassword">The site password for a specific user</param>
 /// <returns></returns>
 public Album GetInfo(string SitePassword)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], AlbumID [required], AlbumKey [required], Callback, Password, Pretty, Sandboxed, SitePassword, Strict
     AlbumResponse resp = new AlbumResponse();
     if (!String.IsNullOrEmpty(this.Password))
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getInfo", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword, "Password", Password);
     else
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getInfo", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword);
     if (resp.stat == "ok")
     {
         var myAlbum= resp.Album;
         myAlbum.basic = basic;
         //Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
         if (myAlbum.Comments != null)
             myAlbum.HasComments = (bool)myAlbum.Comments;
         return myAlbum;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:29,代码来源:Album.cs


示例7: GetComments

 /// <summary>
 /// Retrieves a list of comments for an album
 /// </summary>
 /// <param name="Associative">Returns an associative array</param>
 /// <param name="LastUpdated">Return results where LastUpdated is after the epoch time provided</param>
 /// <param name="SitePassword">The site password for a specific user</param>
 public void GetComments(bool Associative, int LastUpdated, string SitePassword)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], AlbumID [required], Key [required], Password, Associative, Callback, LastUpdated, Pretty, SitePassword, Strict
     AlbumResponse resp = new AlbumResponse();
     if ((this != null) && !(string.IsNullOrEmpty(this.Password)))
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.comments.get", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword, "Password", Password, "LastUpdated", LastUpdated, "Associative", Associative);
     else
         resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.comments.get", basic, "AlbumID", id, "AlbumKey", Key, "SitePassword", SitePassword, "LastUpdated", LastUpdated, "Associative", Associative);
     if (resp.stat == "ok")
     {
         //Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
         if (this.CommentsList == null)
             this.CommentsList = new List<Comment>();
         this.CommentsList = (List<Comment>)resp.Album.Comments;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:28,代码来源:Album.cs


示例8: RemoveAlbumAsync

 /// <summary>
 /// Removes an album from a specified sharegroup 
 /// </summary>
 /// <param name="AlbumToRemove">Album to be removed from the sharegroup</param>
 /// <returns></returns>
 public async Task<bool> RemoveAlbumAsync(Album AlbumToRemove)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], ShareGroupID [required], AlbumID [required], Callback, Pretty, Strict 
     var resp = await ch.ExecuteMethod<SmugMugResponse>("smugmug.sharegroups.albums.remove", basic, "ShareGroupID", id, "AlbumID", AlbumToRemove.id);
     if (resp.stat == "ok")
     {
         if (this.Albums != null)
         {
             // Remove the album from this sharegroup
             this.Albums.Remove(AlbumToRemove);
             // Decrease the no of albums this sharegroup has
             this.AlbumCount--;
         }
         return true;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:27,代码来源:ShareGroup.cs


示例9: AddAlbumAsync

 /// <summary>
 /// Adds an album to a specified sharegroup 
 /// </summary>
 /// <param name="AlbumToAdd">Album to be added to the sharegroup.</param>
 /// <returns></returns>
 public async Task<bool> AddAlbumAsync(Album AlbumToAdd)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], ShareGroupID [required], AlbumID [required], Callback, Pretty, Strict 
     var resp = await ch.ExecuteMethod<SmugMugResponse>("smugmug.sharegroups.albums.add", basic, "ShareGroupID", this.id, "AlbumID", AlbumToAdd.id);
     if (resp.stat == "ok")
     {
         if (this.Albums == null)
             this.Albums = new List<Album>();
         // Add the album to the current object
         this.Albums.Add(AlbumToAdd);
         // Increase the no of albums this sharegroup has
         this.AlbumCount++;
         return true;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:26,代码来源:ShareGroup.cs


示例10: ModifyAsync

 /// <summary>
 /// Updates specific settings (Dissolve, ImageID, Location, Name) for a the current sharegroup. If any of the parameters are missing or are empty strings "", they're ignored and the current settings are preserved. Otherwise, they're updated with the new settings.
 /// </summary>
 /// <param name="AccessPassworded">Allow access to password protected albums from the sharegroup without the password. Default: false.</param>
 /// <param name="Description">The description for the sharegroup</param>
 /// <param name="Name">The name for the sharegroup</param>
 /// <param name="Password">The password for the sharegroup</param>
 /// <param name="PasswordHint">The password hint for the sharegroup</param>
 /// <param name="Extras">A comma separated string of additional attributes to return in the response</param>
 /// <returns>Returns an empty successful response, if it completes without error</returns>
 public async Task<bool> ModifyAsync(bool AccessPassworded, string Description, string Name, string Password, string PasswordHint, string Extras)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], ShareGroupID [required], AccessPassworded, Callback, Description, Extras, Name, Password, PasswordHint, Pretty, Strict
     var resp = await ch.ExecuteMethod<SmugMugResponse>("smugmug.sharegroups.modify", basic, "AccessPassworded", AccessPassworded, "Description", Description, "Extras", Extras, "Name", Name, "Password", Password, "PasswordHint", PasswordHint);
     if (resp.stat == "ok")
         return true;
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:23,代码来源:ShareGroup.cs


示例11: PopulateShareGroupWithInfoFromSiteAsync

 /// <summary>
 /// Populate the current sharegroup with info from the site  (id, Tag, AccessPassworded, AlbumCount, Albums array - id, key, Title; Description, Name, Password, PasswordHint, Passworded, URL)
 /// </summary>        
 /// <param name="Password">The password for the sharegroup</param>
 /// <param name="ShareGroupTag">The tag (public id) for the sharegroup</param>
 /// <param name="Extras">A comma separated string of additional attributes to return in the response</param>
 public async Task PopulateShareGroupWithInfoFromSiteAsync(string Password, string Extras)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], ShareGroupID [required], Callback, Extras, Password, Pretty, SharegroupTag, Strict
     var resp = await ch.ExecuteMethod<ShareGroupResponse>("smugmug.sharegroups.getInfo", basic, "ShareGroupID", id, "Password", Password, "ShareGroupTag", this.Tag, "Extras", Extras);
     if (resp.stat == "ok")
         PopulateWithResponse(resp.ShareGroup, this);
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:19,代码来源:ShareGroup.cs


示例12: DeleteAsync

 /// <summary>
 /// Deletes  a specified sharegroup
 /// </summary>
 /// <returns>Returns an empty successful response, if it completes without error</returns>
 public async Task<bool> DeleteAsync()
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], ShareGroupID [required], Callback, Pretty, Strict
     var resp = await ch.ExecuteMethod<SmugMugResponse>("smugmug.sharegroups.delete", basic, "ShareGroupID", id);
     if (resp.stat == "ok")
         return true;
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:17,代码来源:ShareGroup.cs


示例13: GetPrintmarks

 /// <summary>
 /// Retrieve the user's list of printmarks.
 /// </summary>
 /// <param name="Heavy">Returns a heavy response for this method. Default: false.</param>
 /// <param name="Extras">A comma separated string of additional attributes to return in the response.</param>
 /// <returns>List of printmarks</returns>
 public List<Printmark> GetPrintmarks(bool Heavy, string Extras)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], Associative, Callback, Extras, Heavy, Pretty, Strict
     var resp = ch.ExecuteMethod<PrintmarkResponse>("smugmug.printmarks.get", basic, "Heavy", Heavy, "Extras", Extras);
     if (resp.stat == "ok")
     {
         List<Printmark> printmarkList = new List<Printmark>();
         printmarkList.AddRange(resp.Printmarks);
         if (printmarkList != null)
         {
             foreach (var myPrintmark in printmarkList)
             {
                 myPrintmark.basic = basic;
             }
         }
         return printmarkList;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:30,代码来源:MyUser.cs


示例14: ApplyWatermark

 /// <summary>
 /// Applies a watermark to the images of an album
 /// </summary>
 /// <param name="w">The id for a specific watermark</param>
 /// <returns></returns>
 public bool ApplyWatermark(Watermark w)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], AlbumID [required], WatermarkID [required], Callback, Pretty, Strict
     var resp = ch.ExecuteMethod<SmugMugResponse>("smugmug.albums.applyWatermark", basic, "AlbumID", id, "WatermarkID", w.id);
     if (resp.stat == "ok")
         return true;
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:18,代码来源:Album.cs


示例15: ChangeSettings

        /// <summary>
        /// Change the settings of an existing album - AlbumTemplateID, Backprinting (pro), BoutiquePackaging (pro), CanRank, CategoryID, Clean, ColorCorrection, Comments, CommunityID, DefaultColor  (pro), Description, EXIF, External, FamilyEdit, FriendEdit, Geography, Header (power, pro), HideOwner, HighlightID, Keywords, Larges, NiceName, Originals, PackagingBranding (pro), Password, PasswordHint, Position, Printable, PrintmarkID (pro), ProofDays, Protected (power, pro), Public, Share, SmumugSearchable, SortDirection, SortMethod, SquareThumbs, SubCategoryID, TemplateID, ThemeID, UnsharpAmount (power, pro), UnsharpRadius (power, pro), UnsharpSigma (power, pro), UnsharpThreshold (power, pro), WatermarkID (pro), Watermarking (pro), WorldSearchable, X2Larges, X3Larges, XLarges (pro)
        /// </summary>
        /// <param name="a"></param>
        /// <returns></returns>
        public bool ChangeSettings()
        {
            CommunicationHelper ch = new CommunicationHelper();
            // SessionID [required], AlbumID [required], Callback, Pretty, Strict, AlbumTemplateID, Backprinting (pro), BoutiquePackaging, CanRank,
            // CategoryID, Clean, ColorCorrection, Comments, CommunityID, DefaultColor  (pro), Description, EXIF, External, FamilyEdit,
            // FriendEdit, Geography, Header (power&pro), HideOwner, HighlightID, Keywords, Larges, NiceName, Originals, PackagingBranding, Password,
            // PasswordHint, Position, Printable, PrintmarkID, ProofDays, Protected (power&pro), Public, Share, SmumugSearchable, SortDirection,
            // SortMethod, SquareThumbs, SubCategoryID, TemplateID, ThemeID, UnsharpAmount (power&pro), UnsharpRadius (power&pro), UnsharpSigma (power&pro),
            // UnsharpThreshold (power&pro), WatermarkID (pro), Watermarking (pro), WorldSearchable, X2Larges, X3Larges, XLarges (pro)
            // Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
            var ls = BuildPropertiesValueList(this, "HasComments", "CommentsList", "Comments","Watermark");
            ls.Add("Comments"); ls.Add(this.HasComments.ToString());
            ls.Add("AlbumID"); ls.Add(this.id.ToString());

            //if there is a watermark, use the id
            if (this.Watermark != null)
            {
                ls.Add("WatermarkID"); ls.Add(this.Watermark.id.ToString());
            }

            if (this.AlbumTemplate != null)
            {
                ls.Add("AlbumTemplateID"); ls.Add(this.AlbumTemplate.id.ToString());
            }

            var resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.changeSettings", basic, ls.ToArray());
            if (resp.stat == "ok")
                return true;
            else
            {
                Console.WriteLine(resp.message);
                throw new SmugMugException(resp.code, resp.message, resp.method);
            }
        }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:39,代码来源:Album.cs


示例16: GetAlbumsAsync

        /// <summary>
        /// Retrieves a list of albums for a sharegroup (also populates the current sharegroup with this list)
        /// </summary>
        /// <param name="Associative">Returns an associative array. Default: false.</param>
        /// <param name="Password">The password for the sharegroup</param>
        /// <param name="Extras">A comma separated string of additional attributes to return in the response</param>
        /// <returns></returns>
        public async Task<List<Album>> GetAlbumsAsync(bool Associative, string Password, string Extras)
        {
            CommunicationHelper ch = new CommunicationHelper();
            // SessionID [required], ShareGroupTag [required], Associative, Callback, Extras, Password, Pretty, Strict
            var resp = await ch.ExecuteMethod<ShareGroupResponse>("smugmug.sharegroups.albums.get", basic, "ShareGroupTag", Tag, "Associative", Associative, "Password", Password, "Extras", Extras);
            if (resp.stat == "ok")
            {
                var shareGroupAlbums = resp.ShareGroup.Albums;
                if (shareGroupAlbums != null)
                {
                    foreach (var item in shareGroupAlbums)
                    {
                        bool flag = true;
                        item.basic = basic;
                        foreach (var myAlbum in this.Albums)
                        {
                            if (item.id == myAlbum.id)
                            {
                                flag = false;
                                break;
                            }
                        }
                        // Populate the current sharegroup with its albums from the site
                        if (flag)
                        {
                            if (this.Albums == null)
                                this.Albums = new List<Album>();
                            this.Albums.AddRange(shareGroupAlbums);
                        }
                    }
                    this.AlbumCount = shareGroupAlbums.Count;
                }

                return shareGroupAlbums;
            }
            else
            {
                Console.WriteLine(resp.message);
                throw new SmugMugException(resp.code, resp.message, resp.method);
            }
        } 
开发者ID:mesika,项目名称:mono-smugmug,代码行数:48,代码来源:ShareGroup.cs


示例17: GetImages

        /// <summary>
        /// Retrieves a list of images for a given album (Album with id, Key, ImageCount, and Image array with id, Key, Altitude, Caption, Date, FileName, Duration, Format, Heaight, Hidden, Keywords, LargeURL, LastUpdated, Latitude, Longitude, MD5Sum, MediumURL, OriginalURL, Position, Serial, Size, SmallURL, ThumbURL, TinyURL, Video320URL, Video640URL, Video960URL, Video1280URL, Video1920URL, Width, X2LardeURL, X3LargeURL, XLargeURL)
        /// </summary>
        /// <param name="Associative">boolean, returns an associative array. Default: false</param>
        /// <param name="Extras">A comma seperated string of additional attributes to return in the response.</param>
        /// <param name="Heavy">heavy response. Default : false</param>
        /// <param name="LastUpdated">Return results where LastUpdated is after the epoch time provided</param>
        /// <param name="Sandboxed">Forces URLs to a location with a crossdomain.xml file. Default: false  </param>
        /// <param name="SitePassword">The site password for a specific user</param>
        /// <returns>List of Images</returns>
        public List<Image> GetImages(bool Associative, string Extras, bool Heavy, int LastUpdated, bool Sandboxed, string SitePassword)
        {
            System.Diagnostics.Stopwatch stopWatch = new System.Diagnostics.Stopwatch();
            stopWatch.Start();
            _logger.Debug("Getting images from smugmug with heave={0}", Header);
            CommunicationHelper ch = new CommunicationHelper();
            // SessionID [required], AlbumID [required], AlbumKey [required], Callback, Extras, Heavy, LastUpdated, Password, Pretty, Sandboxed (boolean. Forces URLs to a location with a crossdomain.xml file. Default: false), SitePassword, Strict
            ImageResponse resp = new ImageResponse();
            if ((Password != null) && (Password != String.Empty))
                resp = ch.ExecuteMethod<ImageResponse>("smugmug.images.get", basic, "AlbumID", id, "AlbumKey", Key, "Associative", Associative, "Extras", Extras, "Heavy", Heavy, "LastUpdated", LastUpdated, "Sandboxed", Sandboxed,"SitePassword", SitePassword, "Password", Password);
            else
                resp = ch.ExecuteMethod<ImageResponse>("smugmug.images.get", basic, "AlbumID", id, "AlbumKey", Key, "Associative", Associative, "Extras", Extras, "Heavy", Heavy, "LastUpdated", LastUpdated, "Sandboxed", Sandboxed,"SitePassword", SitePassword);

               			_logger.Debug("Finished getting images from smugmug in {0:n} milliseconds.", stopWatch.ElapsedMilliseconds);
            stopWatch.Stop();
            if (resp.stat == "ok")
            {
                _logger.Debug("Smugmug images.get response was ok.");

                var imageList = new List<Image>();
                imageList.AddRange(resp.Album.Images);
                this.ImageCount = resp.Album.ImageCount;
                if (imageList != null)
                {
                    foreach (var item in imageList)
                    {
                        item.basic = basic;
                        item.Album = this;
                    }
                }
                return imageList;
            }
            else
            {
                Console.WriteLine(resp.message);
                throw new SmugMugException(resp.code, resp.message, resp.method);
            }
        }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:48,代码来源:Album.cs


示例18: GetStats

 /// <summary>
 /// Gets the extended transfer statistics for the given Album and all its images during the given Month and Year (id, Key, Bytes, Hits, Large, Medium, original, Small, Thumb, Tiny, X2Large, X3Large, XLarge, Video320, Video640, Video960, Video1280, Video1960, Images array with the same kind of stats). SmugMug only keeps the last few months of traffic on file, so requesting farther back then 2 months may not return valid results. A float is provided for Original and video sizes because it's possible to watch only a portion of a video
 /// </summary>
 /// <param name="Month"></param>
 /// <param name="Year"></param>
 /// <param name="Heavy">If Heavy is set to "1", transfer statistics for each image in each album will be returned as well</param>
 /// <returns></returns>
 public Album GetStats(int Month, int Year, bool Heavy)
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], AlbumID [required], Month [required], Year [required], Associative, Callback, Heavy, Pretty, Strict
     var resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getStats", basic, "AlbumID", id, "Month", Month, "Year", Year, "Heavy", Heavy);
     if (resp.stat == "ok")
     {
         var myAlbum = resp.Album;
         myAlbum.basic = basic;
         //Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
         if (myAlbum.Comments != null)
             myAlbum.HasComments = (bool)myAlbum.Comments;
         return myAlbum;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:27,代码来源:Album.cs


示例19: PopulateAlbumWithStatsFromSite

 /// <summary>
 /// Populate the current album and its images with transfer statistics during the given Month and Year (id, Key, Bytes, Hits, Large, Medium, original, Small, Thumb, Tiny, X2Large, X3Large, XLarge, Video320, Video640, Video960, Video1280, Video1960). SmugMug only keeps the last few months of traffic on file, so requesting farther back then 2 months may not return valid results. A float is provided for Original and video sizes because it's possible to watch only a portion of a video
 /// </summary>
 /// <param name="Month"></param>
 /// <param name="Year"></param>
 /// <param name="Heavy">If Heavy is set to "1", transfer statistics for each image in each album will be returned as well</param>
 /// <returns></returns>
 public void PopulateAlbumWithStatsFromSite(int Month, int Year, bool Heavy)
 {
     CommunicationHelper ch = new CommunicationHelper();
     var resp = ch.ExecuteMethod<AlbumResponse>("smugmug.albums.getStats", basic, "AlbumID", id, "Month", Month, "Year", Year, "Heavy", Heavy);
     if (resp.stat == "ok")
     {
         PopulateWithResponse(resp.Album, this, "HasComments", "CommentsList", "Comments");
         //Hack: The class has 2 properties with the same name - Comments. I've separated them in 2 different properties (HasComments and CommentsList)
         if (resp.Album.Comments != null)
             this.HasComments = (bool)resp.Album.Comments;
     }
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:24,代码来源:Album.cs


示例20: PopulatePrintmarkWithInfoFromSite

 /// <summary>
 /// Populate the current printmark with info from the site  (id, Name, Dissolve, Image struct - id, key; Location)
 /// </summary>
 /// <returns></returns>
 public void PopulatePrintmarkWithInfoFromSite()
 {
     CommunicationHelper ch = new CommunicationHelper();
     // SessionID [required], PrintmarkID [required], Callback, Pretty, Strict
     var resp = ch.ExecuteMethod<PrintmarkResponse>("smugmug.printmarks.getInfo", basic, "PrintmarkID", id);
     if (resp.stat == "ok")
         PopulateWithResponse(resp.Printmark, this);
     else
     {
         Console.WriteLine(resp.message);
         throw new SmugMugException(resp.code, resp.message, resp.method);
     }
 }
开发者ID:mesika,项目名称:mono-smugmug,代码行数:17,代码来源:Printmark.cs



注:本文中的CommunicationHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CommunicationState类代码示例发布时间:2022-05-24
下一篇:
C# Common_Func类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap