Exemple #1
0
        private void SaveStat()
        {
            try
            {
                if (txtValue.Text == "")
                {
                    MessageBox.Show("Value must have a value!");
                    return;
                }
                else if (cmbOperator.Text == "")
                {
                    MessageBox.Show("Operator must have an operator!");
                    return;
                }

                CurveStyle style = new CurveStyle();
                style.op    = cmbOperator.Text;
                style.value = float.Parse(txtValue.Text);

                if (_Stats.ContainsKey(cmbStat.Text))
                {
                    _Stats.Remove(cmbStat.Text);
                }

                _Stats.Add(cmbStat.Text, style);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.StackTrace + "\n" + ex.Message);
            }
        }
Exemple #2
0
        public override object ConvertTo(System.ComponentModel.ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, System.Type destinationType)
        {
            if ((value == null))
            {
                return(null);
            }
            CurveStyle valueCasted = ((CurveStyle)(value));

            if ((valueCasted == CurveStyle.StraightLineYValues))
            {
                return("straightLineYValues");
            }
            if ((valueCasted == CurveStyle.RampYValue))
            {
                return("rampYValue");
            }
            if ((valueCasted == CurveStyle.ConstantYValue))
            {
                return("constantYValue");
            }
            if ((valueCasted == CurveStyle.Formula))
            {
                return("formula");
            }
            throw new ArgumentOutOfRangeException("value");
        }
        public static void InverseTransform(CurveStyle style, Vector3 targetPos, Quaternion targetRot, float radius, Vector3 centerPos, Quaternion centerRot, out Vector3 newPos, out Quaternion newRot)
        {
            switch (style)
            {
            case CurveStyle.Flat: FlatInverseTransform(targetPos, targetRot, radius, centerPos, centerRot, out newPos, out newRot); return;

            case CurveStyle.Cylinder: CylinderInverseTransform(targetPos, targetRot, radius, centerPos, centerRot, out newPos, out newRot); return;

            case CurveStyle.UVSphere: UVSphereInverseTransform(targetPos, targetRot, radius, centerPos, centerRot, out newPos, out newRot); return;

            default:
                newPos = targetPos;
                newRot = Quaternion.identity;
                return;
            }
        }
Exemple #4
0
        public override void SetProperty(Property property)
        {
            switch (property.Id)
            {
            case ModelCode.CURVE_STYLE:
                curveStyle = (CurveStyle)property.AsEnum();
                break;

            case ModelCode.CURVE_XMULTPLIER:
                xMultiplier = (UnitMultiplier)property.AsEnum();
                break;

            case ModelCode.CURVE_XUNIT:
                xUnit = (UnitSymbol)property.AsEnum();
                break;

            case ModelCode.CURVE_Y1MULTIPLIER:
                y1Multiplier = (UnitMultiplier)property.AsEnum();
                break;

            case ModelCode.CURVE_Y1UNIT:
                y1Unit = (UnitSymbol)property.AsEnum();
                break;

            case ModelCode.CURVE_Y2MULTIPLIER:
                y2Multiplier = (UnitMultiplier)property.AsEnum();
                break;

            case ModelCode.CURVE_Y2UNIT:
                y2Unit = (UnitSymbol)property.AsEnum();
                break;

            case ModelCode.CURVE_Y3MULTIPLIER:
                y3Multiplier = (UnitMultiplier)property.AsEnum();
                break;

            case ModelCode.CURVE_Y3UNIT:
                y3Unit = (UnitSymbol)property.AsEnum();
                break;

            default:
                base.SetProperty(property);
                break;
            }
        }
Exemple #5
0
        public TouchCurvedProgressBar(
            TouchColor colorBackground,
            TouchColor colorProgress,
            float currentProgress
            )
        {
            Visible       = true;
            VisibleWindow = false;

            backgroundColor = colorBackground;
            progressColor   = colorProgress;
            _progress       = currentProgress;
            barWidth        = 20;
            curveStyle      = CurveStyle.HalfCurve;

            SetSizeRequest(160, 80);

            ExposeEvent += OnExpose;
        }