private AttributeMetadata CloneAttributes(ImageAttributeMetadata att) { return(new ImageAttributeMetadata { IsPrimaryImage = att.IsPrimaryImage }); }
protected override void ExecuteCmdlet() { base.ExecuteCmdlet(); ImageAttributeMetadata attribute = new ImageAttributeMetadata(); WriteAttribute(attribute); }
private AttributeMetadata CreateImageAttribute(ExcelWorksheet sheet, int rowIndex, int startCell) { var iamd = new ImageAttributeMetadata { MaxSizeInKB = sheet.GetValue <int>(rowIndex, startCell), CanStoreFullImage = sheet.GetValue <string>(rowIndex, startCell + 1) == "True", IsPrimaryImage = sheet.GetValue <string>(rowIndex, startCell + 2) == "True" }; return(iamd); }
public void GenerateAttributes() { var entityMetadata = new EntityMetadata { LogicalName = "ee_test", MetadataId = Guid.NewGuid(), DisplayName = new Label("Test", 1033) }; var stringAttributeMetadata = new StringAttributeMetadata { LogicalName = "ee_teststring", MetadataId = Guid.NewGuid(), DisplayName = new Label("Test String", 1033) }.Set(x => x.EntityLogicalName, entityMetadata.LogicalName); var picklistAttributeMetadata = new PicklistAttributeMetadata { LogicalName = "ee_testpicklist", MetadataId = Guid.NewGuid(), DisplayName = new Label("Test Picklist", 1033) }.Set(x => x.EntityLogicalName, entityMetadata.LogicalName); var stateAttributeMetadata = new StateAttributeMetadata { LogicalName = "ee_teststate", MetadataId = Guid.NewGuid(), DisplayName = new Label("Test State", 1033) }.Set(x => x.EntityLogicalName, entityMetadata.LogicalName); var imageAttributeMetadata = new ImageAttributeMetadata { LogicalName = "ee_testimage", MetadataId = Guid.NewGuid(), DisplayName = new Label("Test Image", 1033) }.Set(x => x.EntityLogicalName, entityMetadata.LogicalName).Set(x => x.AttributeOf, "blah"); organizationMetadata.Entities.Returns(new[] { entityMetadata.Set(x => x.Attributes, new AttributeMetadata [] { stringAttributeMetadata, picklistAttributeMetadata, stateAttributeMetadata, imageAttributeMetadata }) }); var f = Builder.Create <SolutionComponent>(); f.Set(x => x.Regarding, entityMetadata.MetadataId); SolutionHelper.organisationService.RetrieveMultiple(Arg.Any <QueryExpression>()) .Returns(new EntityCollection(new List <Entity> { Builder.Create <SolutionComponent>().Set(x => x.Regarding, entityMetadata.MetadataId).Set(x => x.ObjectTypeCode, ComponentType.Entity), Builder.Create <SolutionComponent>().Set(x => x.Regarding, stringAttributeMetadata.MetadataId).Set(x => x.ObjectTypeCode, ComponentType.Attribute), Builder.Create <SolutionComponent>().Set(x => x.Regarding, picklistAttributeMetadata.MetadataId).Set(x => x.ObjectTypeCode, ComponentType.Attribute), Builder.Create <SolutionComponent>().Set(x => x.Regarding, stateAttributeMetadata.MetadataId).Set(x => x.ObjectTypeCode, ComponentType.Attribute), Builder.Create <SolutionComponent>().Set(x => x.Regarding, imageAttributeMetadata.MetadataId).Set(x => x.ObjectTypeCode, ComponentType.Attribute) })); Assert.IsTrue(sut.GenerateAttribute(stringAttributeMetadata, serviceProvider)); Assert.IsTrue(sut.GenerateAttribute(picklistAttributeMetadata, serviceProvider)); Assert.IsTrue(sut.GenerateAttribute(stateAttributeMetadata, serviceProvider)); Assert.IsTrue(sut.GenerateAttribute(imageAttributeMetadata, serviceProvider)); }
public void GetPropertyTypeString_ImageAttributeMetadata() { var imageAttributeMetadata = new ImageAttributeMetadata(); Assert.Equal("byte[]", new PropertyGenerator(imageAttributeMetadata, Template.Property).GetPropertyTypeString()); }
private object CopyValueInternal(AttributeMetadata oldAttribute, ImageAttributeMetadata newAttribute, object value, Dictionary <string, string> migrationMapping) { CopyValueInternal((object)oldAttribute, newAttribute, value, migrationMapping); return(null); }
private AttributeMetadata CloneAttributes(ImageAttributeMetadata att) { return new ImageAttributeMetadata { IsPrimaryImage = att.IsPrimaryImage }; }
public ImageAttributeMetadataInfo(ImageAttributeMetadata amd) : base(amd) { this.amd = amd; }
private object CopyValueInternal(AttributeMetadata oldAttribute, ImageAttributeMetadata newAttribute, object value) { CopyValueInternal((object)oldAttribute, newAttribute, value); return null; }
private object CopyValueInternal(AttributeMetadata oldAttribute, ImageAttributeMetadata newAttribute, object value) { CopyValueInternal((object)oldAttribute, newAttribute, value); return(null); }