// Copyright (c) The NodeRT Contributors
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may
// not use this file except in compliance with the License. You may obtain a
// copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions
// and limitations under the License.

// TODO: Verify that this is is still needed..
#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include "nan.h"
#include <string>
#include <ppltasks.h>
#include "CollectionsConverter.h"
#include "CollectionsWrap.h"
#include "node-async.h"
#include "NodeRtUtils.h"
#include "OpaqueWrapper.h"
#include "WrapperBase.h"

#using <Windows.WinMD>

// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods
#undef DocumentProperties
#undef GetObject
#undef CreateEvent
#undef FindText
#undef SendMessage

const char* REGISTRATION_TOKEN_MAP_PROPERTY_NAME = "__registrationTokenMap__";

using v8::Array;
using v8::String;
using v8::Value;
using v8::Boolean;
using v8::Integer;
using v8::FunctionTemplate;
using v8::Object;
using v8::Local;
using v8::Function;
using v8::Date;
using v8::Number;
using v8::PropertyAttribute;
using v8::Primitive;
using Nan::HandleScope;
using Nan::Persistent;
using Nan::Undefined;
using Nan::True;
using Nan::False;
using Nan::Null;
using Nan::MaybeLocal;
using Nan::EscapableHandleScope;
using Nan::HandleScope;
using Nan::TryCatch;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace UI { namespace Composition { 
  v8::Local<v8::Value> WrapCompositionObject(::Windows::UI::Composition::CompositionObject^ wintRtInstance);
  ::Windows::UI::Composition::CompositionObject^ UnwrapCompositionObject(Local<Value> value);
  
  v8::Local<v8::Value> WrapICompositionAnimationBase(::Windows::UI::Composition::ICompositionAnimationBase^ wintRtInstance);
  ::Windows::UI::Composition::ICompositionAnimationBase^ UnwrapICompositionAnimationBase(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionAnimation(::Windows::UI::Composition::CompositionAnimation^ wintRtInstance);
  ::Windows::UI::Composition::CompositionAnimation^ UnwrapCompositionAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionBatchCompletedEventArgs(::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ wintRtInstance);
  ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ UnwrapCompositionBatchCompletedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionEasingFunction(::Windows::UI::Composition::CompositionEasingFunction^ wintRtInstance);
  ::Windows::UI::Composition::CompositionEasingFunction^ UnwrapCompositionEasingFunction(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionBrush(::Windows::UI::Composition::CompositionBrush^ wintRtInstance);
  ::Windows::UI::Composition::CompositionBrush^ UnwrapCompositionBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionEffectBrush(::Windows::UI::Composition::CompositionEffectBrush^ wintRtInstance);
  ::Windows::UI::Composition::CompositionEffectBrush^ UnwrapCompositionEffectBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionEffectSourceParameter(::Windows::UI::Composition::CompositionEffectSourceParameter^ wintRtInstance);
  ::Windows::UI::Composition::CompositionEffectSourceParameter^ UnwrapCompositionEffectSourceParameter(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionGraphicsDevice(::Windows::UI::Composition::CompositionGraphicsDevice^ wintRtInstance);
  ::Windows::UI::Composition::CompositionGraphicsDevice^ UnwrapCompositionGraphicsDevice(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositor(::Windows::UI::Composition::Compositor^ wintRtInstance);
  ::Windows::UI::Composition::Compositor^ UnwrapCompositor(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionPropertySet(::Windows::UI::Composition::CompositionPropertySet^ wintRtInstance);
  ::Windows::UI::Composition::CompositionPropertySet^ UnwrapCompositionPropertySet(Local<Value> value);
  
  v8::Local<v8::Value> WrapICompositionSurface(::Windows::UI::Composition::ICompositionSurface^ wintRtInstance);
  ::Windows::UI::Composition::ICompositionSurface^ UnwrapICompositionSurface(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionDrawingSurface(::Windows::UI::Composition::CompositionDrawingSurface^ wintRtInstance);
  ::Windows::UI::Composition::CompositionDrawingSurface^ UnwrapCompositionDrawingSurface(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionColorBrush(::Windows::UI::Composition::CompositionColorBrush^ wintRtInstance);
  ::Windows::UI::Composition::CompositionColorBrush^ UnwrapCompositionColorBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionEffectFactory(::Windows::UI::Composition::CompositionEffectFactory^ wintRtInstance);
  ::Windows::UI::Composition::CompositionEffectFactory^ UnwrapCompositionEffectFactory(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionScopedBatch(::Windows::UI::Composition::CompositionScopedBatch^ wintRtInstance);
  ::Windows::UI::Composition::CompositionScopedBatch^ UnwrapCompositionScopedBatch(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionSurfaceBrush(::Windows::UI::Composition::CompositionSurfaceBrush^ wintRtInstance);
  ::Windows::UI::Composition::CompositionSurfaceBrush^ UnwrapCompositionSurfaceBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionTarget(::Windows::UI::Composition::CompositionTarget^ wintRtInstance);
  ::Windows::UI::Composition::CompositionTarget^ UnwrapCompositionTarget(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionCommitBatch(::Windows::UI::Composition::CompositionCommitBatch^ wintRtInstance);
  ::Windows::UI::Composition::CompositionCommitBatch^ UnwrapCompositionCommitBatch(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionAnimationGroup(::Windows::UI::Composition::CompositionAnimationGroup^ wintRtInstance);
  ::Windows::UI::Composition::CompositionAnimationGroup^ UnwrapCompositionAnimationGroup(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionBackdropBrush(::Windows::UI::Composition::CompositionBackdropBrush^ wintRtInstance);
  ::Windows::UI::Composition::CompositionBackdropBrush^ UnwrapCompositionBackdropBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionMaskBrush(::Windows::UI::Composition::CompositionMaskBrush^ wintRtInstance);
  ::Windows::UI::Composition::CompositionMaskBrush^ UnwrapCompositionMaskBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionNineGridBrush(::Windows::UI::Composition::CompositionNineGridBrush^ wintRtInstance);
  ::Windows::UI::Composition::CompositionNineGridBrush^ UnwrapCompositionNineGridBrush(Local<Value> value);
  
  v8::Local<v8::Value> WrapCubicBezierEasingFunction(::Windows::UI::Composition::CubicBezierEasingFunction^ wintRtInstance);
  ::Windows::UI::Composition::CubicBezierEasingFunction^ UnwrapCubicBezierEasingFunction(Local<Value> value);
  
  v8::Local<v8::Value> WrapExpressionAnimation(::Windows::UI::Composition::ExpressionAnimation^ wintRtInstance);
  ::Windows::UI::Composition::ExpressionAnimation^ UnwrapExpressionAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapImplicitAnimationCollection(::Windows::UI::Composition::ImplicitAnimationCollection^ wintRtInstance);
  ::Windows::UI::Composition::ImplicitAnimationCollection^ UnwrapImplicitAnimationCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapLinearEasingFunction(::Windows::UI::Composition::LinearEasingFunction^ wintRtInstance);
  ::Windows::UI::Composition::LinearEasingFunction^ UnwrapLinearEasingFunction(Local<Value> value);
  
  v8::Local<v8::Value> WrapRenderingDeviceReplacedEventArgs(::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ wintRtInstance);
  ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ UnwrapRenderingDeviceReplacedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionShadow(::Windows::UI::Composition::CompositionShadow^ wintRtInstance);
  ::Windows::UI::Composition::CompositionShadow^ UnwrapCompositionShadow(Local<Value> value);
  
  v8::Local<v8::Value> WrapDropShadow(::Windows::UI::Composition::DropShadow^ wintRtInstance);
  ::Windows::UI::Composition::DropShadow^ UnwrapDropShadow(Local<Value> value);
  
  v8::Local<v8::Value> WrapStepEasingFunction(::Windows::UI::Composition::StepEasingFunction^ wintRtInstance);
  ::Windows::UI::Composition::StepEasingFunction^ UnwrapStepEasingFunction(Local<Value> value);
  
  v8::Local<v8::Value> WrapVisual(::Windows::UI::Composition::Visual^ wintRtInstance);
  ::Windows::UI::Composition::Visual^ UnwrapVisual(Local<Value> value);
  
  v8::Local<v8::Value> WrapContainerVisual(::Windows::UI::Composition::ContainerVisual^ wintRtInstance);
  ::Windows::UI::Composition::ContainerVisual^ UnwrapContainerVisual(Local<Value> value);
  
  v8::Local<v8::Value> WrapSpriteVisual(::Windows::UI::Composition::SpriteVisual^ wintRtInstance);
  ::Windows::UI::Composition::SpriteVisual^ UnwrapSpriteVisual(Local<Value> value);
  
  v8::Local<v8::Value> WrapLayerVisual(::Windows::UI::Composition::LayerVisual^ wintRtInstance);
  ::Windows::UI::Composition::LayerVisual^ UnwrapLayerVisual(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionClip(::Windows::UI::Composition::CompositionClip^ wintRtInstance);
  ::Windows::UI::Composition::CompositionClip^ UnwrapCompositionClip(Local<Value> value);
  
  v8::Local<v8::Value> WrapInsetClip(::Windows::UI::Composition::InsetClip^ wintRtInstance);
  ::Windows::UI::Composition::InsetClip^ UnwrapInsetClip(Local<Value> value);
  
  v8::Local<v8::Value> WrapVisualCollection(::Windows::UI::Composition::VisualCollection^ wintRtInstance);
  ::Windows::UI::Composition::VisualCollection^ UnwrapVisualCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapVisualUnorderedCollection(::Windows::UI::Composition::VisualUnorderedCollection^ wintRtInstance);
  ::Windows::UI::Composition::VisualUnorderedCollection^ UnwrapVisualUnorderedCollection(Local<Value> value);
  
  v8::Local<v8::Value> WrapCompositionLight(::Windows::UI::Composition::CompositionLight^ wintRtInstance);
  ::Windows::UI::Composition::CompositionLight^ UnwrapCompositionLight(Local<Value> value);
  
  v8::Local<v8::Value> WrapAmbientLight(::Windows::UI::Composition::AmbientLight^ wintRtInstance);
  ::Windows::UI::Composition::AmbientLight^ UnwrapAmbientLight(Local<Value> value);
  
  v8::Local<v8::Value> WrapDistantLight(::Windows::UI::Composition::DistantLight^ wintRtInstance);
  ::Windows::UI::Composition::DistantLight^ UnwrapDistantLight(Local<Value> value);
  
  v8::Local<v8::Value> WrapPointLight(::Windows::UI::Composition::PointLight^ wintRtInstance);
  ::Windows::UI::Composition::PointLight^ UnwrapPointLight(Local<Value> value);
  
  v8::Local<v8::Value> WrapSpotLight(::Windows::UI::Composition::SpotLight^ wintRtInstance);
  ::Windows::UI::Composition::SpotLight^ UnwrapSpotLight(Local<Value> value);
  
  v8::Local<v8::Value> WrapKeyFrameAnimation(::Windows::UI::Composition::KeyFrameAnimation^ wintRtInstance);
  ::Windows::UI::Composition::KeyFrameAnimation^ UnwrapKeyFrameAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapColorKeyFrameAnimation(::Windows::UI::Composition::ColorKeyFrameAnimation^ wintRtInstance);
  ::Windows::UI::Composition::ColorKeyFrameAnimation^ UnwrapColorKeyFrameAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapQuaternionKeyFrameAnimation(::Windows::UI::Composition::QuaternionKeyFrameAnimation^ wintRtInstance);
  ::Windows::UI::Composition::QuaternionKeyFrameAnimation^ UnwrapQuaternionKeyFrameAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapScalarKeyFrameAnimation(::Windows::UI::Composition::ScalarKeyFrameAnimation^ wintRtInstance);
  ::Windows::UI::Composition::ScalarKeyFrameAnimation^ UnwrapScalarKeyFrameAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapVector2KeyFrameAnimation(::Windows::UI::Composition::Vector2KeyFrameAnimation^ wintRtInstance);
  ::Windows::UI::Composition::Vector2KeyFrameAnimation^ UnwrapVector2KeyFrameAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapVector3KeyFrameAnimation(::Windows::UI::Composition::Vector3KeyFrameAnimation^ wintRtInstance);
  ::Windows::UI::Composition::Vector3KeyFrameAnimation^ UnwrapVector3KeyFrameAnimation(Local<Value> value);
  
  v8::Local<v8::Value> WrapVector4KeyFrameAnimation(::Windows::UI::Composition::Vector4KeyFrameAnimation^ wintRtInstance);
  ::Windows::UI::Composition::Vector4KeyFrameAnimation^ UnwrapVector4KeyFrameAnimation(Local<Value> value);
  



  static void InitAnimationDirectionEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AnimationDirection").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("normal").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationDirection::Normal)));
    Nan::Set(enumObject, Nan::New<String>("reverse").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationDirection::Reverse)));
    Nan::Set(enumObject, Nan::New<String>("alternate").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationDirection::Alternate)));
    Nan::Set(enumObject, Nan::New<String>("alternateReverse").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationDirection::AlternateReverse)));
  }

  static void InitAnimationIterationBehaviorEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AnimationIterationBehavior").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("count").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationIterationBehavior::Count)));
    Nan::Set(enumObject, Nan::New<String>("forever").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationIterationBehavior::Forever)));
  }

  static void InitAnimationStopBehaviorEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("AnimationStopBehavior").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("leaveCurrentValue").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationStopBehavior::LeaveCurrentValue)));
    Nan::Set(enumObject, Nan::New<String>("setToInitialValue").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationStopBehavior::SetToInitialValue)));
    Nan::Set(enumObject, Nan::New<String>("setToFinalValue").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::AnimationStopBehavior::SetToFinalValue)));
  }

  static void InitCompositionBatchTypesEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionBatchTypes").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("none").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBatchTypes::None)));
    Nan::Set(enumObject, Nan::New<String>("animation").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBatchTypes::Animation)));
    Nan::Set(enumObject, Nan::New<String>("effect").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBatchTypes::Effect)));
  }

  static void InitCompositionBackfaceVisibilityEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionBackfaceVisibility").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("inherit").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBackfaceVisibility::Inherit)));
    Nan::Set(enumObject, Nan::New<String>("visible").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBackfaceVisibility::Visible)));
    Nan::Set(enumObject, Nan::New<String>("hidden").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBackfaceVisibility::Hidden)));
  }

  static void InitCompositionBitmapInterpolationModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionBitmapInterpolationMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("nearestNeighbor").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBitmapInterpolationMode::NearestNeighbor)));
    Nan::Set(enumObject, Nan::New<String>("linear").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBitmapInterpolationMode::Linear)));
  }

  static void InitCompositionBorderModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionBorderMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("inherit").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBorderMode::Inherit)));
    Nan::Set(enumObject, Nan::New<String>("soft").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBorderMode::Soft)));
    Nan::Set(enumObject, Nan::New<String>("hard").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionBorderMode::Hard)));
  }

  static void InitCompositionColorSpaceEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionColorSpace").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("auto").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionColorSpace::Auto)));
    Nan::Set(enumObject, Nan::New<String>("hsl").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionColorSpace::Hsl)));
    Nan::Set(enumObject, Nan::New<String>("rgb").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionColorSpace::Rgb)));
  }

  static void InitCompositionCompositeModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionCompositeMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("inherit").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionCompositeMode::Inherit)));
    Nan::Set(enumObject, Nan::New<String>("sourceOver").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionCompositeMode::SourceOver)));
    Nan::Set(enumObject, Nan::New<String>("destinationInvert").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionCompositeMode::DestinationInvert)));
    Nan::Set(enumObject, Nan::New<String>("minBlend").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionCompositeMode::MinBlend)));
  }

  static void InitCompositionEffectFactoryLoadStatusEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionEffectFactoryLoadStatus").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("success").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionEffectFactoryLoadStatus::Success)));
    Nan::Set(enumObject, Nan::New<String>("effectTooComplex").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionEffectFactoryLoadStatus::EffectTooComplex)));
    Nan::Set(enumObject, Nan::New<String>("pending").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionEffectFactoryLoadStatus::Pending)));
    Nan::Set(enumObject, Nan::New<String>("other").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionEffectFactoryLoadStatus::Other)));
  }

  static void InitCompositionGetValueStatusEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionGetValueStatus").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("succeeded").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionGetValueStatus::Succeeded)));
    Nan::Set(enumObject, Nan::New<String>("typeMismatch").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionGetValueStatus::TypeMismatch)));
    Nan::Set(enumObject, Nan::New<String>("notFound").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionGetValueStatus::NotFound)));
  }

  static void InitCompositionStretchEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("CompositionStretch").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("none").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionStretch::None)));
    Nan::Set(enumObject, Nan::New<String>("fill").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionStretch::Fill)));
    Nan::Set(enumObject, Nan::New<String>("uniform").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionStretch::Uniform)));
    Nan::Set(enumObject, Nan::New<String>("uniformToFill").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::Composition::CompositionStretch::UniformToFill)));
  }


  static bool IsColorJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::UI::Color ColorFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::UI::Color returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> ColorToJsObject(::Windows::UI::Color value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }
  static bool IsMatrix3x2JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("m11").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m12").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m21").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m22").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m31").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m32").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Matrix3x2 Matrix3x2FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Matrix3x2 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("m11").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M11 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m12").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M12 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m21").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M21 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m22").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M22 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m31").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M31 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m32").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M32 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Matrix3x2ToJsObject(::Platform::Numerics::Matrix3x2 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("m11").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M11)));
    Nan::Set(obj, Nan::New<String>("m12").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M12)));
    Nan::Set(obj, Nan::New<String>("m21").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M21)));
    Nan::Set(obj, Nan::New<String>("m22").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M22)));
    Nan::Set(obj, Nan::New<String>("m31").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M31)));
    Nan::Set(obj, Nan::New<String>("m32").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M32)));

    return scope.Escape(obj);
  }
  static bool IsMatrix4x4JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("m11").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m12").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m13").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m14").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m21").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m22").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m23").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m24").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m31").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m32").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m33").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m34").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m41").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m42").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m43").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("m44").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Matrix4x4 Matrix4x4FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Matrix4x4 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("m11").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M11 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m12").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M12 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m13").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M13 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m14").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M14 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m21").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M21 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m22").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M22 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m23").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M23 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m24").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M24 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m31").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M31 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m32").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M32 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m33").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M33 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m34").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M34 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m41").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M41 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m42").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M42 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m43").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M43 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("m44").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.M44 = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Matrix4x4ToJsObject(::Platform::Numerics::Matrix4x4 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("m11").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M11)));
    Nan::Set(obj, Nan::New<String>("m12").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M12)));
    Nan::Set(obj, Nan::New<String>("m13").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M13)));
    Nan::Set(obj, Nan::New<String>("m14").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M14)));
    Nan::Set(obj, Nan::New<String>("m21").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M21)));
    Nan::Set(obj, Nan::New<String>("m22").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M22)));
    Nan::Set(obj, Nan::New<String>("m23").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M23)));
    Nan::Set(obj, Nan::New<String>("m24").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M24)));
    Nan::Set(obj, Nan::New<String>("m31").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M31)));
    Nan::Set(obj, Nan::New<String>("m32").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M32)));
    Nan::Set(obj, Nan::New<String>("m33").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M33)));
    Nan::Set(obj, Nan::New<String>("m34").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M34)));
    Nan::Set(obj, Nan::New<String>("m41").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M41)));
    Nan::Set(obj, Nan::New<String>("m42").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M42)));
    Nan::Set(obj, Nan::New<String>("m43").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M43)));
    Nan::Set(obj, Nan::New<String>("m44").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.M44)));

    return scope.Escape(obj);
  }
  static bool IsQuaternionJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Quaternion QuaternionFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Quaternion returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Z = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.W = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> QuaternionToJsObject(::Platform::Numerics::Quaternion value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));
    Nan::Set(obj, Nan::New<String>("z").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Z)));
    Nan::Set(obj, Nan::New<String>("w").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.W)));

    return scope.Escape(obj);
  }
  static bool IsVector2JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Vector2 Vector2FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Vector2 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Vector2ToJsObject(::Platform::Numerics::Vector2 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));

    return scope.Escape(obj);
  }
  static bool IsVector3JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Vector3 Vector3FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Vector3 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Z = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Vector3ToJsObject(::Platform::Numerics::Vector3 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));
    Nan::Set(obj, Nan::New<String>("z").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Z)));

    return scope.Escape(obj);
  }
  static bool IsVector4JsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      if (!Nan::Get(obj,symbol).ToLocalChecked()->IsNumber()) {
        return false;
      }
    }
    
    return true;
  }

  ::Platform::Numerics::Vector4 Vector4FromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Platform::Numerics::Vector4 returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    symbol = Nan::New<String>("x").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.X = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("y").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Y = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("z").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.Z = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    symbol = Nan::New<String>("w").ToLocalChecked();
    if (Nan::Has(obj, symbol).FromMaybe(false)) {
      returnValue.W = static_cast<float>(Nan::To<double>(Nan::Get(obj,symbol).ToLocalChecked()).FromMaybe(0.0));
    }
    
    return returnValue;
  }

  Local<Value> Vector4ToJsObject(::Platform::Numerics::Vector4 value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();

    Nan::Set(obj, Nan::New<String>("x").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.X)));
    Nan::Set(obj, Nan::New<String>("y").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Y)));
    Nan::Set(obj, Nan::New<String>("z").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.Z)));
    Nan::Set(obj, Nan::New<String>("w").ToLocalChecked(), Nan::New<Number>(static_cast<double>(value.W)));

    return scope.Escape(obj);
  }
  static bool IsSizeJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::Foundation::Size SizeFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::Foundation::Size returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> SizeToJsObject(::Windows::Foundation::Size value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }

  class CompositionObject : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionObject").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "startAnimation", StartAnimation);
            Nan::SetPrototypeMethod(localRef, "stopAnimation", StopAnimation);
            Nan::SetPrototypeMethod(localRef, "close", Close);
            Nan::SetPrototypeMethod(localRef, "startAnimationGroup", StartAnimationGroup);
            Nan::SetPrototypeMethod(localRef, "stopAnimationGroup", StopAnimationGroup);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionObject").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionObject(::Windows::UI::Composition::CompositionObject^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionObject^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionObject^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionObject *wrapperInstance = new CompositionObject(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionObject^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionObject^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionObject(winRtInstance));
    }


    static void StartAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Composition::CompositionAnimation^ arg1 = UnwrapCompositionAnimation(info[1]);
          
          wrapper->_instance->StartAnimation(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void StopAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          wrapper->_instance->StopAnimation(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void Close(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      if (info.Length() == 0) {
        try {
          delete wrapper->_instance;
          wrapper->_instance = nullptr;
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      } else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void StartAnimationGroup(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionAnimationBase^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::ICompositionAnimationBase^ arg0 = UnwrapICompositionAnimationBase(info[0]);
          
          wrapper->_instance->StartAnimationGroup(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void StopAnimationGroup(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionAnimationBase^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::ICompositionAnimationBase^ arg0 = UnwrapICompositionAnimationBase(info[0]);
          
          wrapper->_instance->StopAnimationGroup(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionObject^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionObject(::Windows::UI::Composition::CompositionObject^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionObject^ UnwrapCompositionObject(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionObject::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionObject(::Windows::UI::Composition::CompositionObject^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionObject::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionObject^ UnwrapCompositionObject(Local<Value> value) {
     return CompositionObject::Unwrap<CompositionObject>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionObject(Local<Object> exports) {
    CompositionObject::Init(exports);
  }

  class ICompositionAnimationBase : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ICompositionAnimationBase").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);






        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ICompositionAnimationBase").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ICompositionAnimationBase(::Windows::UI::Composition::ICompositionAnimationBase^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::ICompositionAnimationBase^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionAnimationBase^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::ICompositionAnimationBase^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ICompositionAnimationBase *wrapperInstance = new ICompositionAnimationBase(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionAnimationBase^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::ICompositionAnimationBase^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::ICompositionAnimationBase^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapICompositionAnimationBase(winRtInstance));
    }







    private:
      ::Windows::UI::Composition::ICompositionAnimationBase^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapICompositionAnimationBase(::Windows::UI::Composition::ICompositionAnimationBase^ wintRtInstance);
      friend ::Windows::UI::Composition::ICompositionAnimationBase^ UnwrapICompositionAnimationBase(Local<Value> value);
  };

  Persistent<FunctionTemplate> ICompositionAnimationBase::s_constructorTemplate;

  v8::Local<v8::Value> WrapICompositionAnimationBase(::Windows::UI::Composition::ICompositionAnimationBase^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ICompositionAnimationBase::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::ICompositionAnimationBase^ UnwrapICompositionAnimationBase(Local<Value> value) {
     return ICompositionAnimationBase::Unwrap<ICompositionAnimationBase>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitICompositionAnimationBase(Local<Object> exports) {
    ICompositionAnimationBase::Init(exports);
  }

  class CompositionAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "clearAllParameters", ClearAllParameters);
            Nan::SetPrototypeMethod(localRef, "clearParameter", ClearParameter);
            Nan::SetPrototypeMethod(localRef, "setColorParameter", SetColorParameter);
            Nan::SetPrototypeMethod(localRef, "setMatrix3x2Parameter", SetMatrix3x2Parameter);
            Nan::SetPrototypeMethod(localRef, "setMatrix4x4Parameter", SetMatrix4x4Parameter);
            Nan::SetPrototypeMethod(localRef, "setQuaternionParameter", SetQuaternionParameter);
            Nan::SetPrototypeMethod(localRef, "setReferenceParameter", SetReferenceParameter);
            Nan::SetPrototypeMethod(localRef, "setScalarParameter", SetScalarParameter);
            Nan::SetPrototypeMethod(localRef, "setVector2Parameter", SetVector2Parameter);
            Nan::SetPrototypeMethod(localRef, "setVector3Parameter", SetVector3Parameter);
            Nan::SetPrototypeMethod(localRef, "setVector4Parameter", SetVector4Parameter);
            Nan::SetPrototypeMethod(localRef, "setBooleanParameter", SetBooleanParameter);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionAnimation(::Windows::UI::Composition::CompositionAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionAnimation *wrapperInstance = new CompositionAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionAnimation(winRtInstance));
    }


    static void ClearAllParameters(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->ClearAllParameters();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void ClearParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          wrapper->_instance->ClearParameter(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetColorParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsColor(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Color arg1 = NodeRT::Utils::ColorFromJs(info[1]);
          
          wrapper->_instance->SetColorParameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetMatrix3x2Parameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsMatrix3x2JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Matrix3x2 arg1 = Matrix3x2FromJsObject(info[1]);
          
          wrapper->_instance->SetMatrix3x2Parameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetMatrix4x4Parameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsMatrix4x4JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Matrix4x4 arg1 = Matrix4x4FromJsObject(info[1]);
          
          wrapper->_instance->SetMatrix4x4Parameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetQuaternionParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsQuaternionJsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Quaternion arg1 = QuaternionFromJsObject(info[1]);
          
          wrapper->_instance->SetQuaternionParameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetReferenceParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Composition::CompositionObject^ arg1 = UnwrapCompositionObject(info[1]);
          
          wrapper->_instance->SetReferenceParameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetScalarParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && info[1]->IsNumber())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          float arg1 = static_cast<float>(Nan::To<double>(info[1]).FromMaybe(0.0));
          
          wrapper->_instance->SetScalarParameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetVector2Parameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsVector2JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector2 arg1 = Vector2FromJsObject(info[1]);
          
          wrapper->_instance->SetVector2Parameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetVector3Parameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsVector3JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector3 arg1 = Vector3FromJsObject(info[1]);
          
          wrapper->_instance->SetVector3Parameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetVector4Parameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsVector4JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector4 arg1 = Vector4FromJsObject(info[1]);
          
          wrapper->_instance->SetVector4Parameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetBooleanParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && info[1]->IsBoolean())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          bool arg1 = Nan::To<bool>(info[1]).FromMaybe(false);
          
          wrapper->_instance->SetBooleanParameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionAnimation(::Windows::UI::Composition::CompositionAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionAnimation^ UnwrapCompositionAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionAnimation(::Windows::UI::Composition::CompositionAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionAnimation^ UnwrapCompositionAnimation(Local<Value> value) {
     return CompositionAnimation::Unwrap<CompositionAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionAnimation(Local<Object> exports) {
    CompositionAnimation::Init(exports);
  }

  class CompositionBatchCompletedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionBatchCompletedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionBatchCompletedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionBatchCompletedEventArgs(::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBatchCompletedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionBatchCompletedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionBatchCompletedEventArgs *wrapperInstance = new CompositionBatchCompletedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBatchCompletedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionBatchCompletedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionBatchCompletedEventArgs(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionBatchCompletedEventArgs(::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ UnwrapCompositionBatchCompletedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionBatchCompletedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionBatchCompletedEventArgs(::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionBatchCompletedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ UnwrapCompositionBatchCompletedEventArgs(Local<Value> value) {
     return CompositionBatchCompletedEventArgs::Unwrap<CompositionBatchCompletedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionBatchCompletedEventArgs(Local<Object> exports) {
    CompositionBatchCompletedEventArgs::Init(exports);
  }

  class CompositionEasingFunction : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionEasingFunction").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionEasingFunction").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionEasingFunction(::Windows::UI::Composition::CompositionEasingFunction^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionEasingFunction^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionEasingFunction *wrapperInstance = new CompositionEasingFunction(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionEasingFunction^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionEasingFunction(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionEasingFunction^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionEasingFunction(::Windows::UI::Composition::CompositionEasingFunction^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionEasingFunction^ UnwrapCompositionEasingFunction(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionEasingFunction::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionEasingFunction(::Windows::UI::Composition::CompositionEasingFunction^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionEasingFunction::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionEasingFunction^ UnwrapCompositionEasingFunction(Local<Value> value) {
     return CompositionEasingFunction::Unwrap<CompositionEasingFunction>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionEasingFunction(Local<Object> exports) {
    CompositionEasingFunction::Init(exports);
  }

  class CompositionBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionBrush(::Windows::UI::Composition::CompositionBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionBrush *wrapperInstance = new CompositionBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionBrush(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionBrush(::Windows::UI::Composition::CompositionBrush^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionBrush^ UnwrapCompositionBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionBrush(::Windows::UI::Composition::CompositionBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionBrush^ UnwrapCompositionBrush(Local<Value> value) {
     return CompositionBrush::Unwrap<CompositionBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionBrush(Local<Object> exports) {
    CompositionBrush::Init(exports);
  }

  class CompositionEffectBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionEffectBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "getSourceParameter", GetSourceParameter);
            Nan::SetPrototypeMethod(localRef, "setSourceParameter", SetSourceParameter);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionEffectBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionEffectBrush(::Windows::UI::Composition::CompositionEffectBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionEffectBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionEffectBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionEffectBrush *wrapperInstance = new CompositionEffectBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionEffectBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionEffectBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionEffectBrush(winRtInstance));
    }


    static void GetSourceParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectBrush^>(info.This())) {
        return;
      }

      CompositionEffectBrush *wrapper = CompositionEffectBrush::Unwrap<CompositionEffectBrush>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          ::Windows::UI::Composition::CompositionBrush^ result;
          result = wrapper->_instance->GetSourceParameter(arg0);
          info.GetReturnValue().Set(WrapCompositionBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetSourceParameter(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectBrush^>(info.This())) {
        return;
      }

      CompositionEffectBrush *wrapper = CompositionEffectBrush::Unwrap<CompositionEffectBrush>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Composition::CompositionBrush^ arg1 = UnwrapCompositionBrush(info[1]);
          
          wrapper->_instance->SetSourceParameter(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionEffectBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionEffectBrush(::Windows::UI::Composition::CompositionEffectBrush^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionEffectBrush^ UnwrapCompositionEffectBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionEffectBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionEffectBrush(::Windows::UI::Composition::CompositionEffectBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionEffectBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionEffectBrush^ UnwrapCompositionEffectBrush(Local<Value> value) {
     return CompositionEffectBrush::Unwrap<CompositionEffectBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionEffectBrush(Local<Object> exports) {
    CompositionEffectBrush::Init(exports);
  }

  class CompositionEffectSourceParameter : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionEffectSourceParameter").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("name").ToLocalChecked(), NameGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionEffectSourceParameter").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionEffectSourceParameter(::Windows::UI::Composition::CompositionEffectSourceParameter^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionEffectSourceParameter^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectSourceParameter^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionEffectSourceParameter^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && info[0]->IsString())
      {
        try {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          winRtInstance = ref new ::Windows::UI::Composition::CompositionEffectSourceParameter(arg0);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionEffectSourceParameter *wrapperInstance = new CompositionEffectSourceParameter(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectSourceParameter^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionEffectSourceParameter^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionEffectSourceParameter^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionEffectSourceParameter(winRtInstance));
    }





    static void NameGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectSourceParameter^>(info.This())) {
        return;
      }

      CompositionEffectSourceParameter *wrapper = CompositionEffectSourceParameter::Unwrap<CompositionEffectSourceParameter>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Name;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionEffectSourceParameter^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionEffectSourceParameter(::Windows::UI::Composition::CompositionEffectSourceParameter^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionEffectSourceParameter^ UnwrapCompositionEffectSourceParameter(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionEffectSourceParameter::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionEffectSourceParameter(::Windows::UI::Composition::CompositionEffectSourceParameter^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionEffectSourceParameter::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionEffectSourceParameter^ UnwrapCompositionEffectSourceParameter(Local<Value> value) {
     return CompositionEffectSourceParameter::Unwrap<CompositionEffectSourceParameter>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionEffectSourceParameter(Local<Object> exports) {
    CompositionEffectSourceParameter::Init(exports);
  }

  class CompositionGraphicsDevice : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionGraphicsDevice").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "createDrawingSurface", CreateDrawingSurface);
          


          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);

          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionGraphicsDevice").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionGraphicsDevice(::Windows::UI::Composition::CompositionGraphicsDevice^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionGraphicsDevice^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionGraphicsDevice^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionGraphicsDevice^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionGraphicsDevice *wrapperInstance = new CompositionGraphicsDevice(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionGraphicsDevice^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionGraphicsDevice^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionGraphicsDevice^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionGraphicsDevice(winRtInstance));
    }


    static void CreateDrawingSurface(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionGraphicsDevice^>(info.This())) {
        return;
      }

      CompositionGraphicsDevice *wrapper = CompositionGraphicsDevice::Unwrap<CompositionGraphicsDevice>(info.This());

      if (info.Length() == 3
        && NodeRT::Utils::IsSize(info[0])
        && info[1]->IsInt32()
        && info[2]->IsInt32())
      {
        try
        {
          ::Windows::Foundation::Size arg0 = NodeRT::Utils::SizeFromJs(info[0]);
          ::Windows::Graphics::DirectX::DirectXPixelFormat arg1 = static_cast<::Windows::Graphics::DirectX::DirectXPixelFormat>(Nan::To<int32_t>(info[1]).FromMaybe(0));
          ::Windows::Graphics::DirectX::DirectXAlphaMode arg2 = static_cast<::Windows::Graphics::DirectX::DirectXAlphaMode>(Nan::To<int32_t>(info[2]).FromMaybe(0));
          
          ::Windows::UI::Composition::CompositionDrawingSurface^ result;
          result = wrapper->_instance->CreateDrawingSurface(arg0, arg1, arg2);
          info.GetReturnValue().Set(WrapCompositionDrawingSurface(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"renderingDeviceReplaced", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionGraphicsDevice^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        CompositionGraphicsDevice *wrapper = CompositionGraphicsDevice::Unwrap<CompositionGraphicsDevice>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->RenderingDeviceReplaced::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Composition::CompositionGraphicsDevice^, ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^>(
            [callbackObjPtr](::Windows::UI::Composition::CompositionGraphicsDevice^ arg0, ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapCompositionGraphicsDevice(arg0);
                  wrappedArg1 = WrapRenderingDeviceReplacedEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"renderingDeviceReplaced", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"renderingDeviceReplaced", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionGraphicsDevice^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          CompositionGraphicsDevice *wrapper = CompositionGraphicsDevice::Unwrap<CompositionGraphicsDevice>(info.This());
          wrapper->_instance->RenderingDeviceReplaced::remove(registrationToken);
        }
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
    private:
      ::Windows::UI::Composition::CompositionGraphicsDevice^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionGraphicsDevice(::Windows::UI::Composition::CompositionGraphicsDevice^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionGraphicsDevice^ UnwrapCompositionGraphicsDevice(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionGraphicsDevice::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionGraphicsDevice(::Windows::UI::Composition::CompositionGraphicsDevice^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionGraphicsDevice::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionGraphicsDevice^ UnwrapCompositionGraphicsDevice(Local<Value> value) {
     return CompositionGraphicsDevice::Unwrap<CompositionGraphicsDevice>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionGraphicsDevice(Local<Object> exports) {
    CompositionGraphicsDevice::Init(exports);
  }

  class Compositor : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Compositor").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "createColorKeyFrameAnimation", CreateColorKeyFrameAnimation);
            Nan::SetPrototypeMethod(localRef, "createColorBrush", CreateColorBrush);
            Nan::SetPrototypeMethod(localRef, "createContainerVisual", CreateContainerVisual);
            Nan::SetPrototypeMethod(localRef, "createCubicBezierEasingFunction", CreateCubicBezierEasingFunction);
            Nan::SetPrototypeMethod(localRef, "createEffectFactory", CreateEffectFactory);
            Nan::SetPrototypeMethod(localRef, "createExpressionAnimation", CreateExpressionAnimation);
            Nan::SetPrototypeMethod(localRef, "createInsetClip", CreateInsetClip);
            Nan::SetPrototypeMethod(localRef, "createLinearEasingFunction", CreateLinearEasingFunction);
            Nan::SetPrototypeMethod(localRef, "createPropertySet", CreatePropertySet);
            Nan::SetPrototypeMethod(localRef, "createQuaternionKeyFrameAnimation", CreateQuaternionKeyFrameAnimation);
            Nan::SetPrototypeMethod(localRef, "createScalarKeyFrameAnimation", CreateScalarKeyFrameAnimation);
            Nan::SetPrototypeMethod(localRef, "createScopedBatch", CreateScopedBatch);
            Nan::SetPrototypeMethod(localRef, "createSpriteVisual", CreateSpriteVisual);
            Nan::SetPrototypeMethod(localRef, "createSurfaceBrush", CreateSurfaceBrush);
            Nan::SetPrototypeMethod(localRef, "createTargetForCurrentView", CreateTargetForCurrentView);
            Nan::SetPrototypeMethod(localRef, "createVector2KeyFrameAnimation", CreateVector2KeyFrameAnimation);
            Nan::SetPrototypeMethod(localRef, "createVector3KeyFrameAnimation", CreateVector3KeyFrameAnimation);
            Nan::SetPrototypeMethod(localRef, "createVector4KeyFrameAnimation", CreateVector4KeyFrameAnimation);
            Nan::SetPrototypeMethod(localRef, "getCommitBatch", GetCommitBatch);
            Nan::SetPrototypeMethod(localRef, "close", Close);
            Nan::SetPrototypeMethod(localRef, "createAmbientLight", CreateAmbientLight);
            Nan::SetPrototypeMethod(localRef, "createAnimationGroup", CreateAnimationGroup);
            Nan::SetPrototypeMethod(localRef, "createBackdropBrush", CreateBackdropBrush);
            Nan::SetPrototypeMethod(localRef, "createDistantLight", CreateDistantLight);
            Nan::SetPrototypeMethod(localRef, "createDropShadow", CreateDropShadow);
            Nan::SetPrototypeMethod(localRef, "createImplicitAnimationCollection", CreateImplicitAnimationCollection);
            Nan::SetPrototypeMethod(localRef, "createLayerVisual", CreateLayerVisual);
            Nan::SetPrototypeMethod(localRef, "createMaskBrush", CreateMaskBrush);
            Nan::SetPrototypeMethod(localRef, "createNineGridBrush", CreateNineGridBrush);
            Nan::SetPrototypeMethod(localRef, "createPointLight", CreatePointLight);
            Nan::SetPrototypeMethod(localRef, "createSpotLight", CreateSpotLight);
            Nan::SetPrototypeMethod(localRef, "createStepEasingFunction", CreateStepEasingFunction);
          




        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("Compositor").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Compositor(::Windows::UI::Composition::Compositor^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Compositor^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Compositor^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::UI::Composition::Compositor();
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Compositor *wrapperInstance = new Compositor(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Compositor^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Compositor^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositor(winRtInstance));
    }


    static void CreateColorKeyFrameAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::ColorKeyFrameAnimation^ result;
          result = wrapper->_instance->CreateColorKeyFrameAnimation();
          info.GetReturnValue().Set(WrapColorKeyFrameAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateColorBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionColorBrush^ result;
          result = wrapper->_instance->CreateColorBrush();
          info.GetReturnValue().Set(WrapCompositionColorBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && NodeRT::Utils::IsColor(info[0]))
      {
        try
        {
          ::Windows::UI::Color arg0 = NodeRT::Utils::ColorFromJs(info[0]);
          
          ::Windows::UI::Composition::CompositionColorBrush^ result;
          result = wrapper->_instance->CreateColorBrush(arg0);
          info.GetReturnValue().Set(WrapCompositionColorBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateContainerVisual(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::ContainerVisual^ result;
          result = wrapper->_instance->CreateContainerVisual();
          info.GetReturnValue().Set(WrapContainerVisual(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateCubicBezierEasingFunction(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 2
        && IsVector2JsObject(info[0])
        && IsVector2JsObject(info[1]))
      {
        try
        {
          ::Platform::Numerics::Vector2 arg0 = Vector2FromJsObject(info[0]);
          ::Platform::Numerics::Vector2 arg1 = Vector2FromJsObject(info[1]);
          
          ::Windows::UI::Composition::CubicBezierEasingFunction^ result;
          result = wrapper->_instance->CreateCubicBezierEasingFunction(arg0, arg1);
          info.GetReturnValue().Set(WrapCubicBezierEasingFunction(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateEffectFactory(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Graphics::Effects::IGraphicsEffect^>(info[0]))
      {
        try
        {
          ::Windows::Graphics::Effects::IGraphicsEffect^ arg0 = dynamic_cast<::Windows::Graphics::Effects::IGraphicsEffect^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          ::Windows::UI::Composition::CompositionEffectFactory^ result;
          result = wrapper->_instance->CreateEffectFactory(arg0);
          info.GetReturnValue().Set(WrapCompositionEffectFactory(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Graphics::Effects::IGraphicsEffect^>(info[0])
        && (NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Collections::IIterable<::Platform::String^>^>(info[1]) || info[1]->IsArray()))
      {
        try
        {
          ::Windows::Graphics::Effects::IGraphicsEffect^ arg0 = dynamic_cast<::Windows::Graphics::Effects::IGraphicsEffect^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Windows::Foundation::Collections::IIterable<::Platform::String^>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Windows::Foundation::Collections::IIterable<::Platform::String^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtVector<::Platform::String^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return (!NodeRT::Utils::IsWinRtWrapper(value));
                 },
                 [](Local<Value> value) -> ::Platform::String^ {
                   return ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Windows::Foundation::Collections::IIterable<::Platform::String^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          ::Windows::UI::Composition::CompositionEffectFactory^ result;
          result = wrapper->_instance->CreateEffectFactory(arg0, arg1);
          info.GetReturnValue().Set(WrapCompositionEffectFactory(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateExpressionAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::ExpressionAnimation^ result;
          result = wrapper->_instance->CreateExpressionAnimation();
          info.GetReturnValue().Set(WrapExpressionAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          ::Windows::UI::Composition::ExpressionAnimation^ result;
          result = wrapper->_instance->CreateExpressionAnimation(arg0);
          info.GetReturnValue().Set(WrapExpressionAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateInsetClip(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::InsetClip^ result;
          result = wrapper->_instance->CreateInsetClip();
          info.GetReturnValue().Set(WrapInsetClip(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 4
        && info[0]->IsNumber()
        && info[1]->IsNumber()
        && info[2]->IsNumber()
        && info[3]->IsNumber())
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          float arg1 = static_cast<float>(Nan::To<double>(info[1]).FromMaybe(0.0));
          float arg2 = static_cast<float>(Nan::To<double>(info[2]).FromMaybe(0.0));
          float arg3 = static_cast<float>(Nan::To<double>(info[3]).FromMaybe(0.0));
          
          ::Windows::UI::Composition::InsetClip^ result;
          result = wrapper->_instance->CreateInsetClip(arg0, arg1, arg2, arg3);
          info.GetReturnValue().Set(WrapInsetClip(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateLinearEasingFunction(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::LinearEasingFunction^ result;
          result = wrapper->_instance->CreateLinearEasingFunction();
          info.GetReturnValue().Set(WrapLinearEasingFunction(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreatePropertySet(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionPropertySet^ result;
          result = wrapper->_instance->CreatePropertySet();
          info.GetReturnValue().Set(WrapCompositionPropertySet(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateQuaternionKeyFrameAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::QuaternionKeyFrameAnimation^ result;
          result = wrapper->_instance->CreateQuaternionKeyFrameAnimation();
          info.GetReturnValue().Set(WrapQuaternionKeyFrameAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateScalarKeyFrameAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::ScalarKeyFrameAnimation^ result;
          result = wrapper->_instance->CreateScalarKeyFrameAnimation();
          info.GetReturnValue().Set(WrapScalarKeyFrameAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateScopedBatch(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 1
        && info[0]->IsInt32())
      {
        try
        {
          ::Windows::UI::Composition::CompositionBatchTypes arg0 = static_cast<::Windows::UI::Composition::CompositionBatchTypes>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Composition::CompositionScopedBatch^ result;
          result = wrapper->_instance->CreateScopedBatch(arg0);
          info.GetReturnValue().Set(WrapCompositionScopedBatch(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateSpriteVisual(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::SpriteVisual^ result;
          result = wrapper->_instance->CreateSpriteVisual();
          info.GetReturnValue().Set(WrapSpriteVisual(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateSurfaceBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionSurfaceBrush^ result;
          result = wrapper->_instance->CreateSurfaceBrush();
          info.GetReturnValue().Set(WrapCompositionSurfaceBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionSurface^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::ICompositionSurface^ arg0 = UnwrapICompositionSurface(info[0]);
          
          ::Windows::UI::Composition::CompositionSurfaceBrush^ result;
          result = wrapper->_instance->CreateSurfaceBrush(arg0);
          info.GetReturnValue().Set(WrapCompositionSurfaceBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateTargetForCurrentView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionTarget^ result;
          result = wrapper->_instance->CreateTargetForCurrentView();
          info.GetReturnValue().Set(WrapCompositionTarget(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateVector2KeyFrameAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::Vector2KeyFrameAnimation^ result;
          result = wrapper->_instance->CreateVector2KeyFrameAnimation();
          info.GetReturnValue().Set(WrapVector2KeyFrameAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateVector3KeyFrameAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::Vector3KeyFrameAnimation^ result;
          result = wrapper->_instance->CreateVector3KeyFrameAnimation();
          info.GetReturnValue().Set(WrapVector3KeyFrameAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateVector4KeyFrameAnimation(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::Vector4KeyFrameAnimation^ result;
          result = wrapper->_instance->CreateVector4KeyFrameAnimation();
          info.GetReturnValue().Set(WrapVector4KeyFrameAnimation(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetCommitBatch(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 1
        && info[0]->IsInt32())
      {
        try
        {
          ::Windows::UI::Composition::CompositionBatchTypes arg0 = static_cast<::Windows::UI::Composition::CompositionBatchTypes>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Composition::CompositionCommitBatch^ result;
          result = wrapper->_instance->GetCommitBatch(arg0);
          info.GetReturnValue().Set(WrapCompositionCommitBatch(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void Close(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0) {
        try {
          delete wrapper->_instance;
          wrapper->_instance = nullptr;
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      } else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateAmbientLight(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::AmbientLight^ result;
          result = wrapper->_instance->CreateAmbientLight();
          info.GetReturnValue().Set(WrapAmbientLight(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateAnimationGroup(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionAnimationGroup^ result;
          result = wrapper->_instance->CreateAnimationGroup();
          info.GetReturnValue().Set(WrapCompositionAnimationGroup(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateBackdropBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionBackdropBrush^ result;
          result = wrapper->_instance->CreateBackdropBrush();
          info.GetReturnValue().Set(WrapCompositionBackdropBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateDistantLight(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::DistantLight^ result;
          result = wrapper->_instance->CreateDistantLight();
          info.GetReturnValue().Set(WrapDistantLight(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateDropShadow(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::DropShadow^ result;
          result = wrapper->_instance->CreateDropShadow();
          info.GetReturnValue().Set(WrapDropShadow(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateImplicitAnimationCollection(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::ImplicitAnimationCollection^ result;
          result = wrapper->_instance->CreateImplicitAnimationCollection();
          info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateLayerVisual(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::LayerVisual^ result;
          result = wrapper->_instance->CreateLayerVisual();
          info.GetReturnValue().Set(WrapLayerVisual(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateMaskBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionMaskBrush^ result;
          result = wrapper->_instance->CreateMaskBrush();
          info.GetReturnValue().Set(WrapCompositionMaskBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateNineGridBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionNineGridBrush^ result;
          result = wrapper->_instance->CreateNineGridBrush();
          info.GetReturnValue().Set(WrapCompositionNineGridBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreatePointLight(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::PointLight^ result;
          result = wrapper->_instance->CreatePointLight();
          info.GetReturnValue().Set(WrapPointLight(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateSpotLight(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::SpotLight^ result;
          result = wrapper->_instance->CreateSpotLight();
          info.GetReturnValue().Set(WrapSpotLight(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void CreateStepEasingFunction(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Compositor^>(info.This())) {
        return;
      }

      Compositor *wrapper = Compositor::Unwrap<Compositor>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::StepEasingFunction^ result;
          result = wrapper->_instance->CreateStepEasingFunction();
          info.GetReturnValue().Set(WrapStepEasingFunction(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 1
        && info[0]->IsInt32())
      {
        try
        {
          int arg0 = static_cast<int>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          ::Windows::UI::Composition::StepEasingFunction^ result;
          result = wrapper->_instance->CreateStepEasingFunction(arg0);
          info.GetReturnValue().Set(WrapStepEasingFunction(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





    private:
      ::Windows::UI::Composition::Compositor^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositor(::Windows::UI::Composition::Compositor^ wintRtInstance);
      friend ::Windows::UI::Composition::Compositor^ UnwrapCompositor(Local<Value> value);
  };

  Persistent<FunctionTemplate> Compositor::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositor(::Windows::UI::Composition::Compositor^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Compositor::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Compositor^ UnwrapCompositor(Local<Value> value) {
     return Compositor::Unwrap<Compositor>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositor(Local<Object> exports) {
    Compositor::Init(exports);
  }

  class CompositionPropertySet : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionPropertySet").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertColor", InsertColor);
            Nan::SetPrototypeMethod(localRef, "insertMatrix3x2", InsertMatrix3x2);
            Nan::SetPrototypeMethod(localRef, "insertMatrix4x4", InsertMatrix4x4);
            Nan::SetPrototypeMethod(localRef, "insertQuaternion", InsertQuaternion);
            Nan::SetPrototypeMethod(localRef, "insertScalar", InsertScalar);
            Nan::SetPrototypeMethod(localRef, "insertVector2", InsertVector2);
            Nan::SetPrototypeMethod(localRef, "insertVector3", InsertVector3);
            Nan::SetPrototypeMethod(localRef, "insertVector4", InsertVector4);
            Nan::SetPrototypeMethod(localRef, "tryGetColor", TryGetColor);
            Nan::SetPrototypeMethod(localRef, "tryGetMatrix3x2", TryGetMatrix3x2);
            Nan::SetPrototypeMethod(localRef, "tryGetMatrix4x4", TryGetMatrix4x4);
            Nan::SetPrototypeMethod(localRef, "tryGetQuaternion", TryGetQuaternion);
            Nan::SetPrototypeMethod(localRef, "tryGetScalar", TryGetScalar);
            Nan::SetPrototypeMethod(localRef, "tryGetVector2", TryGetVector2);
            Nan::SetPrototypeMethod(localRef, "tryGetVector3", TryGetVector3);
            Nan::SetPrototypeMethod(localRef, "tryGetVector4", TryGetVector4);
            Nan::SetPrototypeMethod(localRef, "insertBoolean", InsertBoolean);
            Nan::SetPrototypeMethod(localRef, "tryGetBoolean", TryGetBoolean);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionPropertySet").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionPropertySet(::Windows::UI::Composition::CompositionPropertySet^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionPropertySet^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionPropertySet^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionPropertySet *wrapperInstance = new CompositionPropertySet(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionPropertySet^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionPropertySet^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionPropertySet(winRtInstance));
    }


    static void InsertColor(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsColor(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Color arg1 = NodeRT::Utils::ColorFromJs(info[1]);
          
          wrapper->_instance->InsertColor(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertMatrix3x2(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsMatrix3x2JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Matrix3x2 arg1 = Matrix3x2FromJsObject(info[1]);
          
          wrapper->_instance->InsertMatrix3x2(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertMatrix4x4(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsMatrix4x4JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Matrix4x4 arg1 = Matrix4x4FromJsObject(info[1]);
          
          wrapper->_instance->InsertMatrix4x4(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertQuaternion(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsQuaternionJsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Quaternion arg1 = QuaternionFromJsObject(info[1]);
          
          wrapper->_instance->InsertQuaternion(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertScalar(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && info[1]->IsNumber())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          float arg1 = static_cast<float>(Nan::To<double>(info[1]).FromMaybe(0.0));
          
          wrapper->_instance->InsertScalar(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertVector2(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsVector2JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector2 arg1 = Vector2FromJsObject(info[1]);
          
          wrapper->_instance->InsertVector2(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertVector3(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsVector3JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector3 arg1 = Vector3FromJsObject(info[1]);
          
          wrapper->_instance->InsertVector3(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertVector4(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && IsVector4JsObject(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector4 arg1 = Vector4FromJsObject(info[1]);
          
          wrapper->_instance->InsertVector4(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetColor(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Color arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetColor(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), NodeRT::Utils::ColorToJs(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetMatrix3x2(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Matrix3x2 arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetMatrix3x2(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), Matrix3x2ToJsObject(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetMatrix4x4(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Matrix4x4 arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetMatrix4x4(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), Matrix4x4ToJsObject(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetQuaternion(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Quaternion arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetQuaternion(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), QuaternionToJsObject(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetScalar(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          float arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetScalar(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), Nan::New<Number>(static_cast<double>(arg1)));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetVector2(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector2 arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetVector2(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), Vector2ToJsObject(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetVector3(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector3 arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetVector3(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), Vector3ToJsObject(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetVector4(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Platform::Numerics::Vector4 arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetVector4(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), Vector4ToJsObject(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertBoolean(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && info[1]->IsBoolean())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          bool arg1 = Nan::To<bool>(info[1]).FromMaybe(false);
          
          wrapper->_instance->InsertBoolean(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void TryGetBoolean(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionPropertySet^>(info.This())) {
        return;
      }

      CompositionPropertySet *wrapper = CompositionPropertySet::Unwrap<CompositionPropertySet>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          bool arg1;
          
          ::Windows::UI::Composition::CompositionGetValueStatus result;
          result = wrapper->_instance->TryGetBoolean(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("compositionGetValueStatus").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(result)));
          Nan::Set(resObj, Nan::New<String>("value").ToLocalChecked(), Nan::New<Boolean>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionPropertySet^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionPropertySet(::Windows::UI::Composition::CompositionPropertySet^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionPropertySet^ UnwrapCompositionPropertySet(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionPropertySet::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionPropertySet(::Windows::UI::Composition::CompositionPropertySet^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionPropertySet::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionPropertySet^ UnwrapCompositionPropertySet(Local<Value> value) {
     return CompositionPropertySet::Unwrap<CompositionPropertySet>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionPropertySet(Local<Object> exports) {
    CompositionPropertySet::Init(exports);
  }

  class ICompositionSurface : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ICompositionSurface").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);






        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ICompositionSurface").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ICompositionSurface(::Windows::UI::Composition::ICompositionSurface^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::ICompositionSurface^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionSurface^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::ICompositionSurface^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ICompositionSurface *wrapperInstance = new ICompositionSurface(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionSurface^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::ICompositionSurface^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::ICompositionSurface^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapICompositionSurface(winRtInstance));
    }







    private:
      ::Windows::UI::Composition::ICompositionSurface^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapICompositionSurface(::Windows::UI::Composition::ICompositionSurface^ wintRtInstance);
      friend ::Windows::UI::Composition::ICompositionSurface^ UnwrapICompositionSurface(Local<Value> value);
  };

  Persistent<FunctionTemplate> ICompositionSurface::s_constructorTemplate;

  v8::Local<v8::Value> WrapICompositionSurface(::Windows::UI::Composition::ICompositionSurface^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ICompositionSurface::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::ICompositionSurface^ UnwrapICompositionSurface(Local<Value> value) {
     return ICompositionSurface::Unwrap<ICompositionSurface>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitICompositionSurface(Local<Object> exports) {
    ICompositionSurface::Init(exports);
  }

  class CompositionDrawingSurface : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionDrawingSurface").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("alphaMode").ToLocalChecked(), AlphaModeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("pixelFormat").ToLocalChecked(), PixelFormatGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionDrawingSurface").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionDrawingSurface(::Windows::UI::Composition::CompositionDrawingSurface^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionDrawingSurface^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionDrawingSurface^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionDrawingSurface^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionDrawingSurface *wrapperInstance = new CompositionDrawingSurface(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionDrawingSurface^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionDrawingSurface^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionDrawingSurface^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionDrawingSurface(winRtInstance));
    }





    static void AlphaModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionDrawingSurface^>(info.This())) {
        return;
      }

      CompositionDrawingSurface *wrapper = CompositionDrawingSurface::Unwrap<CompositionDrawingSurface>(info.This());

      try  {
        ::Windows::Graphics::DirectX::DirectXAlphaMode result = wrapper->_instance->AlphaMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PixelFormatGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionDrawingSurface^>(info.This())) {
        return;
      }

      CompositionDrawingSurface *wrapper = CompositionDrawingSurface::Unwrap<CompositionDrawingSurface>(info.This());

      try  {
        ::Windows::Graphics::DirectX::DirectXPixelFormat result = wrapper->_instance->PixelFormat;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionDrawingSurface^>(info.This())) {
        return;
      }

      CompositionDrawingSurface *wrapper = CompositionDrawingSurface::Unwrap<CompositionDrawingSurface>(info.This());

      try  {
        ::Windows::Foundation::Size result = wrapper->_instance->Size;
        info.GetReturnValue().Set(NodeRT::Utils::SizeToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionDrawingSurface^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionDrawingSurface(::Windows::UI::Composition::CompositionDrawingSurface^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionDrawingSurface^ UnwrapCompositionDrawingSurface(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionDrawingSurface::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionDrawingSurface(::Windows::UI::Composition::CompositionDrawingSurface^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionDrawingSurface::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionDrawingSurface^ UnwrapCompositionDrawingSurface(Local<Value> value) {
     return CompositionDrawingSurface::Unwrap<CompositionDrawingSurface>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionDrawingSurface(Local<Object> exports) {
    CompositionDrawingSurface::Init(exports);
  }

  class CompositionColorBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionColorBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionColorBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionColorBrush(::Windows::UI::Composition::CompositionColorBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionColorBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionColorBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionColorBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionColorBrush *wrapperInstance = new CompositionColorBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionColorBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionColorBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionColorBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionColorBrush(winRtInstance));
    }





    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionColorBrush^>(info.This())) {
        return;
      }

      CompositionColorBrush *wrapper = CompositionColorBrush::Unwrap<CompositionColorBrush>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionColorBrush^>(info.This())) {
        return;
      }

      CompositionColorBrush *wrapper = CompositionColorBrush::Unwrap<CompositionColorBrush>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionColorBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionColorBrush(::Windows::UI::Composition::CompositionColorBrush^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionColorBrush^ UnwrapCompositionColorBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionColorBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionColorBrush(::Windows::UI::Composition::CompositionColorBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionColorBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionColorBrush^ UnwrapCompositionColorBrush(Local<Value> value) {
     return CompositionColorBrush::Unwrap<CompositionColorBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionColorBrush(Local<Object> exports) {
    CompositionColorBrush::Init(exports);
  }

  class CompositionEffectFactory : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionEffectFactory").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "createBrush", CreateBrush);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("extendedError").ToLocalChecked(), ExtendedErrorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("loadStatus").ToLocalChecked(), LoadStatusGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionEffectFactory").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionEffectFactory(::Windows::UI::Composition::CompositionEffectFactory^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionEffectFactory^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectFactory^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionEffectFactory^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionEffectFactory *wrapperInstance = new CompositionEffectFactory(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectFactory^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionEffectFactory^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionEffectFactory^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionEffectFactory(winRtInstance));
    }


    static void CreateBrush(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectFactory^>(info.This())) {
        return;
      }

      CompositionEffectFactory *wrapper = CompositionEffectFactory::Unwrap<CompositionEffectFactory>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::Composition::CompositionEffectBrush^ result;
          result = wrapper->_instance->CreateBrush();
          info.GetReturnValue().Set(WrapCompositionEffectBrush(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void ExtendedErrorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectFactory^>(info.This())) {
        return;
      }

      CompositionEffectFactory *wrapper = CompositionEffectFactory::Unwrap<CompositionEffectFactory>(info.This());

      try  {
        ::Windows::Foundation::HResult result = wrapper->_instance->ExtendedError;
        info.GetReturnValue().Set(Nan::New<Integer>(result.Value));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LoadStatusGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectFactory^>(info.This())) {
        return;
      }

      CompositionEffectFactory *wrapper = CompositionEffectFactory::Unwrap<CompositionEffectFactory>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionEffectFactoryLoadStatus result = wrapper->_instance->LoadStatus;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionEffectFactory^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionEffectFactory(::Windows::UI::Composition::CompositionEffectFactory^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionEffectFactory^ UnwrapCompositionEffectFactory(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionEffectFactory::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionEffectFactory(::Windows::UI::Composition::CompositionEffectFactory^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionEffectFactory::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionEffectFactory^ UnwrapCompositionEffectFactory(Local<Value> value) {
     return CompositionEffectFactory::Unwrap<CompositionEffectFactory>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionEffectFactory(Local<Object> exports) {
    CompositionEffectFactory::Init(exports);
  }

  class CompositionScopedBatch : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionScopedBatch").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "end", End);
            Nan::SetPrototypeMethod(localRef, "resume", Resume);
            Nan::SetPrototypeMethod(localRef, "suspend", Suspend);
          


          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);

          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isActive").ToLocalChecked(), IsActiveGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isEnded").ToLocalChecked(), IsEndedGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionScopedBatch").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionScopedBatch(::Windows::UI::Composition::CompositionScopedBatch^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionScopedBatch^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionScopedBatch^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionScopedBatch *wrapperInstance = new CompositionScopedBatch(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionScopedBatch^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionScopedBatch^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionScopedBatch(winRtInstance));
    }


    static void End(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info.This())) {
        return;
      }

      CompositionScopedBatch *wrapper = CompositionScopedBatch::Unwrap<CompositionScopedBatch>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->End();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Resume(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info.This())) {
        return;
      }

      CompositionScopedBatch *wrapper = CompositionScopedBatch::Unwrap<CompositionScopedBatch>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Resume();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Suspend(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info.This())) {
        return;
      }

      CompositionScopedBatch *wrapper = CompositionScopedBatch::Unwrap<CompositionScopedBatch>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Suspend();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void IsActiveGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info.This())) {
        return;
      }

      CompositionScopedBatch *wrapper = CompositionScopedBatch::Unwrap<CompositionScopedBatch>(info.This());

      try  {
        bool result = wrapper->_instance->IsActive;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsEndedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info.This())) {
        return;
      }

      CompositionScopedBatch *wrapper = CompositionScopedBatch::Unwrap<CompositionScopedBatch>(info.This());

      try  {
        bool result = wrapper->_instance->IsEnded;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"completed", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        CompositionScopedBatch *wrapper = CompositionScopedBatch::Unwrap<CompositionScopedBatch>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Completed::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Platform::Object^, ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^>(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = CreateOpaqueWrapper(arg0);
                  wrappedArg1 = WrapCompositionBatchCompletedEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"completed", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"completed", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionScopedBatch^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          CompositionScopedBatch *wrapper = CompositionScopedBatch::Unwrap<CompositionScopedBatch>(info.This());
          wrapper->_instance->Completed::remove(registrationToken);
        }
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
    private:
      ::Windows::UI::Composition::CompositionScopedBatch^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionScopedBatch(::Windows::UI::Composition::CompositionScopedBatch^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionScopedBatch^ UnwrapCompositionScopedBatch(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionScopedBatch::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionScopedBatch(::Windows::UI::Composition::CompositionScopedBatch^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionScopedBatch::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionScopedBatch^ UnwrapCompositionScopedBatch(Local<Value> value) {
     return CompositionScopedBatch::Unwrap<CompositionScopedBatch>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionScopedBatch(Local<Object> exports) {
    CompositionScopedBatch::Init(exports);
  }

  class CompositionSurfaceBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionSurfaceBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verticalAlignmentRatio").ToLocalChecked(), VerticalAlignmentRatioGetter, VerticalAlignmentRatioSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("surface").ToLocalChecked(), SurfaceGetter, SurfaceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stretch").ToLocalChecked(), StretchGetter, StretchSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("horizontalAlignmentRatio").ToLocalChecked(), HorizontalAlignmentRatioGetter, HorizontalAlignmentRatioSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bitmapInterpolationMode").ToLocalChecked(), BitmapInterpolationModeGetter, BitmapInterpolationModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionSurfaceBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionSurfaceBrush(::Windows::UI::Composition::CompositionSurfaceBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionSurfaceBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionSurfaceBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionSurfaceBrush *wrapperInstance = new CompositionSurfaceBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionSurfaceBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionSurfaceBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionSurfaceBrush(winRtInstance));
    }





    static void VerticalAlignmentRatioGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        float result = wrapper->_instance->VerticalAlignmentRatio;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void VerticalAlignmentRatioSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->VerticalAlignmentRatio = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SurfaceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Windows::UI::Composition::ICompositionSurface^ result = wrapper->_instance->Surface;
        info.GetReturnValue().Set(WrapICompositionSurface(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SurfaceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionSurface^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Windows::UI::Composition::ICompositionSurface^ winRtValue = dynamic_cast<::Windows::UI::Composition::ICompositionSurface^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Surface = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void StretchGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionStretch result = wrapper->_instance->Stretch;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StretchSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Windows::UI::Composition::CompositionStretch winRtValue = static_cast<::Windows::UI::Composition::CompositionStretch>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Stretch = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void HorizontalAlignmentRatioGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        float result = wrapper->_instance->HorizontalAlignmentRatio;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void HorizontalAlignmentRatioSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->HorizontalAlignmentRatio = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BitmapInterpolationModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBitmapInterpolationMode result = wrapper->_instance->BitmapInterpolationMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BitmapInterpolationModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBitmapInterpolationMode winRtValue = static_cast<::Windows::UI::Composition::CompositionBitmapInterpolationMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BitmapInterpolationMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Platform::Numerics::Matrix3x2 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix3x2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix3x2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Platform::Numerics::Matrix3x2 winRtValue = Matrix3x2FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionSurfaceBrush^>(info.This())) {
        return;
      }

      CompositionSurfaceBrush *wrapper = CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionSurfaceBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionSurfaceBrush(::Windows::UI::Composition::CompositionSurfaceBrush^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionSurfaceBrush^ UnwrapCompositionSurfaceBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionSurfaceBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionSurfaceBrush(::Windows::UI::Composition::CompositionSurfaceBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionSurfaceBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionSurfaceBrush^ UnwrapCompositionSurfaceBrush(Local<Value> value) {
     return CompositionSurfaceBrush::Unwrap<CompositionSurfaceBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionSurfaceBrush(Local<Object> exports) {
    CompositionSurfaceBrush::Init(exports);
  }

  class CompositionTarget : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionTarget").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("root").ToLocalChecked(), RootGetter, RootSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionTarget").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionTarget(::Windows::UI::Composition::CompositionTarget^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionTarget^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionTarget^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionTarget^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionTarget *wrapperInstance = new CompositionTarget(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionTarget^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionTarget^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionTarget^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionTarget(winRtInstance));
    }





    static void RootGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionTarget^>(info.This())) {
        return;
      }

      CompositionTarget *wrapper = CompositionTarget::Unwrap<CompositionTarget>(info.This());

      try  {
        ::Windows::UI::Composition::Visual^ result = wrapper->_instance->Root;
        info.GetReturnValue().Set(WrapVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RootSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionTarget^>(info.This())) {
        return;
      }

      CompositionTarget *wrapper = CompositionTarget::Unwrap<CompositionTarget>(info.This());

      try {

        ::Windows::UI::Composition::Visual^ winRtValue = dynamic_cast<::Windows::UI::Composition::Visual^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Root = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionTarget^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionTarget(::Windows::UI::Composition::CompositionTarget^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionTarget^ UnwrapCompositionTarget(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionTarget::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionTarget(::Windows::UI::Composition::CompositionTarget^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionTarget::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionTarget^ UnwrapCompositionTarget(Local<Value> value) {
     return CompositionTarget::Unwrap<CompositionTarget>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionTarget(Local<Object> exports) {
    CompositionTarget::Init(exports);
  }

  class CompositionCommitBatch : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionCommitBatch").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);




          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);

          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isActive").ToLocalChecked(), IsActiveGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isEnded").ToLocalChecked(), IsEndedGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionCommitBatch").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionCommitBatch(::Windows::UI::Composition::CompositionCommitBatch^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionCommitBatch^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionCommitBatch^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionCommitBatch^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionCommitBatch *wrapperInstance = new CompositionCommitBatch(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionCommitBatch^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionCommitBatch^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionCommitBatch^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionCommitBatch(winRtInstance));
    }





    static void IsActiveGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionCommitBatch^>(info.This())) {
        return;
      }

      CompositionCommitBatch *wrapper = CompositionCommitBatch::Unwrap<CompositionCommitBatch>(info.This());

      try  {
        bool result = wrapper->_instance->IsActive;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsEndedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionCommitBatch^>(info.This())) {
        return;
      }

      CompositionCommitBatch *wrapper = CompositionCommitBatch::Unwrap<CompositionCommitBatch>(info.This());

      try  {
        bool result = wrapper->_instance->IsEnded;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"completed", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionCommitBatch^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
      return;
        }
        CompositionCommitBatch *wrapper = CompositionCommitBatch::Unwrap<CompositionCommitBatch>(info.This());
      
        try {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr,
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Completed::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Platform::Object^, ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^>(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::UI::Composition::CompositionBatchCompletedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = CreateOpaqueWrapper(arg0);
                  wrappedArg1 = WrapCompositionBatchCompletedEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"completed", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"completed", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionCommitBatch^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          CompositionCommitBatch *wrapper = CompositionCommitBatch::Unwrap<CompositionCommitBatch>(info.This());
          wrapper->_instance->Completed::remove(registrationToken);
        }
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
    private:
      ::Windows::UI::Composition::CompositionCommitBatch^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionCommitBatch(::Windows::UI::Composition::CompositionCommitBatch^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionCommitBatch^ UnwrapCompositionCommitBatch(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionCommitBatch::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionCommitBatch(::Windows::UI::Composition::CompositionCommitBatch^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionCommitBatch::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionCommitBatch^ UnwrapCompositionCommitBatch(Local<Value> value) {
     return CompositionCommitBatch::Unwrap<CompositionCommitBatch>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionCommitBatch(Local<Object> exports) {
    CompositionCommitBatch::Init(exports);
  }

  class CompositionAnimationGroup : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionAnimationGroup").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "add", Add);
            Nan::SetPrototypeMethod(localRef, "remove", Remove);
            Nan::SetPrototypeMethod(localRef, "removeAll", RemoveAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("count").ToLocalChecked(), CountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionAnimationGroup").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionAnimationGroup(::Windows::UI::Composition::CompositionAnimationGroup^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionAnimationGroup^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimationGroup^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionAnimationGroup^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionAnimationGroup *wrapperInstance = new CompositionAnimationGroup(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimationGroup^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionAnimationGroup^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionAnimationGroup^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionAnimationGroup(winRtInstance));
    }


    static void Add(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimationGroup^>(info.This())) {
        return;
      }

      CompositionAnimationGroup *wrapper = CompositionAnimationGroup::Unwrap<CompositionAnimationGroup>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::CompositionAnimation^ arg0 = UnwrapCompositionAnimation(info[0]);
          
          wrapper->_instance->Add(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Remove(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimationGroup^>(info.This())) {
        return;
      }

      CompositionAnimationGroup *wrapper = CompositionAnimationGroup::Unwrap<CompositionAnimationGroup>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::CompositionAnimation^ arg0 = UnwrapCompositionAnimation(info[0]);
          
          wrapper->_instance->Remove(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimationGroup^>(info.This())) {
        return;
      }

      CompositionAnimationGroup *wrapper = CompositionAnimationGroup::Unwrap<CompositionAnimationGroup>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAll();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimationGroup^>(info.This())) {
        return;
      }

      CompositionAnimationGroup *wrapper = CompositionAnimationGroup::Unwrap<CompositionAnimationGroup>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Composition::CompositionAnimation^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Composition::CompositionAnimation^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Composition::CompositionAnimation^ val) -> Local<Value> {
              return WrapCompositionAnimation(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimationGroup^>(info.This())) {
        return;
      }

      CompositionAnimationGroup *wrapper = CompositionAnimationGroup::Unwrap<CompositionAnimationGroup>(info.This());

      try  {
        int result = wrapper->_instance->Count;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionAnimationGroup^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionAnimationGroup(::Windows::UI::Composition::CompositionAnimationGroup^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionAnimationGroup^ UnwrapCompositionAnimationGroup(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionAnimationGroup::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionAnimationGroup(::Windows::UI::Composition::CompositionAnimationGroup^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionAnimationGroup::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionAnimationGroup^ UnwrapCompositionAnimationGroup(Local<Value> value) {
     return CompositionAnimationGroup::Unwrap<CompositionAnimationGroup>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionAnimationGroup(Local<Object> exports) {
    CompositionAnimationGroup::Init(exports);
  }

  class CompositionBackdropBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionBackdropBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionBackdropBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionBackdropBrush(::Windows::UI::Composition::CompositionBackdropBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionBackdropBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBackdropBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionBackdropBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionBackdropBrush *wrapperInstance = new CompositionBackdropBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBackdropBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionBackdropBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionBackdropBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionBackdropBrush(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionBackdropBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionBackdropBrush(::Windows::UI::Composition::CompositionBackdropBrush^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionBackdropBrush^ UnwrapCompositionBackdropBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionBackdropBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionBackdropBrush(::Windows::UI::Composition::CompositionBackdropBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionBackdropBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionBackdropBrush^ UnwrapCompositionBackdropBrush(Local<Value> value) {
     return CompositionBackdropBrush::Unwrap<CompositionBackdropBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionBackdropBrush(Local<Object> exports) {
    CompositionBackdropBrush::Init(exports);
  }

  class CompositionMaskBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionMaskBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("source").ToLocalChecked(), SourceGetter, SourceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("mask").ToLocalChecked(), MaskGetter, MaskSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionMaskBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionMaskBrush(::Windows::UI::Composition::CompositionMaskBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionMaskBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionMaskBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionMaskBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionMaskBrush *wrapperInstance = new CompositionMaskBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionMaskBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionMaskBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionMaskBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionMaskBrush(winRtInstance));
    }





    static void SourceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionMaskBrush^>(info.This())) {
        return;
      }

      CompositionMaskBrush *wrapper = CompositionMaskBrush::Unwrap<CompositionMaskBrush>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBrush^ result = wrapper->_instance->Source;
        info.GetReturnValue().Set(WrapCompositionBrush(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SourceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionMaskBrush^>(info.This())) {
        return;
      }

      CompositionMaskBrush *wrapper = CompositionMaskBrush::Unwrap<CompositionMaskBrush>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBrush^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionBrush^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Source = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void MaskGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionMaskBrush^>(info.This())) {
        return;
      }

      CompositionMaskBrush *wrapper = CompositionMaskBrush::Unwrap<CompositionMaskBrush>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBrush^ result = wrapper->_instance->Mask;
        info.GetReturnValue().Set(WrapCompositionBrush(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MaskSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionMaskBrush^>(info.This())) {
        return;
      }

      CompositionMaskBrush *wrapper = CompositionMaskBrush::Unwrap<CompositionMaskBrush>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBrush^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionBrush^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Mask = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionMaskBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionMaskBrush(::Windows::UI::Composition::CompositionMaskBrush^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionMaskBrush^ UnwrapCompositionMaskBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionMaskBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionMaskBrush(::Windows::UI::Composition::CompositionMaskBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionMaskBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionMaskBrush^ UnwrapCompositionMaskBrush(Local<Value> value) {
     return CompositionMaskBrush::Unwrap<CompositionMaskBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionMaskBrush(Local<Object> exports) {
    CompositionMaskBrush::Init(exports);
  }

  class CompositionNineGridBrush : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionNineGridBrush").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "setInsets", SetInsets);
            Nan::SetPrototypeMethod(localRef, "setInsetScales", SetInsetScales);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("topInsetScale").ToLocalChecked(), TopInsetScaleGetter, TopInsetScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("topInset").ToLocalChecked(), TopInsetGetter, TopInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("source").ToLocalChecked(), SourceGetter, SourceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rightInsetScale").ToLocalChecked(), RightInsetScaleGetter, RightInsetScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rightInset").ToLocalChecked(), RightInsetGetter, RightInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("leftInsetScale").ToLocalChecked(), LeftInsetScaleGetter, LeftInsetScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("leftInset").ToLocalChecked(), LeftInsetGetter, LeftInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isCenterHollow").ToLocalChecked(), IsCenterHollowGetter, IsCenterHollowSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bottomInsetScale").ToLocalChecked(), BottomInsetScaleGetter, BottomInsetScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bottomInset").ToLocalChecked(), BottomInsetGetter, BottomInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionNineGridBrush").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionNineGridBrush(::Windows::UI::Composition::CompositionNineGridBrush^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionNineGridBrush^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionNineGridBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionNineGridBrush *wrapperInstance = new CompositionNineGridBrush(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionNineGridBrush^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionNineGridBrush^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionNineGridBrush(winRtInstance));
    }


    static void SetInsets(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      if (info.Length() == 1
        && info[0]->IsNumber())
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          
          wrapper->_instance->SetInsets(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 4
        && info[0]->IsNumber()
        && info[1]->IsNumber()
        && info[2]->IsNumber()
        && info[3]->IsNumber())
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          float arg1 = static_cast<float>(Nan::To<double>(info[1]).FromMaybe(0.0));
          float arg2 = static_cast<float>(Nan::To<double>(info[2]).FromMaybe(0.0));
          float arg3 = static_cast<float>(Nan::To<double>(info[3]).FromMaybe(0.0));
          
          wrapper->_instance->SetInsets(arg0, arg1, arg2, arg3);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetInsetScales(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      if (info.Length() == 1
        && info[0]->IsNumber())
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          
          wrapper->_instance->SetInsetScales(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 4
        && info[0]->IsNumber()
        && info[1]->IsNumber()
        && info[2]->IsNumber()
        && info[3]->IsNumber())
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          float arg1 = static_cast<float>(Nan::To<double>(info[1]).FromMaybe(0.0));
          float arg2 = static_cast<float>(Nan::To<double>(info[2]).FromMaybe(0.0));
          float arg3 = static_cast<float>(Nan::To<double>(info[3]).FromMaybe(0.0));
          
          wrapper->_instance->SetInsetScales(arg0, arg1, arg2, arg3);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void TopInsetScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->TopInsetScale;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TopInsetScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->TopInsetScale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TopInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->TopInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TopInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->TopInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SourceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBrush^ result = wrapper->_instance->Source;
        info.GetReturnValue().Set(WrapCompositionBrush(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SourceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBrush^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionBrush^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Source = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RightInsetScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->RightInsetScale;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RightInsetScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RightInsetScale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RightInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->RightInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RightInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RightInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LeftInsetScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->LeftInsetScale;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LeftInsetScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->LeftInsetScale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LeftInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->LeftInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LeftInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->LeftInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsCenterHollowGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        bool result = wrapper->_instance->IsCenterHollow;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsCenterHollowSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsCenterHollow = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BottomInsetScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->BottomInsetScale;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BottomInsetScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->BottomInsetScale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BottomInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try  {
        float result = wrapper->_instance->BottomInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BottomInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionNineGridBrush^>(info.This())) {
        return;
      }

      CompositionNineGridBrush *wrapper = CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->BottomInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionNineGridBrush^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionNineGridBrush(::Windows::UI::Composition::CompositionNineGridBrush^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionNineGridBrush^ UnwrapCompositionNineGridBrush(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionNineGridBrush::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionNineGridBrush(::Windows::UI::Composition::CompositionNineGridBrush^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionNineGridBrush::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionNineGridBrush^ UnwrapCompositionNineGridBrush(Local<Value> value) {
     return CompositionNineGridBrush::Unwrap<CompositionNineGridBrush>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionNineGridBrush(Local<Object> exports) {
    CompositionNineGridBrush::Init(exports);
  }

  class CubicBezierEasingFunction : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CubicBezierEasingFunction").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("controlPoint1").ToLocalChecked(), ControlPoint1Getter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("controlPoint2").ToLocalChecked(), ControlPoint2Getter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CubicBezierEasingFunction").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CubicBezierEasingFunction(::Windows::UI::Composition::CubicBezierEasingFunction^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CubicBezierEasingFunction^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CubicBezierEasingFunction^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CubicBezierEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CubicBezierEasingFunction *wrapperInstance = new CubicBezierEasingFunction(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CubicBezierEasingFunction^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CubicBezierEasingFunction^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CubicBezierEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCubicBezierEasingFunction(winRtInstance));
    }





    static void ControlPoint1Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CubicBezierEasingFunction^>(info.This())) {
        return;
      }

      CubicBezierEasingFunction *wrapper = CubicBezierEasingFunction::Unwrap<CubicBezierEasingFunction>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->ControlPoint1;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ControlPoint2Getter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CubicBezierEasingFunction^>(info.This())) {
        return;
      }

      CubicBezierEasingFunction *wrapper = CubicBezierEasingFunction::Unwrap<CubicBezierEasingFunction>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->ControlPoint2;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CubicBezierEasingFunction^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCubicBezierEasingFunction(::Windows::UI::Composition::CubicBezierEasingFunction^ wintRtInstance);
      friend ::Windows::UI::Composition::CubicBezierEasingFunction^ UnwrapCubicBezierEasingFunction(Local<Value> value);
  };

  Persistent<FunctionTemplate> CubicBezierEasingFunction::s_constructorTemplate;

  v8::Local<v8::Value> WrapCubicBezierEasingFunction(::Windows::UI::Composition::CubicBezierEasingFunction^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CubicBezierEasingFunction::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CubicBezierEasingFunction^ UnwrapCubicBezierEasingFunction(Local<Value> value) {
     return CubicBezierEasingFunction::Unwrap<CubicBezierEasingFunction>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCubicBezierEasingFunction(Local<Object> exports) {
    CubicBezierEasingFunction::Init(exports);
  }

  class ExpressionAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ExpressionAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("expression").ToLocalChecked(), ExpressionGetter, ExpressionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ExpressionAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ExpressionAnimation(::Windows::UI::Composition::ExpressionAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::ExpressionAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ExpressionAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::ExpressionAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ExpressionAnimation *wrapperInstance = new ExpressionAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ExpressionAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::ExpressionAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::ExpressionAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapExpressionAnimation(winRtInstance));
    }





    static void ExpressionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ExpressionAnimation^>(info.This())) {
        return;
      }

      ExpressionAnimation *wrapper = ExpressionAnimation::Unwrap<ExpressionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Expression;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ExpressionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ExpressionAnimation^>(info.This())) {
        return;
      }

      ExpressionAnimation *wrapper = ExpressionAnimation::Unwrap<ExpressionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Expression = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::ExpressionAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapExpressionAnimation(::Windows::UI::Composition::ExpressionAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::ExpressionAnimation^ UnwrapExpressionAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> ExpressionAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapExpressionAnimation(::Windows::UI::Composition::ExpressionAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ExpressionAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::ExpressionAnimation^ UnwrapExpressionAnimation(Local<Value> value) {
     return ExpressionAnimation::Unwrap<ExpressionAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitExpressionAnimation(Local<Object> exports) {
    ExpressionAnimation::Init(exports);
  }

  class ImplicitAnimationCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ImplicitAnimationCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "lookup", Lookup);
            Nan::SetPrototypeMethod(localRef, "hasKey", HasKey);
            Nan::SetPrototypeMethod(localRef, "getView", GetView);
            Nan::SetPrototypeMethod(localRef, "insert", Insert);
            Nan::SetPrototypeMethod(localRef, "remove", Remove);
            Nan::SetPrototypeMethod(localRef, "clear", Clear);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ImplicitAnimationCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ImplicitAnimationCollection(::Windows::UI::Composition::ImplicitAnimationCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::ImplicitAnimationCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ImplicitAnimationCollection *wrapperInstance = new ImplicitAnimationCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::ImplicitAnimationCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapImplicitAnimationCollection(winRtInstance));
    }


    static void Lookup(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info.This())) {
        return;
      }

      ImplicitAnimationCollection *wrapper = ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          ::Windows::UI::Composition::ICompositionAnimationBase^ result;
          result = wrapper->_instance->Lookup(arg0);
          info.GetReturnValue().Set(WrapICompositionAnimationBase(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void HasKey(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info.This())) {
        return;
      }

      ImplicitAnimationCollection *wrapper = ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          bool result;
          result = wrapper->_instance->HasKey(arg0);
          info.GetReturnValue().Set(Nan::New<Boolean>(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetView(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info.This())) {
        return;
      }

      ImplicitAnimationCollection *wrapper = ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IMapView<::Platform::String^, ::Windows::UI::Composition::ICompositionAnimationBase^>^ result;
          result = wrapper->_instance->GetView();
          info.GetReturnValue().Set(NodeRT::Collections::MapViewWrapper<::Platform::String^,::Windows::UI::Composition::ICompositionAnimationBase^>::CreateMapViewWrapper(result, 
            [](::Platform::String^ val) -> Local<Value> {
              return NodeRT::Utils::NewString(val->Data());
            },
            [](Local<Value> value) -> bool {
              return value->IsString();
            },
            [](Local<Value> value) -> ::Platform::String^ {
              return ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));
            },
            [](::Windows::UI::Composition::ICompositionAnimationBase^ val) -> Local<Value> {
              return WrapICompositionAnimationBase(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Insert(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info.This())) {
        return;
      }

      ImplicitAnimationCollection *wrapper = ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(info.This());

      if (info.Length() == 2
        && info[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ICompositionAnimationBase^>(info[1]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          ::Windows::UI::Composition::ICompositionAnimationBase^ arg1 = UnwrapICompositionAnimationBase(info[1]);
          
          bool result;
          result = wrapper->_instance->Insert(arg0, arg1);
          info.GetReturnValue().Set(Nan::New<Boolean>(result));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Remove(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info.This())) {
        return;
      }

      ImplicitAnimationCollection *wrapper = ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[0])));
          
          wrapper->_instance->Remove(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Clear(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info.This())) {
        return;
      }

      ImplicitAnimationCollection *wrapper = ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Clear();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(info.This())) {
        return;
      }

      ImplicitAnimationCollection *wrapper = ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::Foundation::Collections::IKeyValuePair<::Platform::String^, ::Windows::UI::Composition::ICompositionAnimationBase^>^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::Foundation::Collections::IKeyValuePair<::Platform::String^, ::Windows::UI::Composition::ICompositionAnimationBase^>^>::CreateIteratorWrapper(result, 
            [](::Windows::Foundation::Collections::IKeyValuePair<::Platform::String^, ::Windows::UI::Composition::ICompositionAnimationBase^>^ val) -> Local<Value> {
              return NodeRT::Collections::KeyValuePairWrapper<::Platform::String^,::Windows::UI::Composition::ICompositionAnimationBase^>::CreateKeyValuePairWrapper(val, 
            [](::Platform::String^ val) -> Local<Value> {
              return NodeRT::Utils::NewString(val->Data());
            },
            [](::Windows::UI::Composition::ICompositionAnimationBase^ val) -> Local<Value> {
              return WrapICompositionAnimationBase(val);
            }
          );
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::ImplicitAnimationCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapImplicitAnimationCollection(::Windows::UI::Composition::ImplicitAnimationCollection^ wintRtInstance);
      friend ::Windows::UI::Composition::ImplicitAnimationCollection^ UnwrapImplicitAnimationCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> ImplicitAnimationCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapImplicitAnimationCollection(::Windows::UI::Composition::ImplicitAnimationCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ImplicitAnimationCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::ImplicitAnimationCollection^ UnwrapImplicitAnimationCollection(Local<Value> value) {
     return ImplicitAnimationCollection::Unwrap<ImplicitAnimationCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitImplicitAnimationCollection(Local<Object> exports) {
    ImplicitAnimationCollection::Init(exports);
  }

  class LinearEasingFunction : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("LinearEasingFunction").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LinearEasingFunction").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LinearEasingFunction(::Windows::UI::Composition::LinearEasingFunction^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::LinearEasingFunction^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::LinearEasingFunction^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::LinearEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      LinearEasingFunction *wrapperInstance = new LinearEasingFunction(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::LinearEasingFunction^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::LinearEasingFunction^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::LinearEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLinearEasingFunction(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::LinearEasingFunction^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLinearEasingFunction(::Windows::UI::Composition::LinearEasingFunction^ wintRtInstance);
      friend ::Windows::UI::Composition::LinearEasingFunction^ UnwrapLinearEasingFunction(Local<Value> value);
  };

  Persistent<FunctionTemplate> LinearEasingFunction::s_constructorTemplate;

  v8::Local<v8::Value> WrapLinearEasingFunction(::Windows::UI::Composition::LinearEasingFunction^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(LinearEasingFunction::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::LinearEasingFunction^ UnwrapLinearEasingFunction(Local<Value> value) {
     return LinearEasingFunction::Unwrap<LinearEasingFunction>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLinearEasingFunction(Local<Object> exports) {
    LinearEasingFunction::Init(exports);
  }

  class RenderingDeviceReplacedEventArgs : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("RenderingDeviceReplacedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("graphicsDevice").ToLocalChecked(), GraphicsDeviceGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("RenderingDeviceReplacedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      RenderingDeviceReplacedEventArgs(::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      RenderingDeviceReplacedEventArgs *wrapperInstance = new RenderingDeviceReplacedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapRenderingDeviceReplacedEventArgs(winRtInstance));
    }





    static void GraphicsDeviceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^>(info.This())) {
        return;
      }

      RenderingDeviceReplacedEventArgs *wrapper = RenderingDeviceReplacedEventArgs::Unwrap<RenderingDeviceReplacedEventArgs>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionGraphicsDevice^ result = wrapper->_instance->GraphicsDevice;
        info.GetReturnValue().Set(WrapCompositionGraphicsDevice(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapRenderingDeviceReplacedEventArgs(::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ wintRtInstance);
      friend ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ UnwrapRenderingDeviceReplacedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> RenderingDeviceReplacedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapRenderingDeviceReplacedEventArgs(::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(RenderingDeviceReplacedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::RenderingDeviceReplacedEventArgs^ UnwrapRenderingDeviceReplacedEventArgs(Local<Value> value) {
     return RenderingDeviceReplacedEventArgs::Unwrap<RenderingDeviceReplacedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitRenderingDeviceReplacedEventArgs(Local<Object> exports) {
    RenderingDeviceReplacedEventArgs::Init(exports);
  }

  class CompositionShadow : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionShadow").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionShadow").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionShadow(::Windows::UI::Composition::CompositionShadow^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionShadow^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionShadow^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionShadow^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionShadow *wrapperInstance = new CompositionShadow(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionShadow^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionShadow^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionShadow^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionShadow(winRtInstance));
    }





    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionShadow^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionShadow(::Windows::UI::Composition::CompositionShadow^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionShadow^ UnwrapCompositionShadow(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionShadow::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionShadow(::Windows::UI::Composition::CompositionShadow^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionShadow::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionShadow^ UnwrapCompositionShadow(Local<Value> value) {
     return CompositionShadow::Unwrap<CompositionShadow>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionShadow(Local<Object> exports) {
    CompositionShadow::Init(exports);
  }

  class DropShadow : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("DropShadow").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("mask").ToLocalChecked(), MaskGetter, MaskSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("blurRadius").ToLocalChecked(), BlurRadiusGetter, BlurRadiusSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("DropShadow").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      DropShadow(::Windows::UI::Composition::DropShadow^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::DropShadow^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::DropShadow^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      DropShadow *wrapperInstance = new DropShadow(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::DropShadow^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::DropShadow^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapDropShadow(winRtInstance));
    }





    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try  {
        float result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void MaskGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBrush^ result = wrapper->_instance->Mask;
        info.GetReturnValue().Set(WrapCompositionBrush(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void MaskSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBrush^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionBrush^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Mask = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BlurRadiusGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try  {
        float result = wrapper->_instance->BlurRadius;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BlurRadiusSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DropShadow^>(info.This())) {
        return;
      }

      DropShadow *wrapper = DropShadow::Unwrap<DropShadow>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->BlurRadius = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::DropShadow^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapDropShadow(::Windows::UI::Composition::DropShadow^ wintRtInstance);
      friend ::Windows::UI::Composition::DropShadow^ UnwrapDropShadow(Local<Value> value);
  };

  Persistent<FunctionTemplate> DropShadow::s_constructorTemplate;

  v8::Local<v8::Value> WrapDropShadow(::Windows::UI::Composition::DropShadow^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(DropShadow::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::DropShadow^ UnwrapDropShadow(Local<Value> value) {
     return DropShadow::Unwrap<DropShadow>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitDropShadow(Local<Object> exports) {
    DropShadow::Init(exports);
  }

  class StepEasingFunction : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("StepEasingFunction").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stepCount").ToLocalChecked(), StepCountGetter, StepCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isInitialStepSingleFrame").ToLocalChecked(), IsInitialStepSingleFrameGetter, IsInitialStepSingleFrameSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isFinalStepSingleFrame").ToLocalChecked(), IsFinalStepSingleFrameGetter, IsFinalStepSingleFrameSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("initialStep").ToLocalChecked(), InitialStepGetter, InitialStepSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("finalStep").ToLocalChecked(), FinalStepGetter, FinalStepSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("StepEasingFunction").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      StepEasingFunction(::Windows::UI::Composition::StepEasingFunction^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::StepEasingFunction^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::StepEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      StepEasingFunction *wrapperInstance = new StepEasingFunction(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::StepEasingFunction^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::StepEasingFunction^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapStepEasingFunction(winRtInstance));
    }





    static void StepCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try  {
        int result = wrapper->_instance->StepCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StepCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StepCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsInitialStepSingleFrameGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try  {
        bool result = wrapper->_instance->IsInitialStepSingleFrame;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsInitialStepSingleFrameSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsInitialStepSingleFrame = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsFinalStepSingleFrameGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try  {
        bool result = wrapper->_instance->IsFinalStepSingleFrame;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsFinalStepSingleFrameSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsFinalStepSingleFrame = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InitialStepGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try  {
        int result = wrapper->_instance->InitialStep;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void InitialStepSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->InitialStep = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void FinalStepGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try  {
        int result = wrapper->_instance->FinalStep;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void FinalStepSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::StepEasingFunction^>(info.This())) {
        return;
      }

      StepEasingFunction *wrapper = StepEasingFunction::Unwrap<StepEasingFunction>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->FinalStep = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::StepEasingFunction^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapStepEasingFunction(::Windows::UI::Composition::StepEasingFunction^ wintRtInstance);
      friend ::Windows::UI::Composition::StepEasingFunction^ UnwrapStepEasingFunction(Local<Value> value);
  };

  Persistent<FunctionTemplate> StepEasingFunction::s_constructorTemplate;

  v8::Local<v8::Value> WrapStepEasingFunction(::Windows::UI::Composition::StepEasingFunction^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(StepEasingFunction::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::StepEasingFunction^ UnwrapStepEasingFunction(Local<Value> value) {
     return StepEasingFunction::Unwrap<StepEasingFunction>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitStepEasingFunction(Local<Object> exports) {
    StepEasingFunction::Init(exports);
  }

  class Visual : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Visual").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isVisible").ToLocalChecked(), IsVisibleGetter, IsVisibleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositeMode").ToLocalChecked(), CompositeModeGetter, CompositeModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("clip").ToLocalChecked(), ClipGetter, ClipSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("borderMode").ToLocalChecked(), BorderModeGetter, BorderModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("backfaceVisibility").ToLocalChecked(), BackfaceVisibilityGetter, BackfaceVisibilitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter, SizeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAxis").ToLocalChecked(), RotationAxisGetter, RotationAxisSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("orientation").ToLocalChecked(), OrientationGetter, OrientationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parent").ToLocalChecked(), ParentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("Visual").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Visual(::Windows::UI::Composition::Visual^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Visual^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Visual^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Visual *wrapperInstance = new Visual(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Visual^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Visual^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapVisual(winRtInstance));
    }





    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsVisibleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        bool result = wrapper->_instance->IsVisible;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsVisibleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsVisible = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositeModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionCompositeMode result = wrapper->_instance->CompositeMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositeModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionCompositeMode winRtValue = static_cast<::Windows::UI::Composition::CompositionCompositeMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->CompositeMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ClipGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionClip^ result = wrapper->_instance->Clip;
        info.GetReturnValue().Set(WrapCompositionClip(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ClipSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionClip^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionClip^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Clip = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BorderModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBorderMode result = wrapper->_instance->BorderMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BorderModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBorderMode winRtValue = static_cast<::Windows::UI::Composition::CompositionBorderMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BorderMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BackfaceVisibilityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBackfaceVisibility result = wrapper->_instance->BackfaceVisibility;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BackfaceVisibilitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBackfaceVisibility winRtValue = static_cast<::Windows::UI::Composition::CompositionBackfaceVisibility>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BackfaceVisibility = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Size;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Size = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAxisGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->RotationAxis;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAxisSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->RotationAxis = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Matrix4x4 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix4x4ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix4x4JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Matrix4x4 winRtValue = Matrix4x4FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OrientationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Quaternion result = wrapper->_instance->Orientation;
        info.GetReturnValue().Set(QuaternionToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OrientationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsQuaternionJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Quaternion winRtValue = QuaternionFromJsObject(value);

        wrapper->_instance->Orientation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ParentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::ContainerVisual^ result = wrapper->_instance->Parent;
        info.GetReturnValue().Set(WrapContainerVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::Visual^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapVisual(::Windows::UI::Composition::Visual^ wintRtInstance);
      friend ::Windows::UI::Composition::Visual^ UnwrapVisual(Local<Value> value);
  };

  Persistent<FunctionTemplate> Visual::s_constructorTemplate;

  v8::Local<v8::Value> WrapVisual(::Windows::UI::Composition::Visual^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Visual::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Visual^ UnwrapVisual(Local<Value> value) {
     return Visual::Unwrap<Visual>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitVisual(Local<Object> exports) {
    Visual::Init(exports);
  }

  class ContainerVisual : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ContainerVisual").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("children").ToLocalChecked(), ChildrenGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isVisible").ToLocalChecked(), IsVisibleGetter, IsVisibleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositeMode").ToLocalChecked(), CompositeModeGetter, CompositeModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("clip").ToLocalChecked(), ClipGetter, ClipSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("borderMode").ToLocalChecked(), BorderModeGetter, BorderModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("backfaceVisibility").ToLocalChecked(), BackfaceVisibilityGetter, BackfaceVisibilitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter, SizeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAxis").ToLocalChecked(), RotationAxisGetter, RotationAxisSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("orientation").ToLocalChecked(), OrientationGetter, OrientationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parent").ToLocalChecked(), ParentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ContainerVisual").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ContainerVisual(::Windows::UI::Composition::ContainerVisual^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::ContainerVisual^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ContainerVisual^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::ContainerVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ContainerVisual *wrapperInstance = new ContainerVisual(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ContainerVisual^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::ContainerVisual^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::ContainerVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapContainerVisual(winRtInstance));
    }





    static void ChildrenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ContainerVisual^>(info.This())) {
        return;
      }

      ContainerVisual *wrapper = ContainerVisual::Unwrap<ContainerVisual>(info.This());

      try  {
        ::Windows::UI::Composition::VisualCollection^ result = wrapper->_instance->Children;
        info.GetReturnValue().Set(WrapVisualCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsVisibleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        bool result = wrapper->_instance->IsVisible;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsVisibleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsVisible = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositeModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionCompositeMode result = wrapper->_instance->CompositeMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositeModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionCompositeMode winRtValue = static_cast<::Windows::UI::Composition::CompositionCompositeMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->CompositeMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ClipGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionClip^ result = wrapper->_instance->Clip;
        info.GetReturnValue().Set(WrapCompositionClip(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ClipSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionClip^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionClip^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Clip = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BorderModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBorderMode result = wrapper->_instance->BorderMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BorderModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBorderMode winRtValue = static_cast<::Windows::UI::Composition::CompositionBorderMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BorderMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BackfaceVisibilityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBackfaceVisibility result = wrapper->_instance->BackfaceVisibility;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BackfaceVisibilitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBackfaceVisibility winRtValue = static_cast<::Windows::UI::Composition::CompositionBackfaceVisibility>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BackfaceVisibility = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Size;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Size = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAxisGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->RotationAxis;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAxisSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->RotationAxis = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Matrix4x4 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix4x4ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix4x4JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Matrix4x4 winRtValue = Matrix4x4FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OrientationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Quaternion result = wrapper->_instance->Orientation;
        info.GetReturnValue().Set(QuaternionToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OrientationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsQuaternionJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Quaternion winRtValue = QuaternionFromJsObject(value);

        wrapper->_instance->Orientation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ParentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::ContainerVisual^ result = wrapper->_instance->Parent;
        info.GetReturnValue().Set(WrapContainerVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::ContainerVisual^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapContainerVisual(::Windows::UI::Composition::ContainerVisual^ wintRtInstance);
      friend ::Windows::UI::Composition::ContainerVisual^ UnwrapContainerVisual(Local<Value> value);
  };

  Persistent<FunctionTemplate> ContainerVisual::s_constructorTemplate;

  v8::Local<v8::Value> WrapContainerVisual(::Windows::UI::Composition::ContainerVisual^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ContainerVisual::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::ContainerVisual^ UnwrapContainerVisual(Local<Value> value) {
     return ContainerVisual::Unwrap<ContainerVisual>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitContainerVisual(Local<Object> exports) {
    ContainerVisual::Init(exports);
  }

  class SpriteVisual : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SpriteVisual").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("brush").ToLocalChecked(), BrushGetter, BrushSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("shadow").ToLocalChecked(), ShadowGetter, ShadowSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("children").ToLocalChecked(), ChildrenGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isVisible").ToLocalChecked(), IsVisibleGetter, IsVisibleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositeMode").ToLocalChecked(), CompositeModeGetter, CompositeModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("clip").ToLocalChecked(), ClipGetter, ClipSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("borderMode").ToLocalChecked(), BorderModeGetter, BorderModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("backfaceVisibility").ToLocalChecked(), BackfaceVisibilityGetter, BackfaceVisibilitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter, SizeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAxis").ToLocalChecked(), RotationAxisGetter, RotationAxisSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("orientation").ToLocalChecked(), OrientationGetter, OrientationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parent").ToLocalChecked(), ParentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SpriteVisual").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SpriteVisual(::Windows::UI::Composition::SpriteVisual^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::SpriteVisual^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpriteVisual^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::SpriteVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SpriteVisual *wrapperInstance = new SpriteVisual(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpriteVisual^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::SpriteVisual^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::SpriteVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSpriteVisual(winRtInstance));
    }





    static void BrushGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpriteVisual^>(info.This())) {
        return;
      }

      SpriteVisual *wrapper = SpriteVisual::Unwrap<SpriteVisual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBrush^ result = wrapper->_instance->Brush;
        info.GetReturnValue().Set(WrapCompositionBrush(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BrushSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionBrush^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpriteVisual^>(info.This())) {
        return;
      }

      SpriteVisual *wrapper = SpriteVisual::Unwrap<SpriteVisual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBrush^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionBrush^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Brush = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ShadowGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpriteVisual^>(info.This())) {
        return;
      }

      SpriteVisual *wrapper = SpriteVisual::Unwrap<SpriteVisual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionShadow^ result = wrapper->_instance->Shadow;
        info.GetReturnValue().Set(WrapCompositionShadow(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ShadowSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionShadow^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpriteVisual^>(info.This())) {
        return;
      }

      SpriteVisual *wrapper = SpriteVisual::Unwrap<SpriteVisual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionShadow^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionShadow^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Shadow = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ChildrenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ContainerVisual^>(info.This())) {
        return;
      }

      ContainerVisual *wrapper = ContainerVisual::Unwrap<ContainerVisual>(info.This());

      try  {
        ::Windows::UI::Composition::VisualCollection^ result = wrapper->_instance->Children;
        info.GetReturnValue().Set(WrapVisualCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsVisibleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        bool result = wrapper->_instance->IsVisible;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsVisibleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsVisible = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositeModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionCompositeMode result = wrapper->_instance->CompositeMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositeModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionCompositeMode winRtValue = static_cast<::Windows::UI::Composition::CompositionCompositeMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->CompositeMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ClipGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionClip^ result = wrapper->_instance->Clip;
        info.GetReturnValue().Set(WrapCompositionClip(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ClipSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionClip^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionClip^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Clip = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BorderModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBorderMode result = wrapper->_instance->BorderMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BorderModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBorderMode winRtValue = static_cast<::Windows::UI::Composition::CompositionBorderMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BorderMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BackfaceVisibilityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBackfaceVisibility result = wrapper->_instance->BackfaceVisibility;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BackfaceVisibilitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBackfaceVisibility winRtValue = static_cast<::Windows::UI::Composition::CompositionBackfaceVisibility>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BackfaceVisibility = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Size;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Size = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAxisGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->RotationAxis;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAxisSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->RotationAxis = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Matrix4x4 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix4x4ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix4x4JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Matrix4x4 winRtValue = Matrix4x4FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OrientationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Quaternion result = wrapper->_instance->Orientation;
        info.GetReturnValue().Set(QuaternionToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OrientationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsQuaternionJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Quaternion winRtValue = QuaternionFromJsObject(value);

        wrapper->_instance->Orientation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ParentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::ContainerVisual^ result = wrapper->_instance->Parent;
        info.GetReturnValue().Set(WrapContainerVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::SpriteVisual^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSpriteVisual(::Windows::UI::Composition::SpriteVisual^ wintRtInstance);
      friend ::Windows::UI::Composition::SpriteVisual^ UnwrapSpriteVisual(Local<Value> value);
  };

  Persistent<FunctionTemplate> SpriteVisual::s_constructorTemplate;

  v8::Local<v8::Value> WrapSpriteVisual(::Windows::UI::Composition::SpriteVisual^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SpriteVisual::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::SpriteVisual^ UnwrapSpriteVisual(Local<Value> value) {
     return SpriteVisual::Unwrap<SpriteVisual>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSpriteVisual(Local<Object> exports) {
    SpriteVisual::Init(exports);
  }

  class LayerVisual : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("LayerVisual").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("effect").ToLocalChecked(), EffectGetter, EffectSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("children").ToLocalChecked(), ChildrenGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("isVisible").ToLocalChecked(), IsVisibleGetter, IsVisibleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositeMode").ToLocalChecked(), CompositeModeGetter, CompositeModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("clip").ToLocalChecked(), ClipGetter, ClipSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("borderMode").ToLocalChecked(), BorderModeGetter, BorderModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("backfaceVisibility").ToLocalChecked(), BackfaceVisibilityGetter, BackfaceVisibilitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("size").ToLocalChecked(), SizeGetter, SizeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAxis").ToLocalChecked(), RotationAxisGetter, RotationAxisSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("orientation").ToLocalChecked(), OrientationGetter, OrientationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("opacity").ToLocalChecked(), OpacityGetter, OpacitySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("parent").ToLocalChecked(), ParentGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LayerVisual").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LayerVisual(::Windows::UI::Composition::LayerVisual^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::LayerVisual^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::LayerVisual^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::LayerVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      LayerVisual *wrapperInstance = new LayerVisual(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::LayerVisual^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::LayerVisual^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::LayerVisual^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLayerVisual(winRtInstance));
    }





    static void EffectGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::LayerVisual^>(info.This())) {
        return;
      }

      LayerVisual *wrapper = LayerVisual::Unwrap<LayerVisual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionEffectBrush^ result = wrapper->_instance->Effect;
        info.GetReturnValue().Set(WrapCompositionEffectBrush(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EffectSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEffectBrush^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::LayerVisual^>(info.This())) {
        return;
      }

      LayerVisual *wrapper = LayerVisual::Unwrap<LayerVisual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionEffectBrush^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionEffectBrush^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Effect = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ChildrenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ContainerVisual^>(info.This())) {
        return;
      }

      ContainerVisual *wrapper = ContainerVisual::Unwrap<ContainerVisual>(info.This());

      try  {
        ::Windows::UI::Composition::VisualCollection^ result = wrapper->_instance->Children;
        info.GetReturnValue().Set(WrapVisualCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IsVisibleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        bool result = wrapper->_instance->IsVisible;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IsVisibleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsBoolean()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->IsVisible = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositeModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionCompositeMode result = wrapper->_instance->CompositeMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositeModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionCompositeMode winRtValue = static_cast<::Windows::UI::Composition::CompositionCompositeMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->CompositeMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ClipGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionClip^ result = wrapper->_instance->Clip;
        info.GetReturnValue().Set(WrapCompositionClip(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ClipSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionClip^ winRtValue = dynamic_cast<::Windows::UI::Composition::CompositionClip^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Clip = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BorderModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBorderMode result = wrapper->_instance->BorderMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BorderModeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBorderMode winRtValue = static_cast<::Windows::UI::Composition::CompositionBorderMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BorderMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BackfaceVisibilityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionBackfaceVisibility result = wrapper->_instance->BackfaceVisibility;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BackfaceVisibilitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Windows::UI::Composition::CompositionBackfaceVisibility winRtValue = static_cast<::Windows::UI::Composition::CompositionBackfaceVisibility>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->BackfaceVisibility = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Size;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SizeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Size = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAxisGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->RotationAxis;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAxisSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->RotationAxis = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Matrix4x4 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix4x4ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix4x4JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Matrix4x4 winRtValue = Matrix4x4FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OrientationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Platform::Numerics::Quaternion result = wrapper->_instance->Orientation;
        info.GetReturnValue().Set(QuaternionToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OrientationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsQuaternionJsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        ::Platform::Numerics::Quaternion winRtValue = QuaternionFromJsObject(value);

        wrapper->_instance->Orientation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OpacityGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        float result = wrapper->_instance->Opacity;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OpacitySetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->Opacity = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ParentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info.This())) {
        return;
      }

      Visual *wrapper = Visual::Unwrap<Visual>(info.This());

      try  {
        ::Windows::UI::Composition::ContainerVisual^ result = wrapper->_instance->Parent;
        info.GetReturnValue().Set(WrapContainerVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::LayerVisual^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLayerVisual(::Windows::UI::Composition::LayerVisual^ wintRtInstance);
      friend ::Windows::UI::Composition::LayerVisual^ UnwrapLayerVisual(Local<Value> value);
  };

  Persistent<FunctionTemplate> LayerVisual::s_constructorTemplate;

  v8::Local<v8::Value> WrapLayerVisual(::Windows::UI::Composition::LayerVisual^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(LayerVisual::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::LayerVisual^ UnwrapLayerVisual(Local<Value> value) {
     return LayerVisual::Unwrap<LayerVisual>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLayerVisual(Local<Object> exports) {
    LayerVisual::Init(exports);
  }

  class CompositionClip : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionClip").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionClip").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionClip(::Windows::UI::Composition::CompositionClip^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionClip^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionClip^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionClip *wrapperInstance = new CompositionClip(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionClip^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionClip^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionClip(winRtInstance));
    }





    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Matrix3x2 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix3x2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix3x2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Matrix3x2 winRtValue = Matrix3x2FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionClip^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionClip(::Windows::UI::Composition::CompositionClip^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionClip^ UnwrapCompositionClip(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionClip::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionClip(::Windows::UI::Composition::CompositionClip^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionClip::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionClip^ UnwrapCompositionClip(Local<Value> value) {
     return CompositionClip::Unwrap<CompositionClip>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionClip(Local<Object> exports) {
    CompositionClip::Init(exports);
  }

  class InsetClip : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("InsetClip").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("topInset").ToLocalChecked(), TopInsetGetter, TopInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rightInset").ToLocalChecked(), RightInsetGetter, RightInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("leftInset").ToLocalChecked(), LeftInsetGetter, LeftInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bottomInset").ToLocalChecked(), BottomInsetGetter, BottomInsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("transformMatrix").ToLocalChecked(), TransformMatrixGetter, TransformMatrixSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("scale").ToLocalChecked(), ScaleGetter, ScaleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngleInDegrees").ToLocalChecked(), RotationAngleInDegreesGetter, RotationAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rotationAngle").ToLocalChecked(), RotationAngleGetter, RotationAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("centerPoint").ToLocalChecked(), CenterPointGetter, CenterPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("anchorPoint").ToLocalChecked(), AnchorPointGetter, AnchorPointSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("InsetClip").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      InsetClip(::Windows::UI::Composition::InsetClip^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::InsetClip^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::InsetClip^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      InsetClip *wrapperInstance = new InsetClip(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::InsetClip^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::InsetClip^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapInsetClip(winRtInstance));
    }





    static void TopInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try  {
        float result = wrapper->_instance->TopInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TopInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->TopInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RightInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try  {
        float result = wrapper->_instance->RightInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RightInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RightInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LeftInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try  {
        float result = wrapper->_instance->LeftInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LeftInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->LeftInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void BottomInsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try  {
        float result = wrapper->_instance->BottomInset;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void BottomInsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::InsetClip^>(info.This())) {
        return;
      }

      InsetClip *wrapper = InsetClip::Unwrap<InsetClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->BottomInset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TransformMatrixGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Matrix3x2 result = wrapper->_instance->TransformMatrix;
        info.GetReturnValue().Set(Matrix3x2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TransformMatrixSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsMatrix3x2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Matrix3x2 winRtValue = Matrix3x2FromJsObject(value);

        wrapper->_instance->TransformMatrix = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Scale;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Scale = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RotationAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        float result = wrapper->_instance->RotationAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RotationAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RotationAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CenterPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->CenterPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CenterPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->CenterPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AnchorPointGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try  {
        ::Platform::Numerics::Vector2 result = wrapper->_instance->AnchorPoint;
        info.GetReturnValue().Set(Vector2ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AnchorPointSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector2JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionClip^>(info.This())) {
        return;
      }

      CompositionClip *wrapper = CompositionClip::Unwrap<CompositionClip>(info.This());

      try {

        ::Platform::Numerics::Vector2 winRtValue = Vector2FromJsObject(value);

        wrapper->_instance->AnchorPoint = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::InsetClip^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapInsetClip(::Windows::UI::Composition::InsetClip^ wintRtInstance);
      friend ::Windows::UI::Composition::InsetClip^ UnwrapInsetClip(Local<Value> value);
  };

  Persistent<FunctionTemplate> InsetClip::s_constructorTemplate;

  v8::Local<v8::Value> WrapInsetClip(::Windows::UI::Composition::InsetClip^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(InsetClip::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::InsetClip^ UnwrapInsetClip(Local<Value> value) {
     return InsetClip::Unwrap<InsetClip>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitInsetClip(Local<Object> exports) {
    InsetClip::Init(exports);
  }

  class VisualCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("VisualCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertAbove", InsertAbove);
            Nan::SetPrototypeMethod(localRef, "insertAtBottom", InsertAtBottom);
            Nan::SetPrototypeMethod(localRef, "insertAtTop", InsertAtTop);
            Nan::SetPrototypeMethod(localRef, "insertBelow", InsertBelow);
            Nan::SetPrototypeMethod(localRef, "remove", Remove);
            Nan::SetPrototypeMethod(localRef, "removeAll", RemoveAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("count").ToLocalChecked(), CountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("VisualCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      VisualCollection(::Windows::UI::Composition::VisualCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::VisualCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::VisualCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      VisualCollection *wrapperInstance = new VisualCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::VisualCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::VisualCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapVisualCollection(winRtInstance));
    }


    static void InsertAbove(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[1]))
      {
        try
        {
          ::Windows::UI::Composition::Visual^ arg0 = UnwrapVisual(info[0]);
          ::Windows::UI::Composition::Visual^ arg1 = UnwrapVisual(info[1]);
          
          wrapper->_instance->InsertAbove(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAtBottom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Visual^ arg0 = UnwrapVisual(info[0]);
          
          wrapper->_instance->InsertAtBottom(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertAtTop(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Visual^ arg0 = UnwrapVisual(info[0]);
          
          wrapper->_instance->InsertAtTop(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void InsertBelow(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[1]))
      {
        try
        {
          ::Windows::UI::Composition::Visual^ arg0 = UnwrapVisual(info[0]);
          ::Windows::UI::Composition::Visual^ arg1 = UnwrapVisual(info[1]);
          
          wrapper->_instance->InsertBelow(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Remove(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Visual^ arg0 = UnwrapVisual(info[0]);
          
          wrapper->_instance->Remove(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAll();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Composition::Visual^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Composition::Visual^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Composition::Visual^ val) -> Local<Value> {
              return WrapVisual(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualCollection^>(info.This())) {
        return;
      }

      VisualCollection *wrapper = VisualCollection::Unwrap<VisualCollection>(info.This());

      try  {
        int result = wrapper->_instance->Count;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::VisualCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapVisualCollection(::Windows::UI::Composition::VisualCollection^ wintRtInstance);
      friend ::Windows::UI::Composition::VisualCollection^ UnwrapVisualCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> VisualCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapVisualCollection(::Windows::UI::Composition::VisualCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(VisualCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::VisualCollection^ UnwrapVisualCollection(Local<Value> value) {
     return VisualCollection::Unwrap<VisualCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitVisualCollection(Local<Object> exports) {
    VisualCollection::Init(exports);
  }

  class VisualUnorderedCollection : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("VisualUnorderedCollection").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "add", Add);
            Nan::SetPrototypeMethod(localRef, "remove", Remove);
            Nan::SetPrototypeMethod(localRef, "removeAll", RemoveAll);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("count").ToLocalChecked(), CountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("VisualUnorderedCollection").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      VisualUnorderedCollection(::Windows::UI::Composition::VisualUnorderedCollection^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::VisualUnorderedCollection^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualUnorderedCollection^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::VisualUnorderedCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      VisualUnorderedCollection *wrapperInstance = new VisualUnorderedCollection(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualUnorderedCollection^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::VisualUnorderedCollection^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::VisualUnorderedCollection^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapVisualUnorderedCollection(winRtInstance));
    }


    static void Add(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualUnorderedCollection^>(info.This())) {
        return;
      }

      VisualUnorderedCollection *wrapper = VisualUnorderedCollection::Unwrap<VisualUnorderedCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Visual^ arg0 = UnwrapVisual(info[0]);
          
          wrapper->_instance->Add(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Remove(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualUnorderedCollection^>(info.This())) {
        return;
      }

      VisualUnorderedCollection *wrapper = VisualUnorderedCollection::Unwrap<VisualUnorderedCollection>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(info[0]))
      {
        try
        {
          ::Windows::UI::Composition::Visual^ arg0 = UnwrapVisual(info[0]);
          
          wrapper->_instance->Remove(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void RemoveAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualUnorderedCollection^>(info.This())) {
        return;
      }

      VisualUnorderedCollection *wrapper = VisualUnorderedCollection::Unwrap<VisualUnorderedCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->RemoveAll();
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualUnorderedCollection^>(info.This())) {
        return;
      }

      VisualUnorderedCollection *wrapper = VisualUnorderedCollection::Unwrap<VisualUnorderedCollection>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::UI::Composition::Visual^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::UI::Composition::Visual^>::CreateIteratorWrapper(result, 
            [](::Windows::UI::Composition::Visual^ val) -> Local<Value> {
              return WrapVisual(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void CountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::VisualUnorderedCollection^>(info.This())) {
        return;
      }

      VisualUnorderedCollection *wrapper = VisualUnorderedCollection::Unwrap<VisualUnorderedCollection>(info.This());

      try  {
        int result = wrapper->_instance->Count;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::VisualUnorderedCollection^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapVisualUnorderedCollection(::Windows::UI::Composition::VisualUnorderedCollection^ wintRtInstance);
      friend ::Windows::UI::Composition::VisualUnorderedCollection^ UnwrapVisualUnorderedCollection(Local<Value> value);
  };

  Persistent<FunctionTemplate> VisualUnorderedCollection::s_constructorTemplate;

  v8::Local<v8::Value> WrapVisualUnorderedCollection(::Windows::UI::Composition::VisualUnorderedCollection^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(VisualUnorderedCollection::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::VisualUnorderedCollection^ UnwrapVisualUnorderedCollection(Local<Value> value) {
     return VisualUnorderedCollection::Unwrap<VisualUnorderedCollection>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitVisualUnorderedCollection(Local<Object> exports) {
    VisualUnorderedCollection::Init(exports);
  }

  class CompositionLight : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("CompositionLight").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targets").ToLocalChecked(), TargetsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("CompositionLight").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      CompositionLight(::Windows::UI::Composition::CompositionLight^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::CompositionLight^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionLight^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::CompositionLight^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      CompositionLight *wrapperInstance = new CompositionLight(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionLight^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::CompositionLight^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::CompositionLight^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapCompositionLight(winRtInstance));
    }





    static void TargetsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionLight^>(info.This())) {
        return;
      }

      CompositionLight *wrapper = CompositionLight::Unwrap<CompositionLight>(info.This());

      try  {
        ::Windows::UI::Composition::VisualUnorderedCollection^ result = wrapper->_instance->Targets;
        info.GetReturnValue().Set(WrapVisualUnorderedCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::CompositionLight^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapCompositionLight(::Windows::UI::Composition::CompositionLight^ wintRtInstance);
      friend ::Windows::UI::Composition::CompositionLight^ UnwrapCompositionLight(Local<Value> value);
  };

  Persistent<FunctionTemplate> CompositionLight::s_constructorTemplate;

  v8::Local<v8::Value> WrapCompositionLight(::Windows::UI::Composition::CompositionLight^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(CompositionLight::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::CompositionLight^ UnwrapCompositionLight(Local<Value> value) {
     return CompositionLight::Unwrap<CompositionLight>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitCompositionLight(Local<Object> exports) {
    CompositionLight::Init(exports);
  }

  class AmbientLight : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("AmbientLight").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targets").ToLocalChecked(), TargetsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("AmbientLight").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      AmbientLight(::Windows::UI::Composition::AmbientLight^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::AmbientLight^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::AmbientLight^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::AmbientLight^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      AmbientLight *wrapperInstance = new AmbientLight(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::AmbientLight^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::AmbientLight^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::AmbientLight^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapAmbientLight(winRtInstance));
    }





    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::AmbientLight^>(info.This())) {
        return;
      }

      AmbientLight *wrapper = AmbientLight::Unwrap<AmbientLight>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::AmbientLight^>(info.This())) {
        return;
      }

      AmbientLight *wrapper = AmbientLight::Unwrap<AmbientLight>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionLight^>(info.This())) {
        return;
      }

      CompositionLight *wrapper = CompositionLight::Unwrap<CompositionLight>(info.This());

      try  {
        ::Windows::UI::Composition::VisualUnorderedCollection^ result = wrapper->_instance->Targets;
        info.GetReturnValue().Set(WrapVisualUnorderedCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::AmbientLight^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapAmbientLight(::Windows::UI::Composition::AmbientLight^ wintRtInstance);
      friend ::Windows::UI::Composition::AmbientLight^ UnwrapAmbientLight(Local<Value> value);
  };

  Persistent<FunctionTemplate> AmbientLight::s_constructorTemplate;

  v8::Local<v8::Value> WrapAmbientLight(::Windows::UI::Composition::AmbientLight^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(AmbientLight::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::AmbientLight^ UnwrapAmbientLight(Local<Value> value) {
     return AmbientLight::Unwrap<AmbientLight>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitAmbientLight(Local<Object> exports) {
    AmbientLight::Init(exports);
  }

  class DistantLight : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("DistantLight").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("coordinateSpace").ToLocalChecked(), CoordinateSpaceGetter, CoordinateSpaceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targets").ToLocalChecked(), TargetsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("DistantLight").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      DistantLight(::Windows::UI::Composition::DistantLight^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::DistantLight^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::DistantLight^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      DistantLight *wrapperInstance = new DistantLight(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::DistantLight^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::DistantLight^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapDistantLight(winRtInstance));
    }





    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info.This())) {
        return;
      }

      DistantLight *wrapper = DistantLight::Unwrap<DistantLight>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info.This())) {
        return;
      }

      DistantLight *wrapper = DistantLight::Unwrap<DistantLight>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CoordinateSpaceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info.This())) {
        return;
      }

      DistantLight *wrapper = DistantLight::Unwrap<DistantLight>(info.This());

      try  {
        ::Windows::UI::Composition::Visual^ result = wrapper->_instance->CoordinateSpace;
        info.GetReturnValue().Set(WrapVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CoordinateSpaceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info.This())) {
        return;
      }

      DistantLight *wrapper = DistantLight::Unwrap<DistantLight>(info.This());

      try {

        ::Windows::UI::Composition::Visual^ winRtValue = dynamic_cast<::Windows::UI::Composition::Visual^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->CoordinateSpace = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info.This())) {
        return;
      }

      DistantLight *wrapper = DistantLight::Unwrap<DistantLight>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::DistantLight^>(info.This())) {
        return;
      }

      DistantLight *wrapper = DistantLight::Unwrap<DistantLight>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionLight^>(info.This())) {
        return;
      }

      CompositionLight *wrapper = CompositionLight::Unwrap<CompositionLight>(info.This());

      try  {
        ::Windows::UI::Composition::VisualUnorderedCollection^ result = wrapper->_instance->Targets;
        info.GetReturnValue().Set(WrapVisualUnorderedCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::DistantLight^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapDistantLight(::Windows::UI::Composition::DistantLight^ wintRtInstance);
      friend ::Windows::UI::Composition::DistantLight^ UnwrapDistantLight(Local<Value> value);
  };

  Persistent<FunctionTemplate> DistantLight::s_constructorTemplate;

  v8::Local<v8::Value> WrapDistantLight(::Windows::UI::Composition::DistantLight^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(DistantLight::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::DistantLight^ UnwrapDistantLight(Local<Value> value) {
     return DistantLight::Unwrap<DistantLight>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitDistantLight(Local<Object> exports) {
    DistantLight::Init(exports);
  }

  class PointLight : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("PointLight").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("quadraticAttenuation").ToLocalChecked(), QuadraticAttenuationGetter, QuadraticAttenuationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("linearAttenuation").ToLocalChecked(), LinearAttenuationGetter, LinearAttenuationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("coordinateSpace").ToLocalChecked(), CoordinateSpaceGetter, CoordinateSpaceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("constantAttenuation").ToLocalChecked(), ConstantAttenuationGetter, ConstantAttenuationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targets").ToLocalChecked(), TargetsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("PointLight").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      PointLight(::Windows::UI::Composition::PointLight^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::PointLight^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::PointLight^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      PointLight *wrapperInstance = new PointLight(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::PointLight^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::PointLight^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapPointLight(winRtInstance));
    }





    static void QuadraticAttenuationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try  {
        float result = wrapper->_instance->QuadraticAttenuation;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void QuadraticAttenuationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->QuadraticAttenuation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LinearAttenuationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try  {
        float result = wrapper->_instance->LinearAttenuation;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LinearAttenuationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->LinearAttenuation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CoordinateSpaceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try  {
        ::Windows::UI::Composition::Visual^ result = wrapper->_instance->CoordinateSpace;
        info.GetReturnValue().Set(WrapVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CoordinateSpaceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try {

        ::Windows::UI::Composition::Visual^ winRtValue = dynamic_cast<::Windows::UI::Composition::Visual^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->CoordinateSpace = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ConstantAttenuationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try  {
        float result = wrapper->_instance->ConstantAttenuation;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ConstantAttenuationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->ConstantAttenuation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::PointLight^>(info.This())) {
        return;
      }

      PointLight *wrapper = PointLight::Unwrap<PointLight>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionLight^>(info.This())) {
        return;
      }

      CompositionLight *wrapper = CompositionLight::Unwrap<CompositionLight>(info.This());

      try  {
        ::Windows::UI::Composition::VisualUnorderedCollection^ result = wrapper->_instance->Targets;
        info.GetReturnValue().Set(WrapVisualUnorderedCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::PointLight^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapPointLight(::Windows::UI::Composition::PointLight^ wintRtInstance);
      friend ::Windows::UI::Composition::PointLight^ UnwrapPointLight(Local<Value> value);
  };

  Persistent<FunctionTemplate> PointLight::s_constructorTemplate;

  v8::Local<v8::Value> WrapPointLight(::Windows::UI::Composition::PointLight^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(PointLight::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::PointLight^ UnwrapPointLight(Local<Value> value) {
     return PointLight::Unwrap<PointLight>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitPointLight(Local<Object> exports) {
    PointLight::Init(exports);
  }

  class SpotLight : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("SpotLight").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("innerConeColor").ToLocalChecked(), InnerConeColorGetter, InnerConeColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("innerConeAngleInDegrees").ToLocalChecked(), InnerConeAngleInDegreesGetter, InnerConeAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("innerConeAngle").ToLocalChecked(), InnerConeAngleGetter, InnerConeAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("coordinateSpace").ToLocalChecked(), CoordinateSpaceGetter, CoordinateSpaceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("constantAttenuation").ToLocalChecked(), ConstantAttenuationGetter, ConstantAttenuationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("quadraticAttenuation").ToLocalChecked(), QuadraticAttenuationGetter, QuadraticAttenuationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("outerConeColor").ToLocalChecked(), OuterConeColorGetter, OuterConeColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("outerConeAngleInDegrees").ToLocalChecked(), OuterConeAngleInDegreesGetter, OuterConeAngleInDegreesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("outerConeAngle").ToLocalChecked(), OuterConeAngleGetter, OuterConeAngleSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("offset").ToLocalChecked(), OffsetGetter, OffsetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("linearAttenuation").ToLocalChecked(), LinearAttenuationGetter, LinearAttenuationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("targets").ToLocalChecked(), TargetsGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("SpotLight").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      SpotLight(::Windows::UI::Composition::SpotLight^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::SpotLight^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::SpotLight^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SpotLight *wrapperInstance = new SpotLight(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::SpotLight^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::SpotLight^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapSpotLight(winRtInstance));
    }





    static void InnerConeColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->InnerConeColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void InnerConeColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->InnerConeColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InnerConeAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        float result = wrapper->_instance->InnerConeAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void InnerConeAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->InnerConeAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void InnerConeAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        float result = wrapper->_instance->InnerConeAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void InnerConeAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->InnerConeAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CoordinateSpaceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        ::Windows::UI::Composition::Visual^ result = wrapper->_instance->CoordinateSpace;
        info.GetReturnValue().Set(WrapVisual(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CoordinateSpaceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Visual^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        ::Windows::UI::Composition::Visual^ winRtValue = dynamic_cast<::Windows::UI::Composition::Visual^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->CoordinateSpace = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ConstantAttenuationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        float result = wrapper->_instance->ConstantAttenuation;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ConstantAttenuationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->ConstantAttenuation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void QuadraticAttenuationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        float result = wrapper->_instance->QuadraticAttenuation;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void QuadraticAttenuationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->QuadraticAttenuation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OuterConeColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->OuterConeColor;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OuterConeColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->OuterConeColor = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OuterConeAngleInDegreesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        float result = wrapper->_instance->OuterConeAngleInDegrees;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OuterConeAngleInDegreesSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->OuterConeAngleInDegrees = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OuterConeAngleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        float result = wrapper->_instance->OuterConeAngle;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OuterConeAngleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->OuterConeAngle = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OffsetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        ::Platform::Numerics::Vector3 result = wrapper->_instance->Offset;
        info.GetReturnValue().Set(Vector3ToJsObject(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OffsetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!IsVector3JsObject(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        ::Platform::Numerics::Vector3 winRtValue = Vector3FromJsObject(value);

        wrapper->_instance->Offset = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void LinearAttenuationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try  {
        float result = wrapper->_instance->LinearAttenuation;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void LinearAttenuationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::SpotLight^>(info.This())) {
        return;
      }

      SpotLight *wrapper = SpotLight::Unwrap<SpotLight>(info.This());

      try {

        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->LinearAttenuation = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionLight^>(info.This())) {
        return;
      }

      CompositionLight *wrapper = CompositionLight::Unwrap<CompositionLight>(info.This());

      try  {
        ::Windows::UI::Composition::VisualUnorderedCollection^ result = wrapper->_instance->Targets;
        info.GetReturnValue().Set(WrapVisualUnorderedCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::SpotLight^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapSpotLight(::Windows::UI::Composition::SpotLight^ wintRtInstance);
      friend ::Windows::UI::Composition::SpotLight^ UnwrapSpotLight(Local<Value> value);
  };

  Persistent<FunctionTemplate> SpotLight::s_constructorTemplate;

  v8::Local<v8::Value> WrapSpotLight(::Windows::UI::Composition::SpotLight^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SpotLight::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::SpotLight^ UnwrapSpotLight(Local<Value> value) {
     return SpotLight::Unwrap<SpotLight>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSpotLight(Local<Object> exports) {
    SpotLight::Init(exports);
  }

  class KeyFrameAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("KeyFrameAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertExpressionKeyFrame", InsertExpressionKeyFrame);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stopBehavior").ToLocalChecked(), StopBehaviorGetter, StopBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationCount").ToLocalChecked(), IterationCountGetter, IterationCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationBehavior").ToLocalChecked(), IterationBehaviorGetter, IterationBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("delayTime").ToLocalChecked(), DelayTimeGetter, DelayTimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("keyFrameCount").ToLocalChecked(), KeyFrameCountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("KeyFrameAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      KeyFrameAnimation(::Windows::UI::Composition::KeyFrameAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::KeyFrameAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      KeyFrameAnimation *wrapperInstance = new KeyFrameAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::KeyFrameAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapKeyFrameAnimation(winRtInstance));
    }


    static void InsertExpressionKeyFrame(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsNumber()
        && info[1]->IsString())
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[1])));
          
          wrapper->_instance->InsertExpressionKeyFrame(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && info[0]->IsNumber()
        && info[1]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[2]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), info[1])));
          ::Windows::UI::Composition::CompositionEasingFunction^ arg2 = UnwrapCompositionEasingFunction(info[2]);
          
          wrapper->_instance->InsertExpressionKeyFrame(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StopBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationStopBehavior result = wrapper->_instance->StopBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StopBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationStopBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationStopBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StopBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->IterationCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationIterationBehavior result = wrapper->_instance->IterationBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationIterationBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationIterationBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DelayTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DelayTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DelayTimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DelayTime = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void KeyFrameCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->KeyFrameCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationDirection result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationDirection winRtValue = static_cast<::Windows::UI::Composition::AnimationDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::KeyFrameAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapKeyFrameAnimation(::Windows::UI::Composition::KeyFrameAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::KeyFrameAnimation^ UnwrapKeyFrameAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> KeyFrameAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapKeyFrameAnimation(::Windows::UI::Composition::KeyFrameAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(KeyFrameAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::KeyFrameAnimation^ UnwrapKeyFrameAnimation(Local<Value> value) {
     return KeyFrameAnimation::Unwrap<KeyFrameAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitKeyFrameAnimation(Local<Object> exports) {
    KeyFrameAnimation::Init(exports);
  }

  class ColorKeyFrameAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ColorKeyFrameAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertKeyFrame", InsertKeyFrame);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("interpolationColorSpace").ToLocalChecked(), InterpolationColorSpaceGetter, InterpolationColorSpaceSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stopBehavior").ToLocalChecked(), StopBehaviorGetter, StopBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationCount").ToLocalChecked(), IterationCountGetter, IterationCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationBehavior").ToLocalChecked(), IterationBehaviorGetter, IterationBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("delayTime").ToLocalChecked(), DelayTimeGetter, DelayTimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("keyFrameCount").ToLocalChecked(), KeyFrameCountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ColorKeyFrameAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ColorKeyFrameAnimation(::Windows::UI::Composition::ColorKeyFrameAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::ColorKeyFrameAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ColorKeyFrameAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::ColorKeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ColorKeyFrameAnimation *wrapperInstance = new ColorKeyFrameAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ColorKeyFrameAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::ColorKeyFrameAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::ColorKeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapColorKeyFrameAnimation(winRtInstance));
    }


    static void InsertKeyFrame(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ColorKeyFrameAnimation^>(info.This())) {
        return;
      }

      ColorKeyFrameAnimation *wrapper = ColorKeyFrameAnimation::Unwrap<ColorKeyFrameAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsNumber()
        && NodeRT::Utils::IsColor(info[1]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Windows::UI::Color arg1 = NodeRT::Utils::ColorFromJs(info[1]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && info[0]->IsNumber()
        && NodeRT::Utils::IsColor(info[1])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[2]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Windows::UI::Color arg1 = NodeRT::Utils::ColorFromJs(info[1]);
          ::Windows::UI::Composition::CompositionEasingFunction^ arg2 = UnwrapCompositionEasingFunction(info[2]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void InterpolationColorSpaceGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ColorKeyFrameAnimation^>(info.This())) {
        return;
      }

      ColorKeyFrameAnimation *wrapper = ColorKeyFrameAnimation::Unwrap<ColorKeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionColorSpace result = wrapper->_instance->InterpolationColorSpace;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void InterpolationColorSpaceSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ColorKeyFrameAnimation^>(info.This())) {
        return;
      }

      ColorKeyFrameAnimation *wrapper = ColorKeyFrameAnimation::Unwrap<ColorKeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::CompositionColorSpace winRtValue = static_cast<::Windows::UI::Composition::CompositionColorSpace>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->InterpolationColorSpace = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void StopBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationStopBehavior result = wrapper->_instance->StopBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StopBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationStopBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationStopBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StopBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->IterationCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationIterationBehavior result = wrapper->_instance->IterationBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationIterationBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationIterationBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DelayTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DelayTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DelayTimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DelayTime = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void KeyFrameCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->KeyFrameCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationDirection result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationDirection winRtValue = static_cast<::Windows::UI::Composition::AnimationDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::ColorKeyFrameAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapColorKeyFrameAnimation(::Windows::UI::Composition::ColorKeyFrameAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::ColorKeyFrameAnimation^ UnwrapColorKeyFrameAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> ColorKeyFrameAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapColorKeyFrameAnimation(::Windows::UI::Composition::ColorKeyFrameAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ColorKeyFrameAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::ColorKeyFrameAnimation^ UnwrapColorKeyFrameAnimation(Local<Value> value) {
     return ColorKeyFrameAnimation::Unwrap<ColorKeyFrameAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitColorKeyFrameAnimation(Local<Object> exports) {
    ColorKeyFrameAnimation::Init(exports);
  }

  class QuaternionKeyFrameAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("QuaternionKeyFrameAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertKeyFrame", InsertKeyFrame);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stopBehavior").ToLocalChecked(), StopBehaviorGetter, StopBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationCount").ToLocalChecked(), IterationCountGetter, IterationCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationBehavior").ToLocalChecked(), IterationBehaviorGetter, IterationBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("delayTime").ToLocalChecked(), DelayTimeGetter, DelayTimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("keyFrameCount").ToLocalChecked(), KeyFrameCountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("QuaternionKeyFrameAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      QuaternionKeyFrameAnimation(::Windows::UI::Composition::QuaternionKeyFrameAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::QuaternionKeyFrameAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::QuaternionKeyFrameAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::QuaternionKeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      QuaternionKeyFrameAnimation *wrapperInstance = new QuaternionKeyFrameAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::QuaternionKeyFrameAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::QuaternionKeyFrameAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::QuaternionKeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapQuaternionKeyFrameAnimation(winRtInstance));
    }


    static void InsertKeyFrame(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::QuaternionKeyFrameAnimation^>(info.This())) {
        return;
      }

      QuaternionKeyFrameAnimation *wrapper = QuaternionKeyFrameAnimation::Unwrap<QuaternionKeyFrameAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsNumber()
        && IsQuaternionJsObject(info[1]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Quaternion arg1 = QuaternionFromJsObject(info[1]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && info[0]->IsNumber()
        && IsQuaternionJsObject(info[1])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[2]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Quaternion arg1 = QuaternionFromJsObject(info[1]);
          ::Windows::UI::Composition::CompositionEasingFunction^ arg2 = UnwrapCompositionEasingFunction(info[2]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StopBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationStopBehavior result = wrapper->_instance->StopBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StopBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationStopBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationStopBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StopBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->IterationCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationIterationBehavior result = wrapper->_instance->IterationBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationIterationBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationIterationBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DelayTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DelayTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DelayTimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DelayTime = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void KeyFrameCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->KeyFrameCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationDirection result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationDirection winRtValue = static_cast<::Windows::UI::Composition::AnimationDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::QuaternionKeyFrameAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapQuaternionKeyFrameAnimation(::Windows::UI::Composition::QuaternionKeyFrameAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::QuaternionKeyFrameAnimation^ UnwrapQuaternionKeyFrameAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> QuaternionKeyFrameAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapQuaternionKeyFrameAnimation(::Windows::UI::Composition::QuaternionKeyFrameAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(QuaternionKeyFrameAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::QuaternionKeyFrameAnimation^ UnwrapQuaternionKeyFrameAnimation(Local<Value> value) {
     return QuaternionKeyFrameAnimation::Unwrap<QuaternionKeyFrameAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitQuaternionKeyFrameAnimation(Local<Object> exports) {
    QuaternionKeyFrameAnimation::Init(exports);
  }

  class ScalarKeyFrameAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("ScalarKeyFrameAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertKeyFrame", InsertKeyFrame);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stopBehavior").ToLocalChecked(), StopBehaviorGetter, StopBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationCount").ToLocalChecked(), IterationCountGetter, IterationCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationBehavior").ToLocalChecked(), IterationBehaviorGetter, IterationBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("delayTime").ToLocalChecked(), DelayTimeGetter, DelayTimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("keyFrameCount").ToLocalChecked(), KeyFrameCountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ScalarKeyFrameAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ScalarKeyFrameAnimation(::Windows::UI::Composition::ScalarKeyFrameAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::ScalarKeyFrameAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ScalarKeyFrameAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::ScalarKeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ScalarKeyFrameAnimation *wrapperInstance = new ScalarKeyFrameAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ScalarKeyFrameAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::ScalarKeyFrameAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::ScalarKeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapScalarKeyFrameAnimation(winRtInstance));
    }


    static void InsertKeyFrame(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ScalarKeyFrameAnimation^>(info.This())) {
        return;
      }

      ScalarKeyFrameAnimation *wrapper = ScalarKeyFrameAnimation::Unwrap<ScalarKeyFrameAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsNumber()
        && info[1]->IsNumber())
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          float arg1 = static_cast<float>(Nan::To<double>(info[1]).FromMaybe(0.0));
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && info[0]->IsNumber()
        && info[1]->IsNumber()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[2]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          float arg1 = static_cast<float>(Nan::To<double>(info[1]).FromMaybe(0.0));
          ::Windows::UI::Composition::CompositionEasingFunction^ arg2 = UnwrapCompositionEasingFunction(info[2]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StopBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationStopBehavior result = wrapper->_instance->StopBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StopBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationStopBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationStopBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StopBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->IterationCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationIterationBehavior result = wrapper->_instance->IterationBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationIterationBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationIterationBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DelayTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DelayTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DelayTimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DelayTime = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void KeyFrameCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->KeyFrameCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationDirection result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationDirection winRtValue = static_cast<::Windows::UI::Composition::AnimationDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::ScalarKeyFrameAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapScalarKeyFrameAnimation(::Windows::UI::Composition::ScalarKeyFrameAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::ScalarKeyFrameAnimation^ UnwrapScalarKeyFrameAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> ScalarKeyFrameAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapScalarKeyFrameAnimation(::Windows::UI::Composition::ScalarKeyFrameAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ScalarKeyFrameAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::ScalarKeyFrameAnimation^ UnwrapScalarKeyFrameAnimation(Local<Value> value) {
     return ScalarKeyFrameAnimation::Unwrap<ScalarKeyFrameAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitScalarKeyFrameAnimation(Local<Object> exports) {
    ScalarKeyFrameAnimation::Init(exports);
  }

  class Vector2KeyFrameAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Vector2KeyFrameAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertKeyFrame", InsertKeyFrame);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stopBehavior").ToLocalChecked(), StopBehaviorGetter, StopBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationCount").ToLocalChecked(), IterationCountGetter, IterationCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationBehavior").ToLocalChecked(), IterationBehaviorGetter, IterationBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("delayTime").ToLocalChecked(), DelayTimeGetter, DelayTimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("keyFrameCount").ToLocalChecked(), KeyFrameCountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("Vector2KeyFrameAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Vector2KeyFrameAnimation(::Windows::UI::Composition::Vector2KeyFrameAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Vector2KeyFrameAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector2KeyFrameAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Vector2KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Vector2KeyFrameAnimation *wrapperInstance = new Vector2KeyFrameAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector2KeyFrameAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Vector2KeyFrameAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Vector2KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapVector2KeyFrameAnimation(winRtInstance));
    }


    static void InsertKeyFrame(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector2KeyFrameAnimation^>(info.This())) {
        return;
      }

      Vector2KeyFrameAnimation *wrapper = Vector2KeyFrameAnimation::Unwrap<Vector2KeyFrameAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsNumber()
        && IsVector2JsObject(info[1]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Vector2 arg1 = Vector2FromJsObject(info[1]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && info[0]->IsNumber()
        && IsVector2JsObject(info[1])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[2]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Vector2 arg1 = Vector2FromJsObject(info[1]);
          ::Windows::UI::Composition::CompositionEasingFunction^ arg2 = UnwrapCompositionEasingFunction(info[2]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StopBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationStopBehavior result = wrapper->_instance->StopBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StopBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationStopBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationStopBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StopBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->IterationCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationIterationBehavior result = wrapper->_instance->IterationBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationIterationBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationIterationBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DelayTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DelayTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DelayTimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DelayTime = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void KeyFrameCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->KeyFrameCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationDirection result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationDirection winRtValue = static_cast<::Windows::UI::Composition::AnimationDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::Vector2KeyFrameAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapVector2KeyFrameAnimation(::Windows::UI::Composition::Vector2KeyFrameAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::Vector2KeyFrameAnimation^ UnwrapVector2KeyFrameAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> Vector2KeyFrameAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapVector2KeyFrameAnimation(::Windows::UI::Composition::Vector2KeyFrameAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Vector2KeyFrameAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Vector2KeyFrameAnimation^ UnwrapVector2KeyFrameAnimation(Local<Value> value) {
     return Vector2KeyFrameAnimation::Unwrap<Vector2KeyFrameAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitVector2KeyFrameAnimation(Local<Object> exports) {
    Vector2KeyFrameAnimation::Init(exports);
  }

  class Vector3KeyFrameAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Vector3KeyFrameAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertKeyFrame", InsertKeyFrame);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stopBehavior").ToLocalChecked(), StopBehaviorGetter, StopBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationCount").ToLocalChecked(), IterationCountGetter, IterationCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationBehavior").ToLocalChecked(), IterationBehaviorGetter, IterationBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("delayTime").ToLocalChecked(), DelayTimeGetter, DelayTimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("keyFrameCount").ToLocalChecked(), KeyFrameCountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("Vector3KeyFrameAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Vector3KeyFrameAnimation(::Windows::UI::Composition::Vector3KeyFrameAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Vector3KeyFrameAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector3KeyFrameAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Vector3KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Vector3KeyFrameAnimation *wrapperInstance = new Vector3KeyFrameAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector3KeyFrameAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Vector3KeyFrameAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Vector3KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapVector3KeyFrameAnimation(winRtInstance));
    }


    static void InsertKeyFrame(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector3KeyFrameAnimation^>(info.This())) {
        return;
      }

      Vector3KeyFrameAnimation *wrapper = Vector3KeyFrameAnimation::Unwrap<Vector3KeyFrameAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsNumber()
        && IsVector3JsObject(info[1]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Vector3 arg1 = Vector3FromJsObject(info[1]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && info[0]->IsNumber()
        && IsVector3JsObject(info[1])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[2]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Vector3 arg1 = Vector3FromJsObject(info[1]);
          ::Windows::UI::Composition::CompositionEasingFunction^ arg2 = UnwrapCompositionEasingFunction(info[2]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StopBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationStopBehavior result = wrapper->_instance->StopBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StopBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationStopBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationStopBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StopBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->IterationCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationIterationBehavior result = wrapper->_instance->IterationBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationIterationBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationIterationBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DelayTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DelayTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DelayTimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DelayTime = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void KeyFrameCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->KeyFrameCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationDirection result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationDirection winRtValue = static_cast<::Windows::UI::Composition::AnimationDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::Vector3KeyFrameAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapVector3KeyFrameAnimation(::Windows::UI::Composition::Vector3KeyFrameAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::Vector3KeyFrameAnimation^ UnwrapVector3KeyFrameAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> Vector3KeyFrameAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapVector3KeyFrameAnimation(::Windows::UI::Composition::Vector3KeyFrameAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Vector3KeyFrameAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Vector3KeyFrameAnimation^ UnwrapVector3KeyFrameAnimation(Local<Value> value) {
     return Vector3KeyFrameAnimation::Unwrap<Vector3KeyFrameAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitVector3KeyFrameAnimation(Local<Object> exports) {
    Vector3KeyFrameAnimation::Init(exports);
  }

  class Vector4KeyFrameAnimation : public WrapperBase {
    public:
      
      static void Init(const Local<Object> exports) {
        HandleScope scope;

        Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
        s_constructorTemplate.Reset(localRef);
        localRef->SetClassName(Nan::New<String>("Vector4KeyFrameAnimation").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "insertKeyFrame", InsertKeyFrame);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("stopBehavior").ToLocalChecked(), StopBehaviorGetter, StopBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationCount").ToLocalChecked(), IterationCountGetter, IterationCountSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("iterationBehavior").ToLocalChecked(), IterationBehaviorGetter, IterationBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("delayTime").ToLocalChecked(), DelayTimeGetter, DelayTimeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("keyFrameCount").ToLocalChecked(), KeyFrameCountGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("direction").ToLocalChecked(), DirectionGetter, DirectionSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("target").ToLocalChecked(), TargetGetter, TargetSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("compositor").ToLocalChecked(), CompositorGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("dispatcher").ToLocalChecked(), DispatcherGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("properties").ToLocalChecked(), PropertiesGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("implicitAnimations").ToLocalChecked(), ImplicitAnimationsGetter, ImplicitAnimationsSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("comment").ToLocalChecked(), CommentGetter, CommentSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("Vector4KeyFrameAnimation").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      Vector4KeyFrameAnimation(::Windows::UI::Composition::Vector4KeyFrameAnimation^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::UI::Composition::Vector4KeyFrameAnimation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector4KeyFrameAnimation^>(info[0])) {
        try {
          winRtInstance = (::Windows::UI::Composition::Vector4KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      Vector4KeyFrameAnimation *wrapperInstance = new Vector4KeyFrameAnimation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector4KeyFrameAnimation^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::UI::Composition::Vector4KeyFrameAnimation^ winRtInstance;
      try {
        winRtInstance = (::Windows::UI::Composition::Vector4KeyFrameAnimation^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapVector4KeyFrameAnimation(winRtInstance));
    }


    static void InsertKeyFrame(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::Vector4KeyFrameAnimation^>(info.This())) {
        return;
      }

      Vector4KeyFrameAnimation *wrapper = Vector4KeyFrameAnimation::Unwrap<Vector4KeyFrameAnimation>(info.This());

      if (info.Length() == 2
        && info[0]->IsNumber()
        && IsVector4JsObject(info[1]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Vector4 arg1 = Vector4FromJsObject(info[1]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 3
        && info[0]->IsNumber()
        && IsVector4JsObject(info[1])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionEasingFunction^>(info[2]))
      {
        try
        {
          float arg0 = static_cast<float>(Nan::To<double>(info[0]).FromMaybe(0.0));
          ::Platform::Numerics::Vector4 arg1 = Vector4FromJsObject(info[1]);
          ::Windows::UI::Composition::CompositionEasingFunction^ arg2 = UnwrapCompositionEasingFunction(info[2]);
          
          wrapper->_instance->InsertKeyFrame(arg0, arg1, arg2);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StopBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationStopBehavior result = wrapper->_instance->StopBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StopBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationStopBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationStopBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->StopBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->IterationCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationCountSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationCount = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void IterationBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationIterationBehavior result = wrapper->_instance->IterationBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void IterationBehaviorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationIterationBehavior winRtValue = static_cast<::Windows::UI::Composition::AnimationIterationBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->IterationBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DelayTimeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DelayTime;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DelayTimeSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DelayTime = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void KeyFrameCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        int result = wrapper->_instance->KeyFrameCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try  {
        ::Windows::UI::Composition::AnimationDirection result = wrapper->_instance->Direction;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DirectionSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsInt32()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::KeyFrameAnimation^>(info.This())) {
        return;
      }

      KeyFrameAnimation *wrapper = KeyFrameAnimation::Unwrap<KeyFrameAnimation>(info.This());

      try {

        ::Windows::UI::Composition::AnimationDirection winRtValue = static_cast<::Windows::UI::Composition::AnimationDirection>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Direction = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void TargetGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Target;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void TargetSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionAnimation^>(info.This())) {
        return;
      }

      CompositionAnimation *wrapper = CompositionAnimation::Unwrap<CompositionAnimation>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Target = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompositorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::Compositor^ result = wrapper->_instance->Compositor;
        info.GetReturnValue().Set(WrapCompositor(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DispatcherGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Core::CoreDispatcher^ result = wrapper->_instance->Dispatcher;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.UI.Core", "CoreDispatcher", result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void PropertiesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::CompositionPropertySet^ result = wrapper->_instance->Properties;
        info.GetReturnValue().Set(WrapCompositionPropertySet(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        ::Windows::UI::Composition::ImplicitAnimationCollection^ result = wrapper->_instance->ImplicitAnimations;
        info.GetReturnValue().Set(WrapImplicitAnimationCollection(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ImplicitAnimationsSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::ImplicitAnimationCollection^>(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        ::Windows::UI::Composition::ImplicitAnimationCollection^ winRtValue = dynamic_cast<::Windows::UI::Composition::ImplicitAnimationCollection^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImplicitAnimations = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CommentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try  {
        Platform::String^ result = wrapper->_instance->Comment;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CommentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsString()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Composition::CompositionObject^>(info.This())) {
        return;
      }

      CompositionObject *wrapper = CompositionObject::Unwrap<CompositionObject>(info.This());

      try {

        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(v8::Isolate::GetCurrent(), value)));

        wrapper->_instance->Comment = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::UI::Composition::Vector4KeyFrameAnimation^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapVector4KeyFrameAnimation(::Windows::UI::Composition::Vector4KeyFrameAnimation^ wintRtInstance);
      friend ::Windows::UI::Composition::Vector4KeyFrameAnimation^ UnwrapVector4KeyFrameAnimation(Local<Value> value);
  };

  Persistent<FunctionTemplate> Vector4KeyFrameAnimation::s_constructorTemplate;

  v8::Local<v8::Value> WrapVector4KeyFrameAnimation(::Windows::UI::Composition::Vector4KeyFrameAnimation^ winRtInstance) {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr) {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(Vector4KeyFrameAnimation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::Composition::Vector4KeyFrameAnimation^ UnwrapVector4KeyFrameAnimation(Local<Value> value) {
     return Vector4KeyFrameAnimation::Unwrap<Vector4KeyFrameAnimation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitVector4KeyFrameAnimation(Local<Object> exports) {
    Vector4KeyFrameAnimation::Init(exports);
  }


} } } } 

NAN_MODULE_INIT(init) {
  // We ignore failures for now since it probably means that
  // the initialization already happened for STA, and that's cool

  CoInitializeEx(nullptr, COINIT_MULTITHREADED);

  /*
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) {
    Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  */

      NodeRT::Windows::UI::Composition::InitAnimationDirectionEnum(target);
      NodeRT::Windows::UI::Composition::InitAnimationIterationBehaviorEnum(target);
      NodeRT::Windows::UI::Composition::InitAnimationStopBehaviorEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionBatchTypesEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionBackfaceVisibilityEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionBitmapInterpolationModeEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionBorderModeEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionColorSpaceEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionCompositeModeEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionEffectFactoryLoadStatusEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionGetValueStatusEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionStretchEnum(target);
      NodeRT::Windows::UI::Composition::InitCompositionObject(target);
      NodeRT::Windows::UI::Composition::InitICompositionAnimationBase(target);
      NodeRT::Windows::UI::Composition::InitCompositionAnimation(target);
      NodeRT::Windows::UI::Composition::InitCompositionBatchCompletedEventArgs(target);
      NodeRT::Windows::UI::Composition::InitCompositionEasingFunction(target);
      NodeRT::Windows::UI::Composition::InitCompositionBrush(target);
      NodeRT::Windows::UI::Composition::InitCompositionEffectBrush(target);
      NodeRT::Windows::UI::Composition::InitCompositionEffectSourceParameter(target);
      NodeRT::Windows::UI::Composition::InitCompositionGraphicsDevice(target);
      NodeRT::Windows::UI::Composition::InitCompositor(target);
      NodeRT::Windows::UI::Composition::InitCompositionPropertySet(target);
      NodeRT::Windows::UI::Composition::InitICompositionSurface(target);
      NodeRT::Windows::UI::Composition::InitCompositionDrawingSurface(target);
      NodeRT::Windows::UI::Composition::InitCompositionColorBrush(target);
      NodeRT::Windows::UI::Composition::InitCompositionEffectFactory(target);
      NodeRT::Windows::UI::Composition::InitCompositionScopedBatch(target);
      NodeRT::Windows::UI::Composition::InitCompositionSurfaceBrush(target);
      NodeRT::Windows::UI::Composition::InitCompositionTarget(target);
      NodeRT::Windows::UI::Composition::InitCompositionCommitBatch(target);
      NodeRT::Windows::UI::Composition::InitCompositionAnimationGroup(target);
      NodeRT::Windows::UI::Composition::InitCompositionBackdropBrush(target);
      NodeRT::Windows::UI::Composition::InitCompositionMaskBrush(target);
      NodeRT::Windows::UI::Composition::InitCompositionNineGridBrush(target);
      NodeRT::Windows::UI::Composition::InitCubicBezierEasingFunction(target);
      NodeRT::Windows::UI::Composition::InitExpressionAnimation(target);
      NodeRT::Windows::UI::Composition::InitImplicitAnimationCollection(target);
      NodeRT::Windows::UI::Composition::InitLinearEasingFunction(target);
      NodeRT::Windows::UI::Composition::InitRenderingDeviceReplacedEventArgs(target);
      NodeRT::Windows::UI::Composition::InitCompositionShadow(target);
      NodeRT::Windows::UI::Composition::InitDropShadow(target);
      NodeRT::Windows::UI::Composition::InitStepEasingFunction(target);
      NodeRT::Windows::UI::Composition::InitVisual(target);
      NodeRT::Windows::UI::Composition::InitContainerVisual(target);
      NodeRT::Windows::UI::Composition::InitSpriteVisual(target);
      NodeRT::Windows::UI::Composition::InitLayerVisual(target);
      NodeRT::Windows::UI::Composition::InitCompositionClip(target);
      NodeRT::Windows::UI::Composition::InitInsetClip(target);
      NodeRT::Windows::UI::Composition::InitVisualCollection(target);
      NodeRT::Windows::UI::Composition::InitVisualUnorderedCollection(target);
      NodeRT::Windows::UI::Composition::InitCompositionLight(target);
      NodeRT::Windows::UI::Composition::InitAmbientLight(target);
      NodeRT::Windows::UI::Composition::InitDistantLight(target);
      NodeRT::Windows::UI::Composition::InitPointLight(target);
      NodeRT::Windows::UI::Composition::InitSpotLight(target);
      NodeRT::Windows::UI::Composition::InitKeyFrameAnimation(target);
      NodeRT::Windows::UI::Composition::InitColorKeyFrameAnimation(target);
      NodeRT::Windows::UI::Composition::InitQuaternionKeyFrameAnimation(target);
      NodeRT::Windows::UI::Composition::InitScalarKeyFrameAnimation(target);
      NodeRT::Windows::UI::Composition::InitVector2KeyFrameAnimation(target);
      NodeRT::Windows::UI::Composition::InitVector3KeyFrameAnimation(target);
      NodeRT::Windows::UI::Composition::InitVector4KeyFrameAnimation(target);


  NodeRT::Utils::RegisterNameSpace("Windows.UI.Composition", target);
}



NODE_MODULE(binding, init)
