コード例 #1
0
        /// <summary>
        /// Create a slice header table that will contain the slice key titles and values
        /// </summary>
        /// <param name="state">
        /// The current state
        /// </param>
        /// <returns>
        /// The slice header table
        /// </returns>
        protected Table CreateSliceHeaderTable(RendererState state)
        {
            var table = new Table();

            table.AddClass(HtmlClasses.SliceKeys);
            table.AddAttribute(HtmlConstants.CellPadding, ZeroValue);
            table.AddAttribute(HtmlConstants.CellSpacing, ZeroValue);
            foreach (string key in state.Model.SliceKeys)
            {
                var row = new TableRow();
                table.AddElement(row);

                var value = state.InputRow[key] as string;
                value = value ?? " ";
                var title = new TableCell(state.Model.AllValidKeys[key]);
                title.AddClass(HtmlClasses.SliceKeyTitle);
                row.AddElement(title);

                string text = this.GetLocalizedName(key, value);
                var    val  = new TableCell();

                // Implemented like in java to show description only
                val.SetupDisplayText(value, text, key, DisplayMode.Description, false);
                val.AddClass(HtmlClasses.SliceKeyValue);
                row.AddElement(val);
            }

            return(table);
        }
コード例 #2
0
        /// <summary>
        /// Create a <see cref="Table"/> object that will be used for slice tables
        /// </summary>
        /// <returns>
        /// A slice Table
        /// </returns>
        protected static Table CreateSliceTable()
        {
            var table = new Table();

            table.AddClass(HtmlClasses.HorizontalVerticalKeys);
            table.AddAttribute(HtmlConstants.CellPadding, ZeroValue);
            table.AddAttribute(HtmlConstants.CellSpacing, ZeroValue);
            return(table);
        }
コード例 #3
0
        /// <summary>
        /// Create the container table. The container table holds the slice header and slice data tables.
        /// </summary>
        /// <returns>
        /// The table that holds the slice header and data
        /// </returns>
        private static Table CreateContainerTable()
        {
            var containerTable = new Table();

            containerTable.AddClass(HtmlClasses.Container);
            containerTable.AddAttribute(HtmlConstants.CellPadding, ZeroValue);
            containerTable.AddAttribute(HtmlConstants.CellSpacing, ZeroValue);
            var sliceRow = new TableRow();

            containerTable.AddElement(sliceRow);
            var skeys = new TableCell();

            skeys.AddClass(HtmlClasses.SliceKeys);
            sliceRow.AddElement(skeys);

            var hvkeys = new TableRow(new TableCell());

            hvkeys.AddClass(HtmlClasses.HorizontalVerticalKeys);
            containerTable.AddElement(hvkeys);

            return(containerTable);
        }
コード例 #4
0
        /// <summary>
        /// Create the container table. The container table holds the slice header and slice data tables.
        /// </summary>
        /// <returns>
        /// The table that holds the slice header and data
        /// </returns>
        private static Table CreateContainerTable()
        {
            var containerTable = new Table();
            containerTable.AddClass(HtmlClasses.Container);
            containerTable.AddAttribute(HtmlConstants.CellPadding, ZeroValue);
            containerTable.AddAttribute(HtmlConstants.CellSpacing, ZeroValue);
            var sliceRow = new TableRow();
            containerTable.AddElement(sliceRow);
            var skeys = new TableCell();
            skeys.AddClass(HtmlClasses.SliceKeys);
            sliceRow.AddElement(skeys);

            var hvkeys = new TableRow(new TableCell());
            hvkeys.AddClass(HtmlClasses.HorizontalVerticalKeys);
            containerTable.AddElement(hvkeys);

            return containerTable;
        }
コード例 #5
0
        /// <summary>
        /// Create a slice header table that will contain the slice key titles and values
        /// </summary>
        /// <param name="state">
        /// The current state
        /// </param>
        /// <returns>
        /// The slice header table
        /// </returns>
        protected Table CreateSliceHeaderTable(RendererState state)
        {
            var table = new Table();
            table.AddClass(HtmlClasses.SliceKeys);
            table.AddAttribute(HtmlConstants.CellPadding, ZeroValue);
            table.AddAttribute(HtmlConstants.CellSpacing, ZeroValue);
            foreach (string key in state.Model.SliceKeys)
            {
                var row = new TableRow();
                table.AddElement(row);

                var value = state.InputRow[key] as string;
                value = value ?? " ";
                var title = new TableCell(state.Model.AllValidKeys[key]);
                title.AddClass(HtmlClasses.SliceKeyTitle);
                row.AddElement(title);

                string text = this.GetLocalizedName(key, value);
                var val = new TableCell();

                // Implemented like in java to show description only
                val.SetupDisplayText(value, text, key, DisplayMode.Description, false);
                val.AddClass(HtmlClasses.SliceKeyValue);
                row.AddElement(val);
            }

            return table;
        }
コード例 #6
0
 /// <summary>
 /// Create a <see cref="Table"/> object that will be used for slice tables
 /// </summary>
 /// <returns>
 /// A slice Table
 /// </returns>
 protected static Table CreateSliceTable()
 {
     var table = new Table();
     table.AddClass(HtmlClasses.HorizontalVerticalKeys);
     table.AddAttribute(HtmlConstants.CellPadding, ZeroValue);
     table.AddAttribute(HtmlConstants.CellSpacing, ZeroValue);
     return table;
 }