// The Nova Project by Ken Beckett.
// Copyright (C) 2007-2012 Inevitable Software, all rights reserved.
// Released under the Common Development and Distribution License, CDDL-1.0: http://opensource.org/licenses/cddl1.php
using System.Collections.Generic;
using System.Windows.Media;
using Nova.CodeDOM;
namespace Nova.UI
{
/// <summary>
/// The view model for a <see cref="CodeDOM.LeftShift"/>.
/// </summary>
public class LeftShiftVM : BinaryShiftOperatorVM
{
#region /* STATICS */
internal static void AddViewModelMapping()
{
CreateViewModel.Add(typeof(LeftShift),
delegate(CodeObject codeObject, bool isDescription, Dictionary<CodeObject, CodeObjectVM> dictionary) { return new LeftShiftVM((LeftShift)codeObject, dictionary); });
}
#endregion
#region /* CONSTRUCTORS */
/// <summary>
/// Create a view model instance for the specified <see cref="CodeDOM.LeftShift"/>.
/// </summary>
public LeftShiftVM(LeftShift leftShift, Dictionary<CodeObject, CodeObjectVM> dictionary)
: base(leftShift, dictionary)
{ }
#endregion
#region /* PROPERTIES */
/// <summary>
/// The underlying <see cref="CodeDOM.LeftShift"/> model.
/// </summary>
public LeftShift LeftShift
{
get { return (LeftShift)CodeObject; }
}
#endregion
#region /* METHODS */
#endregion
#region /* RENDERING */
protected override void RenderOperator(CodeRenderer renderer, RenderFlags flags)
{
RenderOperator(renderer, RenderBrush(flags), this);
}
public static void RenderOperator(CodeRenderer renderer, Brush brush, CodeObjectVM tag)
{
renderer.RenderText(LeftShift.ParseToken, brush, tag);
}
protected override void AltRenderOperator(CodeRenderer renderer, RenderFlags flags)
{
AltRenderOperator(renderer, RenderBrush(flags), this);
}
public static void AltRenderOperator(CodeRenderer renderer, Brush brush, CodeObjectVM tag)
{
renderer.RenderText("\xAB", brush, CodeRenderer.CodeFontFamily, -1, tag);
}
#endregion
}
}