Example #1
0
        private void CreateCurve(Type propertyType)
        {
            var curveEditorType = typeof(CurveEditor <>).MakeGenericType(propertyType);

            Curve               = (CurveEditorBase)Activator.CreateInstance(curveEditorType);
            Curve.EnableZoom    = CurveEditorBase.UseMode.Vertical;
            Curve.EnablePanning = CurveEditorBase.UseMode.Vertical;
            Curve.ScrollBars    = ScrollBars.Vertical;
            Curve.Parent        = Timeline?.MediaPanel;
            Curve.FPS           = Timeline?.FramesPerSecond;
            Curve.Edited       += OnKeyframesEdited;
            Curve.UnlockChildrenRecursive();
            UpdateCurve();
        }
 /// <summary>
 /// Creates the curve.
 /// </summary>
 /// <param name="propertyType">Type of the property (keyframes value).</param>
 /// <param name="curveEditorType">Type of the curve editor (generic type of the curve editor).</param>
 protected void CreateCurve(Type propertyType, Type curveEditorType)
 {
     curveEditorType     = curveEditorType.MakeGenericType(propertyType);
     Curve               = (CurveEditorBase)Activator.CreateInstance(curveEditorType);
     Curve.EnableZoom    = CurveEditorBase.UseMode.Vertical;
     Curve.EnablePanning = CurveEditorBase.UseMode.Vertical;
     Curve.ScrollBars    = ScrollBars.Vertical;
     Curve.Parent        = Timeline?.MediaPanel;
     Curve.FPS           = Timeline?.FramesPerSecond;
     Curve.Edited       += OnKeyframesEdited;
     Curve.EditingStart += OnCurveEditingStart;
     Curve.EditingEnd   += OnCurveEditingEnd;
     if (Timeline != null)
     {
         Curve.UnlockChildrenRecursive();
         UpdateCurve();
     }
 }