public void MergeFrom(PassOverrides other) { if (other == null) { return; } if (other.imageIds_ != null) { if (imageIds_ == null) { ImageIds = new global::PKIo.ImageIds(); } ImageIds.MergeFrom(other.ImageIds); } locations_.Add(other.locations_); beacons_.Add(other.beacons_); links_.Add(other.links_); if (other.colors_ != null) { if (colors_ == null) { Colors = new global::PKIo.Colors(); } Colors.MergeFrom(other.Colors); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
public void GetAllImages() { try { using (MockContext context = MockContext.Start("ImageListManagement")) { //GetImageLists(); // wait(2); api = ContentModeratorAPI.GET_ALL_IMAGES; //imageListId = ((int)allImageLists[0].Id).ToString(); HttpMockServer.Initialize("ImageListManagement", "GetAllImages"); client = Constants.GenerateClient(api, HttpMockServer.CreateInstance()); //results = Constants.GetResponse(client, api, imageListId); results = Constants.GetResponse(client, api, "157299"); var getAllImagesFromListId = results.GetAllImages; allImages = getAllImagesFromListId.Body; Assert.NotNull(getAllImagesFromListId); Assert.Equal(HttpStatusCode.OK, getAllImagesFromListId.Response.StatusCode); Assert.Equal("157299", getAllImagesFromListId.Body.ContentSource); //Assert.Equal(imageListId, getAllImagesFromListId.Body.ContentSource); } } catch (Exception e) { throw e; } }
public Article Convert() { int articleId; var article = new Article { ArticleId = this.ArticleId.MaybeAs <string>().Bind(c => string.IsNullOrEmpty(c) ? 0 : int.Parse(c)).GetOrDefault(0), AuthorName = this.AuthorName, InitialText = this.Content, ArticleName = this.ArticleName, Link = this.Link, ArticleGroup = this.Group == null ? null : new ArticleGroup { GroupName = this.Group }, Rate = this.Rate }; if (this.ImageIds != null) { var results = CommonHelper.Instance.TempFiles.Where(c => ImageIds.Contains(c.GuidId.ToString())); article.Images = new List <Image>(); article.Images.AddRange(results.Select(c => new Image() { Data = c.ImageData, Name = c.Name, })); if (article.ArticleId != 0) { var helper = new IocHelper(); var expArticle = helper.ArticleService.GetArticleById(article.ArticleId); article.Images.AddRange(expArticle.Images); } } if (this.Tags != null) { article.Tags = Tags; } return(article); }
public List <GoodsImage> BuildGoodsImages() { List <GoodsImage> list = null; if (ImageIds != null && ImageIds.Any()) { list = new List <GoodsImage>(); foreach (var id in ImageIds) { list.Add(new GoodsImage() { ImageId = id, GoodsId = GoodsId, CreateTime = CreateTime.ConvertToTimeStamp(), UpdateTime = UpdateTime.ConvertToTimeStamp(), WxappId = WxappId }); } } return(list); }
public override int GetHashCode() { int hash = 1; if (imageIds_ != null) { hash ^= ImageIds.GetHashCode(); } hash ^= locations_.GetHashCode(); hash ^= beacons_.GetHashCode(); hash ^= links_.GetHashCode(); if (colors_ != null) { hash ^= Colors.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public DescribeImagesRequest(string[] imageIds) { ImageIds.AddRange(imageIds); }