• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# util.Properties类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Properties类属于System.util命名空间,在下文中一共展示了Properties类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: GetChunk

 public static Chunk GetChunk(Properties attributes) {
     Chunk chunk = new Chunk();
     
     chunk.Font = FontFactory.GetFont(attributes);
     String value;
     
     value = attributes[ElementTags.ITEXT];
     if (value != null) {
         chunk.Append(value);
     }
     value = attributes[ElementTags.LOCALGOTO];
     if (value != null) {
         chunk.SetLocalGoto(value);
     }
     value = attributes[ElementTags.REMOTEGOTO];
     if (value != null) {
         String page = attributes[ElementTags.PAGE];
         if (page != null) {
             chunk.SetRemoteGoto(value, int.Parse(page));
         }
         else {
             String destination = attributes[ElementTags.DESTINATION];
             if (destination != null) {
                 chunk.SetRemoteGoto(value, destination);
             }
         }
     }
     value = attributes[ElementTags.LOCALDESTINATION];
     if (value != null) {
         chunk.SetLocalDestination(value);
     }
     value = attributes[ElementTags.SUBSUPSCRIPT];
     if (value != null) {
         chunk.SetTextRise(float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo));
     }
     value = attributes[Markup.CSS_KEY_VERTICALALIGN];
     if (value != null && value.EndsWith("%")) {
         float p = float.Parse(value.Substring(0, value.Length - 1), System.Globalization.NumberFormatInfo.InvariantInfo) / 100f;
         chunk.SetTextRise(p * chunk.Font.Size);
     }
     value = attributes[ElementTags.GENERICTAG];
     if (value != null) {
         chunk.SetGenericTag(value);
     }
     value = attributes[ElementTags.BACKGROUNDCOLOR];
     if (value != null) {
         chunk.SetBackground(Markup.DecodeColor(value));
     }
     return chunk;
 }
开发者ID:pusp,项目名称:o2platform,代码行数:50,代码来源:ElementFactory.cs


示例3: 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


