Exemple #1
0
        /// <summary>
        /// Updates a `KimonoPropertyConnectionPoint` on this `KimonoShape` with the results
        /// of a Obi Script run on an attached `KimonoProperty`.
        /// </summary>
        /// <param name="connection">Connection.</param>
        public override void UpdatePropertyConnectionPoint(KimonoPropertyConnection connection)
        {
            // Take action based on the connection point
            switch (connection.ConnectionPoint)
            {
            case KimonoPropertyConnectionPoint.HasStartHead:
                HasStartHead = connection.ConnectedProperty.ToBool();
                break;

            case KimonoPropertyConnectionPoint.HasEndHead:
                HasEndHead = connection.ConnectedProperty.ToBool();
                break;

            case KimonoPropertyConnectionPoint.HeadInnerRatio:
                HeadInnerRatio = connection.ConnectedProperty.ToFloat();
                break;

            case KimonoPropertyConnectionPoint.HeadOuterRatio:
                HeadOuterRatio = connection.ConnectedProperty.ToFloat();
                break;

            case KimonoPropertyConnectionPoint.IsStreamlined:
                IsStreamlined = connection.ConnectedProperty.ToBool();
                break;

            default:
                base.UpdatePropertyConnectionPoint(connection);
                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Updates a `KimonoPropertyConnectionPoint` on this `KimonoShape` with the results
        /// of a Obi Script run on an attached `KimonoProperty`.
        /// </summary>
        /// <param name="connection">Connection.</param>
        public virtual void UpdatePropertyConnectionPoint(KimonoPropertyConnection connection)
        {
            // Take action based on the connection point
            switch (connection.ConnectionPoint)
            {
            case KimonoPropertyConnectionPoint.Rect:
                Rect = connection.ConnectedProperty.ToRect();
                BoundsChanged();
                break;

            case KimonoPropertyConnectionPoint.Top:
                Top = connection.ConnectedProperty.ToFloat();
                BoundsChanged();
                break;

            case KimonoPropertyConnectionPoint.Left:
                Left = connection.ConnectedProperty.ToFloat();
                BoundsChanged();
                break;

            case KimonoPropertyConnectionPoint.Bottom:
                Bottom = connection.ConnectedProperty.ToFloat();
                BoundsChanged();
                break;

            case KimonoPropertyConnectionPoint.Right:
                Right = connection.ConnectedProperty.ToFloat();
                BoundsChanged();
                break;

            case KimonoPropertyConnectionPoint.Width:
                Width = connection.ConnectedProperty.ToFloat();
                BoundsChanged();
                break;

            case KimonoPropertyConnectionPoint.Height:
                Height = connection.ConnectedProperty.ToFloat();
                BoundsChanged();
                break;

            case KimonoPropertyConnectionPoint.RotationDegrees:
                var amount = connection.ConnectedProperty.ToInt();
                if (amount > -1 && amount < 366)
                {
                    RotationDegrees = amount;
                }
                break;

            case KimonoPropertyConnectionPoint.Style:
                Style = connection.ConnectedProperty.ToStyle();
                break;

            case KimonoPropertyConnectionPoint.Visible:
                Visible = connection.ConnectedProperty.ToBool();
                break;
            }
        }
Exemple #3
0
        /// <summary>
        /// Clone this instance.
        /// </summary>
        /// <returns>The clone.</returns>
        public KimonoPropertyConnection Clone()
        {
            // Make copy
            var newConnection = new KimonoPropertyConnection(this.ConnectionPoint, this.ConnectedProperty)
            {
                UniqueID = this.UniqueID
            };

            // Return copy
            return(newConnection);
        }
        /// <summary>
        /// Updates a `KimonoPropertyConnectionPoint` on this `KimonoShape` with the results
        /// of a Obi Script run on an attached `KimonoProperty`.
        /// </summary>
        /// <param name="connection">Connection.</param>
        public override void UpdatePropertyConnectionPoint(KimonoPropertyConnection connection)
        {
            // Take action based on the connection point
            switch (connection.ConnectionPoint)
            {
            case KimonoPropertyConnectionPoint.CornerRadius:
                CornerRadius = connection.ConnectedProperty.ToFloat();
                break;

            default:
                base.UpdatePropertyConnectionPoint(connection);
                break;
            }
        }
        /// <summary>
        /// Updates a `KimonoPropertyConnectionPoint` on this `KimonoShape` with the results
        /// of a Obi Script run on an attached `KimonoProperty`.
        /// </summary>
        /// <param name="connection">Connection.</param>
        public override void UpdatePropertyConnectionPoint(KimonoPropertyConnection connection)
        {
            // Take action based on the connection point
            switch (connection.ConnectionPoint)
            {
            case KimonoPropertyConnectionPoint.Text:
                Text = connection.ConnectedProperty.ToString();
                break;

            default:
                base.UpdatePropertyConnectionPoint(connection);
                break;
            }
        }
Exemple #6
0
        /// <summary>
        /// Updates a `KimonoPropertyConnectionPoint` on this `KimonoColor` with the results
        /// of a Obi Script run on an attached `KimonoProperty`.
        /// </summary>
        /// <param name="connection">Connection.</param>
        public virtual void UpdatePropertyConnectionPoint(KimonoPropertyConnection connection)
        {
            // Take action based on the connection point
            switch (connection.ConnectionPoint)
            {
            case KimonoPropertyConnectionPoint.BaseColor:
                _baseColor = connection.ConnectedProperty.ToColor();
                break;

            case KimonoPropertyConnectionPoint.AdjustsHue:
                _adjustHue = connection.ConnectedProperty.ToBool();
                break;

            case KimonoPropertyConnectionPoint.HueAdjustment:
                _hueAdjustment = connection.ConnectedProperty.ToFloat();
                break;

            case KimonoPropertyConnectionPoint.AdjustsSaturation:
                _adjustSaturation = connection.ConnectedProperty.ToBool();
                break;

            case KimonoPropertyConnectionPoint.SaturationAdjustment:
                _saturationAdjustment = connection.ConnectedProperty.ToFloat();
                break;

            case KimonoPropertyConnectionPoint.AdjustsBrightness:
                _adjustBrightness = connection.ConnectedProperty.ToBool();
                break;

            case KimonoPropertyConnectionPoint.BrightnessAdjustment:
                _brightnessAdjustment = connection.ConnectedProperty.ToFloat();
                break;

            case KimonoPropertyConnectionPoint.AdjustsAlpha:
                _adjustAlpha = connection.ConnectedProperty.ToBool();
                break;

            case KimonoPropertyConnectionPoint.AlphaAdjustment:
                _alphaAdjustment = connection.ConnectedProperty.ToInt();
                break;
            }
        }
        /// <summary>
        /// Updates a `KimonoPropertyConnectionPoint` on this `KimonoShape` with the results
        /// of a Obi Script run on an attached `KimonoProperty`.
        /// </summary>
        /// <param name="connection">Connection.</param>
        public override void UpdatePropertyConnectionPoint(KimonoPropertyConnection connection)
        {
            var amount = 0;

            // Take action based on the connection point
            switch (connection.ConnectionPoint)
            {
            case KimonoPropertyConnectionPoint.NumberOfSides:
                amount = connection.ConnectedProperty.ToInt();
                if (amount > 2 && amount < 20)
                {
                    NumberOfSides = amount;
                }
                break;

            default:
                base.UpdatePropertyConnectionPoint(connection);
                break;
            }
        }
        /// <summary>
        /// Updates a `KimonoPropertyConnectionPoint` on this `KimonoShape` with the results
        /// of a Obi Script run on an attached `KimonoProperty`.
        /// </summary>
        /// <param name="connection">Connection.</param>
        public override void UpdatePropertyConnectionPoint(KimonoPropertyConnection connection)
        {
            var amount = 0;

            // Take action based on the connection point
            switch (connection.ConnectionPoint)
            {
            case KimonoPropertyConnectionPoint.NumberOfPoints:
                amount = connection.ConnectedProperty.ToInt();
                if (amount > 3 && amount < 101)
                {
                    NumberOfPoints = amount;
                }
                break;

            case KimonoPropertyConnectionPoint.SkipPoints:
                amount = connection.ConnectedProperty.ToInt();
                if (amount > 13 && amount < 11)
                {
                    SkipPoints = amount;
                }
                break;

            case KimonoPropertyConnectionPoint.DepthOffset:
                amount = connection.ConnectedProperty.ToInt();
                if (amount > -1 && amount < 101)
                {
                    DepthOffset = amount;
                }
                break;

            default:
                base.UpdatePropertyConnectionPoint(connection);
                break;
            }
        }
Exemple #9
0
 /// <summary>
 /// Removes the property connection.
 /// </summary>
 /// <param name="connection">The `KimonoPropertyConnection` to remove.</param>
 public virtual void RemovePropertyConnection(KimonoPropertyConnection connection)
 {
     // Remove the connection from the collection
     PropertyConnections.Remove(connection);
 }