Определяет класс UnitArrayStructure, который содержитDouble массив значений и их единица измерения. Используется в файловых ресурсах PSD, обычноObjectArrayStructure .
Следующий код демонстрирует поддержку подписей ObAr и UnFl.
[C#]voidAssertAreEqual(objectactual,objectexpected){if(!object.Equals(actual,expected)){thrownewFormatException(string.Format("Actual value {0} are not equal to expected {1}.",actual,expected));}}varsourceFilePath="LayeredSmartObjects8bit2.psd";using(PsdImageimage=(PsdImage)Image.Load(sourceFilePath)){UnitArrayStructureverticalStructure=null;foreach(LayerimageLayerinimage.Layers){foreach(varimageResourceinimageLayer.Resources){varresource=imageResourceasPlLdResource;if(resource!=null&&resource.IsCustom){foreach(OSTypeStructurestructureinresource.Items){if(structure.KeyName.ClassName=="customEnvelopeWarp"){AssertAreEqual(typeof(DescriptorStructure),structure.GetType());varcustom=(DescriptorStructure)structure;AssertAreEqual(custom.Structures.Length,1);varmesh=custom.Structures[0];AssertAreEqual(typeof(ObjectArrayStructure),mesh.GetType());varmeshObjectArray=(ObjectArrayStructure)mesh;AssertAreEqual(meshObjectArray.Structures.Length,2);varvertical=meshObjectArray.Structures[1];AssertAreEqual(typeof(UnitArrayStructure),vertical.GetType());verticalStructure=(UnitArrayStructure)vertical;AssertAreEqual(verticalStructure.UnitType,UnitTypes.Pixels);AssertAreEqual(verticalStructure.ValueCount,16);break;}}}}}AssertAreEqual(true,verticalStructure!=null);}