Exemplo n.º 1
0
        private bool MatchClasses(IStylable w)
        {
            int i = 0, j = 0;

            foreach (var cls in w.Classes)
            {
                if (cls == _classes[i])
                {
                    if (j != 0)
                    {
                        return(false);
                    }

                    i++;
                    j = 0;

                    if (i >= _classes.Count)
                    {
                        return(true);
                    }

                    continue;
                }
                else if (i != 0)
                {
                    j++;
                }
            }

            return(false);
        }
Exemplo n.º 2
0
 internal ExcelStyle(IStylable stylable, DocumentStyles styles, uint?baseStyleIndex, bool?isHead = false)
 {
     this._stylable  = stylable;
     this._styles    = styles;
     this.StyleIndex = baseStyleIndex;
     if (isHead.HasValue)
     {
         this.SetAlignmentCenter = isHead.Value;
     }
 }
Exemplo n.º 3
0
        public T1 GetStyle <T, T1>(IStylable <T, T1> stylable)
            where T1 : Style <T>, new()
            where T : Control
        {
            T1 style = new T1();

            style.Apply(_styles[stylable.ComponentType]["default"]);
            ApplyStyle(style, stylable.Component, stylable.ComponentType);
            return(style);
        }
Exemplo n.º 4
0
 internal ExcelFill(IStylable stylable, DocumentStyles styles, uint?fillId)
 {
     _stylable = stylable;
     _styles   = styles;
     _fillId   = fillId;
     if (_fillId != null)
     {
         FillObject = (Fill)_styles.GetFill(_fillId.Value).CloneNode(true);
     }
     else
     {
         FillObject = new Fill();
     }
 }
Exemplo n.º 5
0
 public ExcelBorder(IStylable stylable, DocumentStyles styles, uint?borderId)
 {
     _stylable = stylable;
     _styles   = styles;
     _borderId = borderId;
     if (_borderId != null)
     {
         BorderObject = (Border)_styles.GetBorder(_borderId.Value).CloneNode(true);
     }
     else
     {
         BorderObject = new Border();
     }
 }
 public ExcelBorder(IStylable stylable, DocumentStyles styles, uint?borderId)
 {
     this._stylable = stylable;
     this._styles   = styles;
     this._borderId = borderId;
     if (this._borderId.HasValue)
     {
         this.BorderObject = (Border)this._styles.GetBorder(this._borderId.Value).CloneNode(true);
     }
     else
     {
         this.BorderObject = new Border();
     }
 }
Exemplo n.º 7
0
 internal ExcelFont(IStylable stylable, DocumentStyles styles, uint?fontId)
 {
     _stylable = stylable;
     _styles   = styles;
     _fontId   = fontId;
     if (_fontId != null)
     {
         FontObject = (Font)_styles.GetFont(_fontId.Value).CloneNode(true);
     }
     else
     {
         FontObject = new Font();
     }
 }
Exemplo n.º 8
0
 internal ExcelFont(IStylable stylable, DocumentStyles styles, uint?fontId)
 {
     this._stylable = stylable;
     this._styles   = styles;
     this._fontId   = fontId;
     if (this._fontId.HasValue)
     {
         this.FontObject = (Font)this._styles.GetFont(this._fontId.Value).CloneNode(true);
     }
     else
     {
         this.FontObject = new Font();
     }
 }
Exemplo n.º 9
0
 internal ExcelFill(IStylable stylable, DocumentStyles styles, uint?fillId)
 {
     this._stylable = stylable;
     this._styles   = styles;
     this._fillId   = fillId;
     if (this._fillId.HasValue)
     {
         this.FillObject = (Fill)this._styles.GetFill(this._fillId.Value).CloneNode(true);
     }
     else
     {
         this.FillObject = new Fill();
     }
 }
Exemplo n.º 10
0
 public void UnApply(IStylable styleable)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 11
0
 internal ExcelStyle(IStylable stylable, DocumentStyles styles, uint?baseStyleIndex)
 {
     _stylable       = stylable;
     _styles         = styles;
     this.StyleIndex = baseStyleIndex;
 }
Exemplo n.º 12
0
 internal ExcelNumberFormat(IStylable stylable, DocumentStyles styles, uint numFmtId)
 {
     _stylable = stylable;
     _styles   = styles;
     NumFmtId  = numFmtId;
 }