﻿function RectangleKeyFrame(timeCode, left, top, width, height)
{
    this.TimeCode = timeCode;
    this.Left = left;
    this.Top = top;
    this.Width = width;
    this.Height = height;
}

RectangleKeyFrame.prototype.GetShapeXaml = function(name)
{
    var xaml = '\t<Rectangle Canvas.Left="0" Width="0" Height="0" x:Name="' + name + '" Stroke="Gold" Opacity="0" Fill="#33FFFFFF" />\n';
    
    return xaml;
}

RectangleKeyFrame.prototype.GetKeyFrameXaml = function(property, first)
{
    var xaml = '\t\t\t';
    if (first)
    {
        xaml+= '<DiscreteDoubleKeyFrame ';
    }
    else
    {
        xaml+= '<LinearDoubleKeyFrame ';
    }
    
    xaml+=  'KeyTime="' + formatTime(this.TimeCode) + '" Value="';
    
    switch(property)
    {
    case "Canvas.Left":
        xaml+=this.Left;
        break;
    case "Canvas.Top":
        xaml+=this.Top;
        break;
    case "Width":
        xaml+=this.Width;
        break;
    case "Height":
        xaml+=this.Height;
        break;
    }
    
    xaml += '"/>\n';
    
    return xaml;
}
