コード例 #1
0
        public static PackIconControlBase GetPackIcon <TPack, TKind>(this IPackIconExtension packIconExtension, TKind kind) where TPack : PackIconControlBase, new()
        {
            var packIcon = new TPack();

            packIcon.SetKind(kind);

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.Width))
            {
                packIcon.Width = packIconExtension.Width;
            }

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.Height))
            {
                packIcon.Height = packIconExtension.Height;
            }

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.Flip))
            {
                packIcon.Flip = packIconExtension.Flip;
            }

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.RotationAngle))
            {
                packIcon.RotationAngle = packIconExtension.RotationAngle;
            }

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.Spin))
            {
                packIcon.Spin = packIconExtension.Spin;
            }

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.SpinAutoReverse))
            {
                packIcon.SpinAutoReverse = packIconExtension.SpinAutoReverse;
            }

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.SpinEasingFunction))
            {
                packIcon.SpinEasingFunction = packIconExtension.SpinEasingFunction;
            }

            if (((BasePackIconExtension)packIconExtension).IsFieldChanged(BasePackIconExtension.ChangedFieldFlags.SpinDuration))
            {
                packIcon.SpinDuration = packIconExtension.SpinDuration;
            }

            return(packIcon);
        }
コード例 #2
0
        public static PackIconControlBase GetPackIcon <TPack, TKind>(this IPackIconExtension packIconExtension, TKind kind) where TPack : PackIconControlBase, new()
        {
            var packIcon = new TPack();

            packIcon.SetKind(kind);
            packIcon.Width           = packIconExtension.Width;
            packIcon.Height          = packIconExtension.Height;
            packIcon.Flip            = packIconExtension.Flip;
            packIcon.RotationAngle   = packIconExtension.RotationAngle;
            packIcon.Spin            = packIconExtension.Spin;
            packIcon.SpinAutoReverse = packIconExtension.SpinAutoReverse;
            if (packIconExtension.SpinEasingFunction != null)
            {
                packIcon.SpinEasingFunction = packIconExtension.SpinEasingFunction;
            }
            packIcon.SpinDuration = packIconExtension.SpinDuration;
            return(packIcon);
        }
コード例 #3
0
        public static PackIconControl <TKind> GetPackIcon <TPack, TKind>(this IPackIconExtension packIconExtension, TKind kind) where TPack : PackIconControl <TKind>, new()
        {
            var packIcon = new TPack {
                Kind = kind
            };

            if (packIconExtension.Width != null)
            {
                packIcon.Width = packIconExtension.Width.Value;
            }
            if (packIconExtension.Height != null)
            {
                packIcon.Height = packIconExtension.Height.Value;
            }
            if (packIconExtension.Flip != null)
            {
                packIcon.Flip = packIconExtension.Flip.Value;
            }
            if (packIconExtension.Rotation != null)
            {
                packIcon.Rotation = packIconExtension.Rotation.Value;
            }
            if (packIconExtension.Spin != null)
            {
                packIcon.Spin = packIconExtension.Spin.Value;
            }
            if (packIconExtension.SpinAutoReverse != null)
            {
                packIcon.SpinAutoReverse = packIconExtension.SpinAutoReverse.Value;
            }
            if (packIconExtension.SpinEasingFunction != null)
            {
                packIcon.SpinEasingFunction = packIconExtension.SpinEasingFunction;
            }
            if (packIconExtension.SpinDuration != null)
            {
                packIcon.SpinDuration = packIconExtension.SpinDuration.Value;
            }
            return(packIcon);
        }