示例4: GetSection

 public static Section GetSection(Section parent, Properties attributes)
 {
     Section section = parent.AddSection("");
     SetSectionParameters(section, attributes);
     return section;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:6,代码来源:ElementFactory.cs


示例5: GetParagraph

 public static Paragraph GetParagraph(Properties attributes)
 {
     Paragraph paragraph = new Paragraph(GetPhrase(attributes));
     String value;
     value = attributes[ElementTags.ALIGN];
     if (value != null) {
         paragraph.SetAlignment(value);
     }
     value = attributes[ElementTags.INDENTATIONLEFT];
     if (value != null) {
         paragraph.IndentationLeft = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     value = attributes[ElementTags.INDENTATIONRIGHT];
     if (value != null) {
         paragraph.IndentationRight = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     return paragraph;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:18,代码来源:ElementFactory.cs


示例6: GetList

        public static List GetList(Properties attributes)
        {
            List list = new List();

            list.Numbered = Utilities.CheckTrueOrFalse(attributes, ElementTags.NUMBERED);
            list.Lettered = Utilities.CheckTrueOrFalse(attributes, ElementTags.LETTERED);
            list.Lowercase = Utilities.CheckTrueOrFalse(attributes, ElementTags.LOWERCASE);
            list.Autoindent = Utilities.CheckTrueOrFalse(attributes, ElementTags.AUTO_INDENT_ITEMS);
            list.Alignindent = Utilities.CheckTrueOrFalse(attributes, ElementTags.ALIGN_INDENTATION_ITEMS);

            String value;

            value = attributes[ElementTags.FIRST];
            if (value != null) {
                char character = value[0];
                if (char.IsLetter(character) ) {
                    list.First = (int)character;
                }
                else {
                    list.First = int.Parse(value);
                }
            }

            value = attributes[ElementTags.LISTSYMBOL];
            if (value != null) {
                list.ListSymbol = new Chunk(value, FontFactory.GetFont(attributes));
            }

            value = attributes[ElementTags.INDENTATIONLEFT];
            if (value != null) {
                list.IndentationLeft = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            value = attributes[ElementTags.INDENTATIONRIGHT];
            if (value != null) {
                list.IndentationRight = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            value = attributes[ElementTags.SYMBOLINDENT];
            if (value != null) {
                list.SymbolIndent = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }

            return list;
        }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:45,代码来源:ElementFactory.cs


示例7: Set

 // public methods
 /// <summary>
 /// Alters the attributes of this Section.
 /// </summary>
 /// <param name="attributes">the attributes</param>
 public void Set(Properties attributes)
 {
     string value;
     if ((value = attributes.Remove(ElementTags.NUMBERDEPTH)) != null) {
         NumberDepth = int.Parse(value);
     }
     if ((value = attributes.Remove(ElementTags.INDENT)) != null) {
         Indentation = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.INDENTATIONLEFT)) != null) {
         IndentationLeft = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     if ((value = attributes.Remove(ElementTags.INDENTATIONRIGHT)) != null) {
         IndentationRight = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:21,代码来源:Section.cs


示例8: 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


示例9: 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


示例10: 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


示例11: 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


示例12: LoadProperties

 private static void LoadProperties()
 {
     if (propertiesLoaded)
     return;
     lock (allFonts) {
     if (propertiesLoaded)
         return;
     try {
         Stream isp = GetResourceStream(RESOURCE_PATH + "cjkfonts.properties");
         cjkFonts.Load(isp);
         isp.Close();
         isp = GetResourceStream(RESOURCE_PATH + "cjkencodings.properties");
         cjkEncodings.Load(isp);
         isp.Close();
     }
     catch {
         cjkFonts = new Properties();
         cjkEncodings = new Properties();
     }
     propertiesLoaded = true;
     }
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:22,代码来源:CJKFont.cs


示例13: ReadFontProperties

 internal static Hashtable ReadFontProperties(String name)
 {
     try {
     name += ".properties";
     Stream isp = GetResourceStream(RESOURCE_PATH + name);
     Properties p = new Properties();
     p.Load(isp);
     isp.Close();
     IntHashtable W = CreateMetric(p["W"]);
     p.Remove("W");
     IntHashtable W2 = CreateMetric(p["W2"]);
     p.Remove("W2");
     Hashtable map = new Hashtable();
     foreach (string key in p.Keys) {
         map[key] = p[key];
     }
     map["W"] = W;
     map["W2"] = W2;
     return map;
     }
     catch {
     // empty on purpose
     }
     return null;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:25,代码来源:CJKFont.cs


示例14: GetChapter

 public static ChapterAutoNumber GetChapter(Properties attributes)
 {
     ChapterAutoNumber chapter = new ChapterAutoNumber("");
     SetSectionParameters(chapter, attributes);
     return chapter;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:6,代码来源:ElementFactory.cs


示例15: GetImage

        /// <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 GetImage(Properties attributes)
        {
            String value;

            value = attributes[ElementTags.URL];
            if (value == null)
                throw new ArgumentException("The URL of the image is missing.");
            Image image = Image.GetInstance(value);

            value = attributes[ElementTags.ALIGN];
            int align = 0;
            if (value != null) {
                if (Util.EqualsIgnoreCase(ElementTags.ALIGN_LEFT, value))
                    align |= Image.ALIGN_LEFT;
                else if (Util.EqualsIgnoreCase(ElementTags.ALIGN_RIGHT, value))
                    align |= Image.ALIGN_RIGHT;
                else if (Util.EqualsIgnoreCase(ElementTags.ALIGN_MIDDLE, value))
                    align |= Image.ALIGN_MIDDLE;
            }
            if (Util.EqualsIgnoreCase("true", attributes[ElementTags.UNDERLYING]))
                align |= Image.UNDERLYING;
            if (Util.EqualsIgnoreCase("true", attributes[ElementTags.TEXTWRAP]))
                align |= Image.TEXTWRAP;
            image.Alignment = align;

            value = attributes[ElementTags.ALT];
            if (value != null) {
                image.Alt = value;
            }

            String x = attributes[ElementTags.ABSOLUTEX];
            String y = attributes[ElementTags.ABSOLUTEY];
            if ((x != null) && (y != null)) {
                image.SetAbsolutePosition(float.Parse(x, System.Globalization.NumberFormatInfo.InvariantInfo),
                        float.Parse(y, System.Globalization.NumberFormatInfo.InvariantInfo));
            }
            value = attributes[ElementTags.PLAINWIDTH];
            if (value != null) {
                image.ScaleAbsoluteWidth(float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo));
            }
            value = attributes[ElementTags.PLAINHEIGHT];
            if (value != null) {
                image.ScaleAbsoluteHeight(float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo));
            }
            value = attributes[ElementTags.ROTATION];
            if (value != null) {
                image.Rotation = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            return image;
        }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:56,代码来源:ElementFactory.cs


示例16: GetListItem

 public static ListItem GetListItem(Properties attributes)
 {
     ListItem item = new ListItem(GetParagraph(attributes));
     return item;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:5,代码来源:ElementFactory.cs


示例17: GetPhrase

 public static Phrase GetPhrase(Properties attributes)
 {
     Phrase phrase = new Phrase();
     phrase.Font = FontFactory.GetFont(attributes);
     String value;
     value = attributes[ElementTags.LEADING];
     if (value != null) {
         phrase.Leading = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
     }
     value = attributes[Markup.CSS_KEY_LINEHEIGHT];
     if (value != null) {
         phrase.Leading = Markup.ParseLength(value, Markup.DEFAULT_FONT_SIZE);
     }
     value = attributes[ElementTags.ITEXT];
     if (value != null) {
         Chunk chunk = new Chunk(value);
         if ((value = attributes[ElementTags.GENERICTAG]) != null) {
             chunk.SetGenericTag(value);
         }
         phrase.Add(chunk);
     }
     return phrase;
 }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:23,代码来源:ElementFactory.cs


示例18: StartElement

        /**
        * This method gets called when a start tag is encountered.
        *
        * @param   uri         the Uniform Resource Identifier
        * @param   lname       the local name (without prefix), or the empty string if Namespace processing is not being performed.
        * @param   name        the name of the tag that is encountered
        * @param   attrs       the list of attributes
        */
        public override void StartElement(String uri, String lname, String name, Hashtable attrs)
        {
            //System.err.Println("Start: " + name);

            // super.handleStartingTags is replaced with handleStartingTags
            // suggestion by Vu Ngoc Tan/Hop
            name = name.ToLower(CultureInfo.InvariantCulture);
            if (((HtmlTagMap)myTags).IsHtml(name)) {
                // we do nothing
                return;
            }
            if (((HtmlTagMap)myTags).IsHead(name)) {
                // we do nothing
                return;
            }
            if (((HtmlTagMap)myTags).IsTitle(name)) {
                // we do nothing
                return;
            }
            if (((HtmlTagMap)myTags).IsMeta(name)) {
                // we look if we can change the body attributes
                String meta = null;
                String content = null;
                if (attrs != null) {
                    foreach (String attribute in attrs.Keys) {
                        if (Util.EqualsIgnoreCase(attribute, HtmlTags.CONTENT))
                            content = (String)attrs[attribute];
                        else if (Util.EqualsIgnoreCase(attribute, HtmlTags.NAME))
                            meta = (String)attrs[attribute];
                    }
                }
                if (meta != null && content != null) {
                    bodyAttributes.Add(meta, content);
                }
                return;
            }
            if (((HtmlTagMap)myTags).IsLink(name)) {
                // we do nothing for the moment, in a later version we could extract the style sheet
                return;
            }
            if (((HtmlTagMap)myTags).IsBody(name)) {
                // maybe we could extract some info about the document: color, margins,...
                // but that's for a later version...
                XmlPeer peer = new XmlPeer(ElementTags.ITEXT, name);
                peer.AddAlias(ElementTags.TOP, HtmlTags.TOPMARGIN);
                peer.AddAlias(ElementTags.BOTTOM, HtmlTags.BOTTOMMARGIN);
                peer.AddAlias(ElementTags.RIGHT, HtmlTags.RIGHTMARGIN);
                peer.AddAlias(ElementTags.LEFT, HtmlTags.LEFTMARGIN);
                bodyAttributes.AddAll(peer.GetAttributes(attrs));
                HandleStartingTags(peer.Tag, bodyAttributes);
                return;
            }
            if (myTags.ContainsKey(name)) {
                XmlPeer peer = (XmlPeer) myTags[name];
                if (Table.IsTag(peer.Tag) || Cell.IsTag(peer.Tag)) {
                    Properties p = peer.GetAttributes(attrs);
                    String value;
                    if (Table.IsTag(peer.Tag) && (value = p[ElementTags.BORDERWIDTH]) != null) {
                        if (float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo) > 0) {
                            tableBorder = true;
                        }
                    }
                    if (tableBorder) {
                        p.Add(ElementTags.LEFT, "true");
                        p.Add(ElementTags.RIGHT, "true");
                        p.Add(ElementTags.TOP, "true");
                        p.Add(ElementTags.BOTTOM, "true");
                    }
                    HandleStartingTags(peer.Tag, p);
                    return;
                }
                HandleStartingTags(peer.Tag, peer.GetAttributes(attrs));
                return;
            }
            Properties attributes = new Properties();
            if (attrs != null) {
                foreach (String attribute in attrs.Keys) {
                    attributes.Add(attribute.ToLower(CultureInfo.InvariantCulture), ((String)attrs[attribute]).ToLower(CultureInfo.InvariantCulture));
                }
            }
            HandleStartingTags(name, attributes);
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:90,代码来源:ITextmyHtmlHandler.cs


示例19: GetTable

        /**
        * Creates an Table object based on a list of properties.
        * @param attributes
        * @return a Table
        */
        public static Table GetTable(Properties attributes)
        {
            String value;
            Table table;

            value = attributes[ElementTags.WIDTHS];
            if (value != null) {
                StringTokenizer widthTokens = new StringTokenizer(value, ";");
                ArrayList values = new ArrayList();
                while (widthTokens.HasMoreTokens()) {
                    values.Add(widthTokens.NextToken());
                }
                table = new Table(values.Count);
                float[] widths = new float[table.Columns];
                for (int i = 0; i < values.Count; i++) {
                    value = (String)values[i];
                    widths[i] = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
                }
                table.Widths = widths;
            }
            else {
                value = attributes[ElementTags.COLUMNS];
                try {
                    table = new Table(int.Parse(value));
                }
                catch {
                    table = new Table(1);
                }
            }

            table.Border = Table.BOX;
            table.BorderWidth = 1;
            table.DefaultCell.Border = Table.BOX;

            value = attributes[ElementTags.LASTHEADERROW];
            if (value != null) {
                table.LastHeaderRow = int.Parse(value);
            }
            value = attributes[ElementTags.ALIGN];
            if (value != null) {
                table.SetAlignment(value);
            }
            value = attributes[ElementTags.CELLSPACING];
            if (value != null) {
                table.Spacing = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            value = attributes[ElementTags.CELLPADDING];
            if (value != null) {
                table.Padding = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            value = attributes[ElementTags.OFFSET];
            if (value != null) {
                table.Offset = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
            }
            value = attributes[ElementTags.WIDTH];
            if (value != null) {
                if (value.EndsWith("%"))
                    table.Width = float.Parse(value.Substring(0, value.Length - 1), System.Globalization.NumberFormatInfo.InvariantInfo);
                else {
                    table.Width = float.Parse(value, System.Globalization.NumberFormatInfo.InvariantInfo);
                    table.Locked = true;
                }
            }
            table.TableFitsPage = Utilities.CheckTrueOrFalse(attributes, ElementTags.TABLEFITSPAGE);
            table.CellsFitPage = Utilities.CheckTrueOrFalse(attributes, ElementTags.CELLSFITPAGE);
            table.Convert2pdfptable = Utilities.CheckTrueOrFalse(attributes, ElementTags.CONVERT2PDFP);

            SetRectangleProperties(table, attributes);
            return table;
        }
开发者ID:bmictech,项目名称:iTextSharp,代码行数:75,代码来源:ElementFactory.cs


示例20: GetAttributes

 /**
 * @see com.lowagie.text.xml.XmlPeer#getAttributes(org.xml.sax.Attributes)
 */
 public override Properties GetAttributes(Hashtable attrs)
 {
     Properties attributes = new Properties();
     attributes.AddAll(attributeValues);
     if (defaultContent != null) {
         attributes[ElementTags.ITEXT] = defaultContent;
     }
     if (attrs != null) {
         foreach (string key in attrs.Keys) {
             attributes.Add(GetName(key).ToLower(CultureInfo.InvariantCulture), (string)attrs[key]);
         }
     }
     return attributes;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:17,代码来源:HtmlPeer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# util.StringTokenizer类代码示例发布时间:2022-05-26
下一篇:
C# XsltOld.Processor类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap