예제 #1
0
 public CellBorder(CellBorderStyle lineStyle)
     : this()
 {
     TopStyle = lineStyle;
     BottomStyle = lineStyle;
     LeftStyle = lineStyle;
     RightStyle = lineStyle;
 }
예제 #2
0
        public void Reset()
        {
            TopStyle = CellBorderStyle.NoLine;
            TopColor = ExcelColor.WindowTextForPattern;

            BottomStyle = CellBorderStyle.NoLine;
            BottomColor = ExcelColor.WindowTextForPattern;

            LeftStyle = CellBorderStyle.NoLine;
            LeftColor = ExcelColor.WindowTextForPattern;

            RightStyle = CellBorderStyle.NoLine;
            RightColor = ExcelColor.WindowTextForPattern;

            DiagonalUp = false;
            DiagonalDown = false;
            DiagonalStyle = CellBorderStyle.NoLine;
            DiagonalColor = ExcelColor.WindowTextForPattern;
        }
예제 #3
0
        public int SetObject(IEnumerable objCollection, CellBorderStyle borderStyle)
        {
            _borderStyle = borderStyle;

            Type objType = objCollection.GetType();

            if (TypeInterrogator.IsDictionaryType(objType))
            {
                _iter = new Traverser(CollConverter.ToList(objCollection, GenBuilder.BuildKeyValueType(objType)));
            }
            else
            {
                _iter = new Traverser(CollConverter.ToList(objCollection));
            }

            _objControl.SetObject(_iter.First, null, _borderStyle);

            return(0);
        }
예제 #4
0
        /// <summary>
        /// Set object and return leaf item count
        /// </summary>
        /// <param name="obj">Any object that exposes public properties</param>
        /// <param name="valueHints">Value hint by property name</param>
        public int SetObject(object obj, ObjValueLabelHint objHints, CellBorderStyle borderStyle)
        {
            if (_object == obj)
            {
                return(_controlMap.Count);
            }

            _object      = obj;
            _objHints    = (objHints != null)? objHints: new ObjValueLabelHint();
            _borderStyle = borderStyle;

            if (_objType != obj.GetType())
            {
                BuildCompositeCtrl(_object.GetType(), _object, null);
                DrawControls();
                _objType = obj.GetType();
            }
            else // load data only, no need to rebuild / redraw controls
            {
                LoadComposite(_objType, obj, null);
            }

            return(_controlMap.Count);
        }
예제 #5
0
 public FontSetting(string fontName, FontStyle fontStyle, int size, Color foreColor, bool showBackColor, Color backColor, System.Drawing.StringAlignment textAlignment, bool show, bool inline, FootNoteDisplayStyle footnoteInLine, bool showAlternateColor, string alternateColor1, string alternateColor2, bool wordWrap, int columnWidth, bool formatDataValue, CellBorderStyle borderStyle, string borderColor, bool roundDataValue, int decimalPlace)
 {
     this._FontName = fontName;
     this._FontStyle = fontStyle;
     this._FontSize = size;
     this._ForeColor = foreColor;
     this._BackColor = backColor;
     this._TextAlignment = textAlignment;
     this._Show = show;
     this._Inline = inline;
     this._TableFootnoteInLine = footnoteInLine;
     this._ShowAlternateColor = showAlternateColor;
     this._AlternateBackColor1 = alternateColor1;
     this._AlternateBackColor2 = alternateColor2;
     this._WordWrap = wordWrap;
     this._ColumnWidth = columnWidth;
     this._FormatDataValue = formatDataValue;
     this._ShowBackColor = showBackColor;
     this._BorderStyle = borderStyle;
     this._BorderColor = borderColor;
     this._DecimalPlace = decimalPlace;
     this._RoundDataValues = roundDataValue;
 }
예제 #6
0
        // To do: test same type / data reload / etc
        public int SetObject(Twin <object> twinObj, Dictionary <string, IEnumerable <string> > valueHints, Dictionary <string, string> lableHints, CellBorderStyle borderStyle)
        {
            _twinObj = twinObj;
            Type tp = _twinObj.X.GetType();

            _overarchingPanel.SuspendLayout();
            _overarchingPanel.CellBorderStyle = borderStyle;

            int rowIndex = 0;

            //DrawLabel(ref rowIndex);
            //DrawSeparator(ref rowIndex);
            DrawData(tp, ref rowIndex);

            _overarchingPanel.ResumeLayout();
            return(rowIndex);
        }
예제 #7
0
        // To do: test same type / data reload / etc
        /// <summary>
        /// <param name="valueHints">Key => hints or/and Value => hints</param>
        /// <param name="lableHints">Control label</param>
        /// <param name="borderStyle"></param>
        /// </summary>
        public int SetObject(Dictionary <string, string> dictionary, DictionaryHint hint, CellBorderStyle borderStyle)
        {
            _dictionary = dictionary;
            _hint       = (hint != null) ? hint : new DictionaryHint();

            _overarchingPanel.SuspendLayout();
            _overarchingPanel.CellBorderStyle = borderStyle;

            int rowIndex = 0;

            DrawHeader(ref rowIndex);
            DrawData(ref rowIndex);

            if (_allowAddNew)
            {
                DrawStar(ref rowIndex);
            }

            _overarchingPanel.ResumeLayout();
            return(rowIndex);
        }