コード例 #1
0
        public override object FT(float time, DomType domtype)
        {
            if (time < base.Begin)
            {
                return(null);
            }
            if ((time < base.Begin) || (time > (base.Begin + base.Duration)))
            {
                return(null);
            }
            string text1 = base.ToWhat;

            switch (domtype)
            {
            case DomType.SvgMatrix:
            {
                return(new Transf(this.Type + "(" + text1.Trim() + ")").Matrix);
            }

            case DomType.SvgNumber:
            {
                return(ItopVector.Core.Func.Number.parseToFloat(text1.Trim(), (SvgElement)this.ParentNode, ItopVector.Core.Func.SvgLengthDirection.Horizontal));
            }

            case DomType.SvgString:
            {
                return(text1.Trim());
            }

            case DomType.SvgColor:
            {
                return(text1.Trim());
            }

            case DomType.SvgPath:
            {
                return(PathFunc.PathDataParse(text1));
            }

            case DomType.SvgPoints:
            {
                return(PointsFunc.PointsParse(text1));
            }
            }
            return(base.ToWhat);
        }
コード例 #2
0
        public virtual object FT(float time, DomType domtype)
        {
            if ((time < this.Begin) || (time > (this.Begin + this.Duration)))
            {
                return(null);
            }
            ArrayList list1   = (ArrayList)this.Values.Clone();
            ArrayList list2   = (ArrayList)this.KeyTimes.Clone();
            float     single1 = 0f;
            float     single2 = 1f;
            float     single3 = this.Begin;
            float     single4 = this.Duration;

            if (single4 == 0f)
            {
                single4 = 0.1f;
            }
            if (list1.Count == 0)
            {
                list1.Add(this.FromWhat);
                list2.Add(single3.ToString());
                list1.Add(this.ToWhat);
                float single7 = single3 + single4;
                list2.Add(single7.ToString());
            }
            int   num1    = -1;
            float single5 = 0f;
            float single6 = 0f;

            for (int num2 = 1; num2 < list2.Count; num2++)
            {
                single5 = float.Parse(((string)list2[num2 - 1]).Trim());
                single6 = float.Parse(((string)list2[num2]).Trim());
                if ((time >= single5) && (time <= single6))
                {
                    num1 = num2 - 1;
                    break;
                }
            }
            string text1 = (string)list1[num1];
            string text2 = (string)list1[num1 + 1];

            if (list2[num1] != null)
            {
                single1 = float.Parse((string)list2[num1]);
            }
            if (list2[num1 + 1] != null)
            {
                single2 = float.Parse((string)list2[num1 + 1]);
            }
            string text3 = string.Empty;

            string[] textArray1 = AnimFunc.Linear(text1.Trim(), single1, text2.Trim(), single2, domtype, (int)time);
            string[] textArray2 = textArray1;
            for (int num3 = 0; num3 < textArray2.Length; num3++)
            {
                string text4 = textArray2[num3];
                text3 = text3 + text4 + " ";
            }
            switch (domtype)
            {
            case DomType.SvgMatrix:
            {
                return(new Transf(this.Type + "(" + text3.Trim() + ")").Matrix);
            }

            case DomType.SvgNumber:
            {
                return(ItopVector.Core.Func.Number.parseToFloat(text3.Trim(), (SvgElement)this.ParentNode, ItopVector.Core.Func.SvgLengthDirection.Horizontal));
            }

            case DomType.SvgColor:
            {
                return(text3.Trim());
            }

            case DomType.SvgPath:
            {
                SvgElement element1 = this.RefElement;
                if (element1 is IPath)
                {
                    return(PathFunc.PathDataParse(text3, ((IPath)element1).PointsInfo));
                }
                return(PathFunc.PathDataParse(text3));
            }

            case DomType.SvgPoints:
            {
                return(PointsFunc.PointsParse(text3));
            }
            }
            return(text3.Trim());
        }