当前位置: 首页>>代码示例>>C#>>正文


C# Properties.Remove方法代码示例

本文整理汇总了C#中System.util.Properties.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# Properties.Remove方法的具体用法?C# Properties.Remove怎么用?C# Properties.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.util.Properties的用法示例。


在下文中一共展示了Properties.Remove方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetAnchor

 public static Anchor GetAnchor(Properties attributes)
 {
     Anchor anchor = new Anchor(GetPhrase(attributes));
     String value;
     value = attributes[ElementTags.NAME];
     if (value != null) {
         anchor.Name = value;
     }
     value = (String)attributes.Remove(ElementTags.REFERENCE);
     if (value != null) {
         anchor.Reference = value;
     }
     return anchor;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:14,代码来源:ElementFactory.cs

示例2: AddSection

 /// <summary>
 /// Creates a given Section following a set of attributes and adds it to this one.
 /// </summary>
 /// <param name="attributes">the attributes</param>
 /// <returns>the newly added Section</returns>
 public virtual Section AddSection(Properties attributes)
 {
     Section section = new Section(new Paragraph(""), 1);
     string value;
     if ((value = attributes.Remove(ElementTags.NUMBER)) != null) {
         subsections = int.Parse(value) - 1;
     }
     if ((value = attributes.Remove(ElementTags.BOOKMARKOPEN)) != null) {
         this.BookmarkOpen = bool.Parse(value);
     }
     section.Set(attributes);
     Add(section);
     return section;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:19,代码来源:Section.cs

示例3: GetInstance

 /// <summary>
 /// Returns an Image that has been constructed taking in account
 /// the value of some attributes.
 /// </summary>
 /// <param name="attributes">Some attributes</param>
 /// <returns>an Image</returns>
 public static Image GetInstance(Properties attributes)
 {
     string value = attributes.Remove(ElementTags.URL);
     if (value == null) throw new Exception("The URL of the image is missing.");
     Image image = Image.GetInstance(value);
     int align = Element.ALIGN_LEFT;
     if ((value = attributes.Remove(ElementTags.ALIGN)) != null) {
         if (ElementTags.ALIGN_LEFT.ToLower().Equals(value)) align |= Image.LEFT_ALIGN;
         else if (ElementTags.ALIGN_RIGHT.ToLower().Equals(value)) align |= Image.RIGHT_ALIGN;
         else if (ElementTags.ALIGN_MIDDLE.ToLower().Equals(value)) align |= Image.MIDDLE_ALIGN;
     }
     if ((value = attributes.Remove(ElementTags.UNDERLYING)) != null) {
         if (bool.Parse(value)) align |= Image.UNDERLYING;
     }
     if ((value = attributes.Remove(ElementTags.TEXTWRAP)) != null) {
         if (bool.Parse(value)) align |= Image.TEXTWRAP;
     }
     image.alignment = align;
     if ((value = attributes.Remove(ElementTags.ALT)) != null) {
         image.Alt = value;
     }
     string x;
     string y;
     if (((x = attributes.Remove(ElementTags.ABSOLUTEX)) != null)
         && ((y = attributes.Remove(ElementTags.ABSOLUTEY)) != null)) {
         image.SetAbsolutePosition(float.Parse(x), float.Parse(y, System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if ((value = attributes.Remove(ElementTags.PLAINWIDTH)) != null) {
         image.ScaleAbsoluteWidth(float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if ((value = attributes.Remove(ElementTags.PLAINHEIGHT)) != null) {
         image.ScaleAbsoluteHeight(float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if ((value = attributes.Remove(ElementTags.ROTATION)) != null) {
         image.Rotation = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     return image;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:44,代码来源:Image.cs

示例4: Chapter

 /// <summary>
 /// Creates a new Chapter following a set of attributes.
 /// </summary>
 /// <param name="attributes">the attributes</param>
 /// <param name="number">the Chapter number</param>
 /// <overoads>
 /// Has three overloads.
 /// </overoads>
 public Chapter(Properties attributes, int number)
     : this(new Paragraph(""), number)
 {
     string value;
     if ((value = attributes.Remove(ElementTags.NUMBERDEPTH)) != null)
     {
         this.NumberDepth = int.Parse(value);
     }
     if ((value = attributes.Remove(ElementTags.INDENT)) != null)
     {
         this.Indentation = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.INDENTATIONLEFT)) != null)
     {
         this.IndentationLeft = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.INDENTATIONRIGHT)) != null)
     {
         this.IndentationRight = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.BOOKMARKOPEN)) != null)
     {
         this.BookmarkOpen = bool.Parse(value);
     }
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:33,代码来源:Chapter.cs

示例5: HeaderFooter

 public HeaderFooter(Properties attributes) : base(0, 0, 0, 0) {
     string value;
     
     if ((value = attributes.Remove(ElementTags.NUMBERED)) != null) {
         this.numbered = bool.Parse(value);
     }
     if ((value = attributes.Remove(ElementTags.ALIGN)) != null) {
         this.SetAlignment(value);
     }
     if ((value = attributes.Remove("border")) != null) {
         this.Border = int.Parse(value);
     } else {
         this.Border = TOP_BORDER + BOTTOM_BORDER;
     }
 }
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:15,代码来源:HeaderFooter.cs

示例6: HandleStartingTags


//.........这里部分代码省略.........
            // tables
            if (Table.IsTag(name)) {
                Table table = new Table(attributes);
                float[] widths = table.ProportionalWidths;
                for (int i = 0; i < widths.Length; i++) {
                    if (widths[i] == 0) {
                        widths[i] = 100.0f / (float)widths.Length;
                    }
                }
                try {
                    table.Widths = widths;
                }
                catch (BadElementException bee) {
                    // this shouldn't happen
                    throw new Exception("", bee);
                }
                stack.Push(table);
                return;
            }

            // sections
            if (Section.IsTag(name)) {
                IElement previous = (IElement) stack.Pop();
                Section section;
                section = ((Section)previous).AddSection(attributes);
                stack.Push(previous);
                stack.Push(section);
                return;
            }

            // chapters
            if (Chapter.IsTag(name)) {
                String value; // changed after a suggestion by Serge S. Vasiljev
                if ((value = (String)attributes.Remove(ElementTags.NUMBER)) != null){
                    chapters = int.Parse(value);
                }
                else {
                    chapters++;
                }
                Chapter chapter = new Chapter(attributes,chapters);
                stack.Push(chapter);
                return;
            }

            // images
            if (Image.IsTag(name)) {
                try {
                    Image img = Image.GetInstance(attributes);
                    Object current;
                    try {
                        // if there is an element on the stack...
                        current = stack.Pop();
                        // ...and it's a Chapter or a Section, the Image can be added directly
                        if (current is Chapter || current is Section || current is Cell) {
                            ((ITextElementArray)current).Add(img);
                            stack.Push(current);
                            return;
                        }
                            // ...if not, the Image is wrapped in a Chunk before it's added
                        else {
                            Stack newStack = new Stack();
                            try {
                                while (! (current is Chapter || current is Section || current is Cell)) {
                                    newStack.Push(current);
                                    if (current is Anchor) {
                                        img.Annotation = new Annotation(0, 0, 0, 0, ((Anchor)current).Reference);
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:67,代码来源:ITextHandler.cs

示例7: GetAnnotation

        /**
        * Creates an Annotation object based on a list of properties.
        * @param attributes
        * @return an Annotation
        */
        public static Annotation GetAnnotation(Properties attributes)
        {
            float llx = 0, lly = 0, urx = 0, ury = 0;
            String value;

            value = attributes[ElementTags.LLX];
            if (value != null) {
                llx = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            value = attributes[ElementTags.LLY];
            if (value != null) {
                lly = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            value = attributes[ElementTags.URX];
            if (value != null) {
                urx = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            value = attributes[ElementTags.URY];
            if (value != null) {
                ury = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            String title = attributes[ElementTags.TITLE];
            String text = attributes[ElementTags.CONTENT];
            if (title != null || text != null) {
                return new Annotation(title, text, llx, lly, urx, ury);
            }
            value = attributes[ElementTags.URL];
            if (value != null) {
                return new Annotation(llx, lly, urx, ury, value);
            }
            value = attributes[ElementTags.NAMED];
            if (value != null) {
                return new Annotation(llx, lly, urx, ury, int.Parse(value));
            }
            String file = attributes[ElementTags.FILE];
            String destination = attributes[ElementTags.DESTINATION];
            String page = (String) attributes.Remove(ElementTags.PAGE);
            if (file != null) {
                if (destination != null) {
                    return new Annotation(llx, lly, urx, ury, file, destination);
                }
                if (page != null) {
                    return new Annotation(llx, lly, urx, ury, file, int.Parse(page));
                }
            }
            if (title == null)
                title = "";
            if (text == null)
                text = "";
            return new Annotation(title, text, llx, lly, urx, ury);
        }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:57,代码来源:ElementFactory.cs

示例8: SetRectangleProperties

        /**
        * Sets some Rectangle properties (for a Cell, Table,...).
        */
        private static void SetRectangleProperties(Rectangle rect, Properties attributes)
        {
            String value;
            value = attributes[ElementTags.BORDERWIDTH];
            if (value != null) {
                rect.BorderWidth = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            int border = 0;
            if (Utilities.CheckTrueOrFalse(attributes, ElementTags.LEFT)) {
                border |= Rectangle.LEFT_BORDER;
            }
            if (Utilities.CheckTrueOrFalse(attributes, ElementTags.RIGHT)) {
                border |= Rectangle.RIGHT_BORDER;
            }
            if (Utilities.CheckTrueOrFalse(attributes, ElementTags.TOP)) {
                border |= Rectangle.TOP_BORDER;
            }
            if (Utilities.CheckTrueOrFalse(attributes, ElementTags.BOTTOM)) {
                border |= Rectangle.BOTTOM_BORDER;
            }
            rect.Border = border;

            String r = attributes[ElementTags.RED];
            String g = attributes[ElementTags.GREEN];
            String b = attributes[ElementTags.BLUE];
            if (r != null || g != null || b != null) {
                int red = 0;
                int green = 0;
                int blue = 0;
                if (r != null) red = int.Parse(r);
                if (g != null) green = int.Parse(g);
                if (b != null) blue = int.Parse(b);
                rect.BorderColor = new Color(red, green, blue);
            }
            else {
                rect.BorderColor = Markup.DecodeColor(attributes[ElementTags.BORDERCOLOR]);
            }
            r = (String)attributes.Remove(ElementTags.BGRED);
            g = (String)attributes.Remove(ElementTags.BGGREEN);
            b = (String)attributes.Remove(ElementTags.BGBLUE);
            value = attributes[ElementTags.BACKGROUNDCOLOR];
            if (r != null || g != null || b != null) {
                int red = 0;
                int green = 0;
                int blue = 0;
                if (r != null) red = int.Parse(r);
                if (g != null) green = int.Parse(g);
                if (b != null) blue = int.Parse(b);
                rect.BackgroundColor = new Color(red, green, blue);
            }
            else if (value != null) {
                rect.BackgroundColor = Markup.DecodeColor(value);
            }
            else {
                value = attributes[ElementTags.GRAYFILL];
                if (value != null) {
                    rect.GrayFill = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
                }
            }
        }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:63,代码来源:ElementFactory.cs

示例9: Chunk

 /// <summary>
 /// Returns a Chunk that has been constructed taking in account
 /// the value of some attributes.
 /// </summary>
 /// <param name="attributes">some attributes</param>
 public Chunk(Properties attributes)
     : this("", FontFactory.GetFont(attributes))
 {
     string value;
     if ((value = attributes.Remove(ElementTags.ITEXT)) != null) {
         Append(value);
     }
     if ((value = attributes.Remove(ElementTags.LOCALGOTO)) != null) {
         SetLocalGoto(value);
     }
     if ((value = attributes.Remove(ElementTags.REMOTEGOTO)) != null) {
         String destination = attributes.Remove(ElementTags.DESTINATION);
         String page = attributes.Remove(ElementTags.PAGE);
         if (page != null) {
             SetRemoteGoto(value, int.Parse(page));
         }
         else if (destination != null) {
             SetRemoteGoto(value, destination);
         }
     }
     if ((value = attributes.Remove(ElementTags.LOCALDESTINATION)) != null) {
         SetLocalDestination(value);
     }
     if ((value = attributes.Remove(ElementTags.SUBSUPSCRIPT)) != null) {
         SetTextRise(float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     if ((value = attributes.Remove(Markup.CSS_KEY_VERTICALALIGN)) != null && value.EndsWith("%")) {
         float p = float.Parse(value.Substring(0, value.Length - 1), System.Globalization.NumberFormatInfo.InvariantInfo) / 100f;
         SetTextRise(p * font.Size);
     }
     if ((value = attributes.Remove(ElementTags.GENERICTAG)) != null) {
         SetGenericTag(value);
     }
     if ((value = attributes.Remove(ElementTags.BACKGROUNDCOLOR)) != null) {
         SetBackground(Markup.DecodeColor(value));
     }
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:42,代码来源:Chunk.cs

示例10: GetFont

 /// <summary>
 /// Constructs a Font-object.
 /// </summary>
 /// <param name="attributes">the attributes of a Font object</param>
 /// <returns>a Font object</returns>
 public virtual Font GetFont(Properties attributes)
 {
     string fontname = null;
     string encoding = defaultEncoding;
     bool embedded = defaultEmbedding;
     float size = Font.UNDEFINED;
     int style = Font.NORMAL;
     Color color = null;
     string value = attributes.Remove(Markup.HTML_ATTR_STYLE);
     if (value != null && value.Length > 0) {
         Properties styleAttributes = Markup.ParseAttributes(value);
         if (styleAttributes.Count == 0) {
             attributes.Add(Markup.HTML_ATTR_STYLE, value);
         }
         else {
             fontname = (string)styleAttributes.Remove(Markup.CSS_KEY_FONTFAMILY);
             if (fontname != null) {
                 string tmp;
                 while (fontname.IndexOf(',') != -1) {
                     tmp = fontname.Substring(0, fontname.IndexOf(','));
                     if (IsRegistered(tmp)) {
                         fontname = tmp;
                     }
                     else {
                         fontname = fontname.Substring(fontname.IndexOf(',') + 1);
                     }
                 }
             }
             if ((value = (string)styleAttributes.Remove(Markup.CSS_KEY_FONTSIZE)) != null) {
                 size = Markup.ParseLength(value);
             }
             if ((value = (string)styleAttributes.Remove(Markup.CSS_KEY_FONTWEIGHT)) != null) {
                 style |= Font.GetStyleValue(value);
             }
             if ((value = (string)styleAttributes.Remove(Markup.CSS_KEY_FONTSTYLE)) != null) {
                 style |= Font.GetStyleValue(value);
             }
             if ((value = (string)styleAttributes.Remove(Markup.CSS_KEY_COLOR)) != null) {
                 color = Markup.DecodeColor(value);
             }
             attributes.AddAll(styleAttributes);
         }
     }
     if ((value = attributes.Remove(ElementTags.ENCODING)) != null) {
         encoding = value;
     }
     if ("true".Equals(attributes.Remove(ElementTags.EMBEDDED))) {
         embedded = true;
     }
     if ((value = attributes.Remove(ElementTags.FONT)) != null) {
         fontname = value;
     }
     if ((value = attributes.Remove(ElementTags.SIZE)) != null) {
         size = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(Markup.HTML_ATTR_STYLE)) != null) {
         style |= Font.GetStyleValue(value);
     }
     if ((value = attributes.Remove(ElementTags.STYLE)) != null) {
         style |= Font.GetStyleValue(value);
     }
     string r = attributes.Remove(ElementTags.RED);
     string g = attributes.Remove(ElementTags.GREEN);
     string b = attributes.Remove(ElementTags.BLUE);
     if (r != null || g != null || b != null) {
         int red = 0;
         int green = 0;
         int blue = 0;
         if (r != null) red = int.Parse(r);
         if (g != null) green = int.Parse(g);
         if (b != null) blue = int.Parse(b);
         color = new Color(red, green, blue);
     }
     else if ((value = attributes.Remove(ElementTags.COLOR)) != null) {
         color = Markup.DecodeColor(value);
     }
     if (fontname == null) {
         return GetFont(null, encoding, embedded, size, style, color);
     }
     return GetFont(fontname, encoding, embedded, size, style, color);
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:86,代码来源:FontFactoryImp.cs

示例11: Cell

 /// <summary>
 /// Returns a Cell that has been constructed taking in account
 /// the value of some attributes.
 /// </summary>
 /// <param name="attributes">some attributes</param>
 public Cell(Properties attributes)
     : this()
 {
     string value;
     if ((value = attributes.Remove(ElementTags.HORIZONTALALIGN)) != null)
     {
         SetHorizontalAlignment(value);
     }
     if ((value = attributes.Remove(ElementTags.VERTICALALIGN)) != null)
     {
         SetVerticalAlignment(value);
     }
     if ((value = attributes.Remove(ElementTags.WIDTH)) != null)
     {
         this.Width = value;
     }
     if ((value = attributes.Remove(ElementTags.COLSPAN)) != null)
     {
         this.Colspan = int.Parse(value);
     }
     if ((value = attributes.Remove(ElementTags.ROWSPAN)) != null)
     {
         this.Rowspan = int.Parse(value);
     }
     if ((value = attributes.Remove(ElementTags.LEADING)) != null)
     {
         this.Leading = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.HEADER)) != null)
     {
         this.Header = Boolean.Parse(value);
     }
     if ((value = attributes.Remove(ElementTags.NOWRAP)) != null)
     {
         this.NoWrap = Boolean.Parse(value);
     }
     if ((value = attributes.Remove(ElementTags.BORDERWIDTH)) != null)
     {
         this.BorderWidth = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     int border = 0;
     if ((value = attributes.Remove(ElementTags.LEFT)) != null)
     {
         if (Boolean.Parse(value)) border |= Rectangle.LEFT_BORDER;
     }
     if ((value = attributes.Remove(ElementTags.RIGHT)) != null)
     {
         if (Boolean.Parse(value)) border |= Rectangle.RIGHT_BORDER;
     }
     if ((value = attributes.Remove(ElementTags.TOP)) != null)
     {
         if (Boolean.Parse(value)) border |= Rectangle.TOP_BORDER;
     }
     if ((value = attributes.Remove(ElementTags.BOTTOM)) != null)
     {
         if (Boolean.Parse(value)) border |= Rectangle.BOTTOM_BORDER;
     }
     this.Border = border;
     string r = attributes.Remove(ElementTags.RED);
     string g = attributes.Remove(ElementTags.GREEN);
     string b = attributes.Remove(ElementTags.BLUE);
     if (r != null || g != null || b != null)
     {
         int red = 0;
         int green = 0;
         int blue = 0;
         if (r != null) red = int.Parse(r);
         if (g != null) green = int.Parse(g);
         if (b != null) blue = int.Parse(b);
         this.BorderColor = new Color(red, green, blue);
     }
     else if ((value = attributes.Remove(ElementTags.BORDERCOLOR)) != null)
     {
         this.BorderColor = Markup.DecodeColor(value);
     }
     r = attributes.Remove(ElementTags.BGRED);
     g = attributes.Remove(ElementTags.BGGREEN);
     b = attributes.Remove(ElementTags.BGBLUE);
     if (r != null || g != null || b != null)
     {
         int red = 0;
         int green = 0;
         int blue = 0;
         if (r != null) red = int.Parse(r);
         if (g != null) green = int.Parse(g);
         if (b != null) blue = int.Parse(b);
         this.BackgroundColor = new Color(red, green, blue);
     }
     else if ((value = attributes.Remove(ElementTags.BACKGROUNDCOLOR)) != null)
     {
         this.BackgroundColor = Markup.DecodeColor(value);
     }
     if ((value = attributes.Remove(ElementTags.GRAYFILL)) != null)
     {
         this.GrayFill = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
//.........这里部分代码省略.........
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:101,代码来源:Cell.cs

示例12: Annotation

 /// <summary>
 /// Constructs an Annotation taking into account
 /// the value of some attributes
 /// </summary>
 /// <param name="attributes">some attributes</param>
 public Annotation(Properties attributes)
 {
     string value = attributes.Remove(ElementTags.LLX);
     if (value != null)
     {
         llx = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     value = attributes.Remove(ElementTags.LLY);
     if (value != null)
     {
         lly = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     value = attributes.Remove(ElementTags.URX);
     if (value != null)
     {
         urx = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     value = attributes.Remove(ElementTags.URY);
     if (value != null)
     {
         ury = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     string title = attributes.Remove(ElementTags.TITLE);
     string text = attributes.Remove(ElementTags.CONTENT);
     if (title != null || text != null)
     {
         annotationtype = TEXT;
     }
     else if ((value = attributes.Remove(ElementTags.URL)) != null)
     {
         annotationtype = URL_AS_STRING;
         annotationAttributes[FILE] = value;
     }
     else if ((value = attributes.Remove(ElementTags.NAMED)) != null)
     {
         annotationtype = NAMED_DEST;
         annotationAttributes[NAMED] = int.Parse(value);
     }
     else
     {
         string file = attributes.Remove(ElementTags.FILE);
         string destination = attributes.Remove(ElementTags.DESTINATION);
         string page = attributes.Remove(ElementTags.PAGE);
         if (file != null)
         {
             annotationAttributes[FILE] = file;
             if (destination != null)
             {
                 annotationtype = FILE_DEST;
                 annotationAttributes[DESTINATION] = destination;
             }
             else if (page != null)
             {
                 annotationtype = FILE_PAGE;
                 annotationAttributes[FILE] = file;
                 annotationAttributes[PAGE] = int.Parse(page);
             }
         }
         else if ((value = attributes.Remove(ElementTags.NAMED)) != null)
         {
             annotationtype = LAUNCH;
             annotationAttributes[APPLICATION] = value;
             annotationAttributes[PARAMETERS] = attributes.Remove(ElementTags.PARAMETERS);
             annotationAttributes[OPERATION] = attributes.Remove(ElementTags.OPERATION);
             annotationAttributes[DEFAULTDIR] = attributes.Remove(ElementTags.DEFAULTDIR);
         }
     }
     if (annotationtype == TEXT)
     {
         if (title == null) title = "";
         if (text == null) text = "";
         annotationAttributes[TITLE] = title;
         annotationAttributes[CONTENT] = text;
     }
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:80,代码来源:Annotation.cs

示例13: Anchor

 /// <summary>
 /// Returns an Anchor that has been constructed taking in account
 /// the value of some <var>attributes</var>.
 /// </summary>
 /// <param name="attributes">Some attributes</param>
 public Anchor(Properties attributes)
     : this("", FontFactory.GetFont(attributes))
 {
     string value;
     if ((value = attributes.Remove(ElementTags.ITEXT)) != null)
     {
         Chunk chunk = new Chunk(value);
         if ((value = attributes.Remove(ElementTags.GENERICTAG)) != null)
         {
             chunk.SetGenericTag(value);
         }
         Add(chunk);
     }
     if ((value = attributes.Remove(ElementTags.LEADING)) != null)
     {
         Leading = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     else if ((value = attributes.Remove(Markup.CSS_KEY_LINEHEIGHT)) != null)
     {
         this.Leading = Markup.ParseLength(value);
     }
     if ((value = attributes.Remove(ElementTags.NAME)) != null)
     {
         this.Name = value;
     }
     if ((value = attributes.Remove(ElementTags.REFERENCE)) != null)
     {
         this.Reference = value;
     }
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:35,代码来源:Anchor.cs

示例14: Table

        /// <summary>
        /// Returns a Table that has been constructed taking in account
        /// the value of some <VAR>attributes</VAR>.
        /// </summary>
        /// <param name="attributes">some attributes</param>
        /// <overloads>
        /// Has three overloads
        /// </overloads>
        public Table(Properties attributes)
            : base(0, 0, 0, 0)
        {
            Border = BOX;
            BorderWidth = 1;
            defaultLayout.Border = BOX;

            string value = attributes.Remove(ElementTags.COLUMNS);
            if (value == null) {
                columns = 1;
            }
            else {
                columns = int.Parse(value);
                if (columns <= 0) {
                    columns = 1;
                }
            }

            rows.Add(new Row(columns));
            curPosition.X = 0;

            if ((value = attributes.Remove(ElementTags.OFFSET)) != null) {
                Offset = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            if ((value = attributes.Remove(ElementTags.LASTHEADERROW)) != null) {
                LastHeaderRow = int.Parse(value);
            }
            if ((value = attributes.Remove(ElementTags.ALIGN)) != null) {
                SetAlignment(value);
            }
            if ((value = attributes.Remove(ElementTags.CELLSPACING)) != null) {
                Spacing = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            if ((value = attributes.Remove(ElementTags.CELLPADDING)) != null) {
                Padding = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            if ((value = attributes.Remove(ElementTags.OFFSET)) != null) {
                Offset = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            if ((value = attributes.Remove(ElementTags.WIDTH)) != null) {
                if (value.EndsWith("%"))
                    this.WidthPercentage = float.Parse(value.Substring(0, value.Length - 1), System.Globalization.NumberFormatInfo.InvariantInfo);
                else
                    AbsWidth = value;
            }
            widths = new float[columns];
            for (int i = 0; i < columns; i++) {
                widths[i] = 0;
            }
            if ((value = attributes.Remove(ElementTags.WIDTHS)) != null) {
                StringTokenizer widthTokens = new StringTokenizer(value, ";");
                int i = 0;
                while (widthTokens.HasMoreTokens()) {
                    value = widthTokens.NextToken();
                    widths[i] = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
                    i++;
                }
                columns = i;
            }
            if ((value = attributes.Remove(ElementTags.TABLEFITSPAGE)) != null) {
                tableFitsPage = bool.Parse(value);
            }
            if ((value = attributes.Remove(ElementTags.CELLSFITPAGE)) != null) {
                cellsFitPage = bool.Parse(value);
            }
            if ((value = attributes.Remove(ElementTags.CONVERT2PDFP)) != null) {
                convert2pdfptable = bool.Parse(value);
            }
            if ((value = attributes.Remove(ElementTags.BORDERWIDTH)) != null) {
                BorderWidth = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            int border = 0;
            if ((value = attributes.Remove(ElementTags.LEFT)) != null) {
                if (bool.Parse(value)) border |= Rectangle.LEFT_BORDER;
            }
            if ((value = attributes.Remove(ElementTags.RIGHT)) != null) {
                if (bool.Parse(value)) border |= Rectangle.RIGHT_BORDER;
            }
            if ((value = attributes.Remove(ElementTags.TOP)) != null) {
                if (bool.Parse(value)) border |= Rectangle.TOP_BORDER;
            }
            if ((value = attributes.Remove(ElementTags.BOTTOM)) != null) {
                if (bool.Parse(value)) border |= Rectangle.BOTTOM_BORDER;
            }
            Border = border;
            string r = attributes.Remove(ElementTags.RED);
            string g = attributes.Remove(ElementTags.GREEN);
            string b = attributes.Remove(ElementTags.BLUE);
            if (r != null || g != null || b != null) {
                int red = 0;
                int green = 0;
                int blue = 0;
//.........这里部分代码省略.........
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:101,代码来源:Table.cs

示例15: ListItem

 /// <summary>
 /// Returns a ListItem that has been constructed taking in account
 /// the value of some attributes.
 /// </summary>
 /// <param name="attributes">Some attributes</param>
 public ListItem(Properties attributes)
     : base("", FontFactory.GetFont(attributes))
 {
     string value;
     if ((value = attributes.Remove(ElementTags.ITEXT)) != null) {
         Add(new Chunk(value));
     }
     if ((value = attributes.Remove(ElementTags.LEADING)) != null) {
         this.Leading = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     else if ((value = attributes.Remove(Markup.CSS_KEY_LINEHEIGHT)) != null) {
         this.Leading = Markup.ParseLength(value);
     }
     if ((value = attributes.Remove(ElementTags.INDENTATIONLEFT)) != null) {
         this.IndentationLeft = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.INDENTATIONRIGHT)) != null) {
         this.IndentationRight = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.ALIGN)) != null) {
         SetAlignment(value);
     }
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:28,代码来源:ListItem.cs


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