iTextSharp.text.pdf.AcroFields.SetListSelection C# (CSharp) Метод

SetListSelection() публичный Метод

public SetListSelection ( String name, String value ) : bool
name String
value String
Результат bool
        public bool SetListSelection(String name, String[] value) {
            Item item = GetFieldItem(name);
            if (item == null)
                return false;
            PdfName type = item.GetMerged(0).GetAsName(PdfName.FT);
            if (!PdfName.CH.Equals(type)) {
                return false;
            }
            String[] options = GetListOptionExport(name);
            PdfArray array = new PdfArray();
            for (int i = 0; i < value.Length; i++) {
                for (int j = 0; j < options.Length; j++) {
                    if (options[j].Equals(value[i])) {
                        array.Add(new PdfNumber(j));
                    }
                }
            }
            item.WriteToAll(PdfName.I, array, Item.WRITE_MERGED | Item.WRITE_VALUE);
            item.WriteToAll(PdfName.V, null, Item.WRITE_MERGED | Item.WRITE_VALUE);
            item.WriteToAll(PdfName.AP, null, Item.WRITE_MERGED | Item.WRITE_WIDGET);
            item.MarkUsed( this, Item.WRITE_VALUE | Item.WRITE_WIDGET );
            return true;
        }