Пример #1
0
        internal void FromFill(Fill f)
        {
            this.SetAllNull();

            bool bFound = false;
            if (f.PatternFill != null)
            {
                this.pfReal = new SLPatternFill(this.listThemeColors, this.listIndexedColors);
                this.pfReal.FromPatternFill(f.PatternFill);
                this.UsePatternFill = true;
                bFound = pfReal.HasForegroundColor || pfReal.HasBackgroundColor || pfReal.HasPatternType;
            }
            else if (f.GradientFill != null)
            {
                this.gfReal = new SLGradientFill(this.listThemeColors, this.listIndexedColors);
                this.gfReal.FromGradientFill(f.GradientFill);
                this.UsePatternFill = false;
                bFound = (gfReal.listGradientStops.Count > 0) || gfReal.HasType || gfReal.Degree != null || gfReal.Left != null || gfReal.Right != null || gfReal.Top != null || gfReal.Bottom != null;
            }

            if (bFound)
            {
                HasBeenAssignedValues = true;
            }
            else
            {
                HasBeenAssignedValues = false;

                // must have either PatternFill or GradientFill
                // Default will be an empty PatternFill
                this.pfReal = new SLPatternFill(this.listThemeColors, this.listIndexedColors);
                this.pfReal.PatternType = PatternValues.None;
                this.UsePatternFill = true;

                RemoveGradientFill();
            }
        }
Пример #2
0
        internal SLPatternFill Clone()
        {
            SLPatternFill pf = new SLPatternFill(this.listThemeColors, this.listIndexedColors);
            pf.HasForegroundColor = this.HasForegroundColor;
            pf.clrForegroundColor = this.clrForegroundColor.Clone();
            pf.HasBackgroundColor = this.HasBackgroundColor;
            pf.clrBackgroundColor = this.clrBackgroundColor.Clone();
            pf.HasPatternType = this.HasPatternType;
            pf.vPatternType = this.vPatternType;

            return pf;
        }
Пример #3
0
 internal void RemovePatternFill()
 {
     this.pfReal = new SLPatternFill(this.listThemeColors, this.listIndexedColors);
 }