Beispiel #1
0
        /// <summary>
        /// Set a predefined shadow matching the preset types in Excel
        /// </summary>
        /// <param name="shadowType">The preset type</param>
        public void SetPresetShadow(ePresetExcelShadowType shadowType)
        {
            InnerShadow.Delete();
            OuterShadow.Delete();
            PresetShadow.Delete();

            if (shadowType == ePresetExcelShadowType.None)
            {
                return;
            }

            if (shadowType <= ePresetExcelShadowType.InnerBottomRight)
            {
                SetPredefinedInnerShadow(shadowType);
            }
            else
            {
                SetPredefinedOuterShadow(shadowType);
            }
        }
 private OuterShadow CreateOuterShadow(float width=FrameWidth, float height=FrameHeight, float depth=10)
 {
     layer = new CALayer();
     @delegate = new OuterShadowDelegateMock();
     @delegate.LeftShadowStartXDelegate = () => 0;
     @delegate.RightShadowStartXDelegate = () => width;
     @delegate.TopShadowStartYDelegate = () => 0;
     @delegate.BottomShadowStartYDelegate = () => height;
     var shadow = new OuterShadow(layer, new SizeF(width, height), depth);
     shadow.Delegate = @delegate;
     return shadow;
 }