// Copyright (c) Microsoft Corporation
// 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.

#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include <string>
#include <node_object_wrap.h>
#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 namespace v8;
using namespace node;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace UI { namespace Input { 
  v8::Handle<v8::Value> WrapEdgeGestureEventArgs(::Windows::UI::Input::EdgeGestureEventArgs^ wintRtInstance);
  ::Windows::UI::Input::EdgeGestureEventArgs^ UnwrapEdgeGestureEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapEdgeGesture(::Windows::UI::Input::EdgeGesture^ wintRtInstance);
  ::Windows::UI::Input::EdgeGesture^ UnwrapEdgeGesture(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapMouseWheelParameters(::Windows::UI::Input::MouseWheelParameters^ wintRtInstance);
  ::Windows::UI::Input::MouseWheelParameters^ UnwrapMouseWheelParameters(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapGestureRecognizer(::Windows::UI::Input::GestureRecognizer^ wintRtInstance);
  ::Windows::UI::Input::GestureRecognizer^ UnwrapGestureRecognizer(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapTappedEventArgs(::Windows::UI::Input::TappedEventArgs^ wintRtInstance);
  ::Windows::UI::Input::TappedEventArgs^ UnwrapTappedEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapRightTappedEventArgs(::Windows::UI::Input::RightTappedEventArgs^ wintRtInstance);
  ::Windows::UI::Input::RightTappedEventArgs^ UnwrapRightTappedEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapHoldingEventArgs(::Windows::UI::Input::HoldingEventArgs^ wintRtInstance);
  ::Windows::UI::Input::HoldingEventArgs^ UnwrapHoldingEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapDraggingEventArgs(::Windows::UI::Input::DraggingEventArgs^ wintRtInstance);
  ::Windows::UI::Input::DraggingEventArgs^ UnwrapDraggingEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapManipulationStartedEventArgs(::Windows::UI::Input::ManipulationStartedEventArgs^ wintRtInstance);
  ::Windows::UI::Input::ManipulationStartedEventArgs^ UnwrapManipulationStartedEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapManipulationUpdatedEventArgs(::Windows::UI::Input::ManipulationUpdatedEventArgs^ wintRtInstance);
  ::Windows::UI::Input::ManipulationUpdatedEventArgs^ UnwrapManipulationUpdatedEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapManipulationInertiaStartingEventArgs(::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ wintRtInstance);
  ::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ UnwrapManipulationInertiaStartingEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapManipulationCompletedEventArgs(::Windows::UI::Input::ManipulationCompletedEventArgs^ wintRtInstance);
  ::Windows::UI::Input::ManipulationCompletedEventArgs^ UnwrapManipulationCompletedEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapCrossSlidingEventArgs(::Windows::UI::Input::CrossSlidingEventArgs^ wintRtInstance);
  ::Windows::UI::Input::CrossSlidingEventArgs^ UnwrapCrossSlidingEventArgs(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapPointerPoint(::Windows::UI::Input::PointerPoint^ wintRtInstance);
  ::Windows::UI::Input::PointerPoint^ UnwrapPointerPoint(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapIPointerPointTransform(::Windows::UI::Input::IPointerPointTransform^ wintRtInstance);
  ::Windows::UI::Input::IPointerPointTransform^ UnwrapIPointerPointTransform(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapPointerPointProperties(::Windows::UI::Input::PointerPointProperties^ wintRtInstance);
  ::Windows::UI::Input::PointerPointProperties^ UnwrapPointerPointProperties(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapPointerVisualizationSettings(::Windows::UI::Input::PointerVisualizationSettings^ wintRtInstance);
  ::Windows::UI::Input::PointerVisualizationSettings^ UnwrapPointerVisualizationSettings(Handle<Value> value);
  


  static v8::Handle<v8::Value> InitEdgeGestureKindEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("EdgeGestureKind"), enumObject);

    enumObject->Set(String::NewSymbol("touch"), Integer::New(0));
    enumObject->Set(String::NewSymbol("keyboard"), Integer::New(1));
    enumObject->Set(String::NewSymbol("mouse"), Integer::New(2));

    return scope.Close(Undefined());
  }


  static v8::Handle<v8::Value> InitHoldingStateEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("HoldingState"), enumObject);

    enumObject->Set(String::NewSymbol("started"), Integer::New(0));
    enumObject->Set(String::NewSymbol("completed"), Integer::New(1));
    enumObject->Set(String::NewSymbol("canceled"), Integer::New(2));

    return scope.Close(Undefined());
  }


  static v8::Handle<v8::Value> InitDraggingStateEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("DraggingState"), enumObject);

    enumObject->Set(String::NewSymbol("started"), Integer::New(0));
    enumObject->Set(String::NewSymbol("continuing"), Integer::New(1));
    enumObject->Set(String::NewSymbol("completed"), Integer::New(2));

    return scope.Close(Undefined());
  }


  static v8::Handle<v8::Value> InitCrossSlidingStateEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("CrossSlidingState"), enumObject);

    enumObject->Set(String::NewSymbol("started"), Integer::New(0));
    enumObject->Set(String::NewSymbol("dragging"), Integer::New(1));
    enumObject->Set(String::NewSymbol("selecting"), Integer::New(2));
    enumObject->Set(String::NewSymbol("selectSpeedBumping"), Integer::New(3));
    enumObject->Set(String::NewSymbol("speedBumping"), Integer::New(4));
    enumObject->Set(String::NewSymbol("rearranging"), Integer::New(5));
    enumObject->Set(String::NewSymbol("completed"), Integer::New(6));

    return scope.Close(Undefined());
  }


  static v8::Handle<v8::Value> InitGestureSettingsEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("GestureSettings"), enumObject);

    enumObject->Set(String::NewSymbol("none"), Integer::New(0));
    enumObject->Set(String::NewSymbol("tap"), Integer::New(1));
    enumObject->Set(String::NewSymbol("doubleTap"), Integer::New(2));
    enumObject->Set(String::NewSymbol("hold"), Integer::New(3));
    enumObject->Set(String::NewSymbol("holdWithMouse"), Integer::New(4));
    enumObject->Set(String::NewSymbol("rightTap"), Integer::New(5));
    enumObject->Set(String::NewSymbol("drag"), Integer::New(6));
    enumObject->Set(String::NewSymbol("manipulationTranslateX"), Integer::New(7));
    enumObject->Set(String::NewSymbol("manipulationTranslateY"), Integer::New(8));
    enumObject->Set(String::NewSymbol("manipulationTranslateRailsX"), Integer::New(9));
    enumObject->Set(String::NewSymbol("manipulationTranslateRailsY"), Integer::New(10));
    enumObject->Set(String::NewSymbol("manipulationRotate"), Integer::New(11));
    enumObject->Set(String::NewSymbol("manipulationScale"), Integer::New(12));
    enumObject->Set(String::NewSymbol("manipulationTranslateInertia"), Integer::New(13));
    enumObject->Set(String::NewSymbol("manipulationRotateInertia"), Integer::New(14));
    enumObject->Set(String::NewSymbol("manipulationScaleInertia"), Integer::New(15));
    enumObject->Set(String::NewSymbol("crossSlide"), Integer::New(16));
    enumObject->Set(String::NewSymbol("manipulationMultipleFingerPanning"), Integer::New(17));

    return scope.Close(Undefined());
  }


  static v8::Handle<v8::Value> InitPointerUpdateKindEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("PointerUpdateKind"), enumObject);

    enumObject->Set(String::NewSymbol("other"), Integer::New(0));
    enumObject->Set(String::NewSymbol("leftButtonPressed"), Integer::New(1));
    enumObject->Set(String::NewSymbol("leftButtonReleased"), Integer::New(2));
    enumObject->Set(String::NewSymbol("rightButtonPressed"), Integer::New(3));
    enumObject->Set(String::NewSymbol("rightButtonReleased"), Integer::New(4));
    enumObject->Set(String::NewSymbol("middleButtonPressed"), Integer::New(5));
    enumObject->Set(String::NewSymbol("middleButtonReleased"), Integer::New(6));
    enumObject->Set(String::NewSymbol("xButton1Pressed"), Integer::New(7));
    enumObject->Set(String::NewSymbol("xButton1Released"), Integer::New(8));
    enumObject->Set(String::NewSymbol("xButton2Pressed"), Integer::New(9));
    enumObject->Set(String::NewSymbol("xButton2Released"), Integer::New(10));

    return scope.Close(Undefined());
  }



  
  static bool IsManipulationDeltaJsObject(Handle<Value> value)
  {
    if (!value->IsObject())
    {
      return false;
    }

    Handle<String> symbol;
    Handle<Object> obj = value.As<Object>();

    symbol = String::NewSymbol("translation");
    if (obj->Has(symbol))
    {
      if (!NodeRT::Utils::IsPoint(obj->Get(symbol)))
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("scale");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("rotation");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("expansion");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    return true;
  }

  ::Windows::UI::Input::ManipulationDelta ManipulationDeltaFromJsObject(Handle<Value> value)
  {
    HandleScope scope;
    ::Windows::UI::Input::ManipulationDelta returnValue;
    
    if (!value->IsObject())
    {
      ThrowException(Exception::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Handle<Object> obj = value.As<Object>();
    Handle<String> symbol;

    symbol = String::NewSymbol("translation");
    if (obj->Has(symbol))
    {
      returnValue.Translation = NodeRT::Utils::PointFromJs(obj->Get(symbol));
    }
    
    symbol = String::NewSymbol("scale");
    if (obj->Has(symbol))
    {
      returnValue.Scale = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    symbol = String::NewSymbol("rotation");
    if (obj->Has(symbol))
    {
      returnValue.Rotation = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    symbol = String::NewSymbol("expansion");
    if (obj->Has(symbol))
    {
      returnValue.Expansion = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    return returnValue;
  }

  Handle<Value> ManipulationDeltaToJsObject(::Windows::UI::Input::ManipulationDelta value)
  {
    HandleScope scope;

    Handle<Object> obj = Object::New();

    obj->Set(String::NewSymbol("translation"), NodeRT::Utils::PointToJs(value.Translation));
    obj->Set(String::NewSymbol("scale"), Number::New(static_cast<double>(value.Scale)));
    obj->Set(String::NewSymbol("rotation"), Number::New(static_cast<double>(value.Rotation)));
    obj->Set(String::NewSymbol("expansion"), Number::New(static_cast<double>(value.Expansion)));
    
    return scope.Close(obj);
  }

  
  static bool IsManipulationVelocitiesJsObject(Handle<Value> value)
  {
    if (!value->IsObject())
    {
      return false;
    }

    Handle<String> symbol;
    Handle<Object> obj = value.As<Object>();

    symbol = String::NewSymbol("linear");
    if (obj->Has(symbol))
    {
      if (!NodeRT::Utils::IsPoint(obj->Get(symbol)))
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("angular");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("expansion");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    return true;
  }

  ::Windows::UI::Input::ManipulationVelocities ManipulationVelocitiesFromJsObject(Handle<Value> value)
  {
    HandleScope scope;
    ::Windows::UI::Input::ManipulationVelocities returnValue;
    
    if (!value->IsObject())
    {
      ThrowException(Exception::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Handle<Object> obj = value.As<Object>();
    Handle<String> symbol;

    symbol = String::NewSymbol("linear");
    if (obj->Has(symbol))
    {
      returnValue.Linear = NodeRT::Utils::PointFromJs(obj->Get(symbol));
    }
    
    symbol = String::NewSymbol("angular");
    if (obj->Has(symbol))
    {
      returnValue.Angular = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    symbol = String::NewSymbol("expansion");
    if (obj->Has(symbol))
    {
      returnValue.Expansion = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    return returnValue;
  }

  Handle<Value> ManipulationVelocitiesToJsObject(::Windows::UI::Input::ManipulationVelocities value)
  {
    HandleScope scope;

    Handle<Object> obj = Object::New();

    obj->Set(String::NewSymbol("linear"), NodeRT::Utils::PointToJs(value.Linear));
    obj->Set(String::NewSymbol("angular"), Number::New(static_cast<double>(value.Angular)));
    obj->Set(String::NewSymbol("expansion"), Number::New(static_cast<double>(value.Expansion)));
    
    return scope.Close(obj);
  }

  
  static bool IsCrossSlideThresholdsJsObject(Handle<Value> value)
  {
    if (!value->IsObject())
    {
      return false;
    }

    Handle<String> symbol;
    Handle<Object> obj = value.As<Object>();

    symbol = String::NewSymbol("selectionStart");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("speedBumpStart");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("speedBumpEnd");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("rearrangeStart");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsNumber())
      {
          return false;
      }
    }
    
    return true;
  }

  ::Windows::UI::Input::CrossSlideThresholds CrossSlideThresholdsFromJsObject(Handle<Value> value)
  {
    HandleScope scope;
    ::Windows::UI::Input::CrossSlideThresholds returnValue;
    
    if (!value->IsObject())
    {
      ThrowException(Exception::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Handle<Object> obj = value.As<Object>();
    Handle<String> symbol;

    symbol = String::NewSymbol("selectionStart");
    if (obj->Has(symbol))
    {
      returnValue.SelectionStart = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    symbol = String::NewSymbol("speedBumpStart");
    if (obj->Has(symbol))
    {
      returnValue.SpeedBumpStart = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    symbol = String::NewSymbol("speedBumpEnd");
    if (obj->Has(symbol))
    {
      returnValue.SpeedBumpEnd = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    symbol = String::NewSymbol("rearrangeStart");
    if (obj->Has(symbol))
    {
      returnValue.RearrangeStart = static_cast<float>(obj->Get(symbol)->NumberValue());
    }
    
    return returnValue;
  }

  Handle<Value> CrossSlideThresholdsToJsObject(::Windows::UI::Input::CrossSlideThresholds value)
  {
    HandleScope scope;

    Handle<Object> obj = Object::New();

    obj->Set(String::NewSymbol("selectionStart"), Number::New(static_cast<double>(value.SelectionStart)));
    obj->Set(String::NewSymbol("speedBumpStart"), Number::New(static_cast<double>(value.SpeedBumpStart)));
    obj->Set(String::NewSymbol("speedBumpEnd"), Number::New(static_cast<double>(value.SpeedBumpEnd)));
    obj->Set(String::NewSymbol("rearrangeStart"), Number::New(static_cast<double>(value.RearrangeStart)));
    
    return scope.Close(obj);
  }

  
  static bool IsPointJsObject(Handle<Value> value)
  {
    if (!value->IsObject())
    {
      return false;
    }

    Handle<String> symbol;
    Handle<Object> obj = value.As<Object>();

    return true;
  }

  ::Windows::Foundation::Point PointFromJsObject(Handle<Value> value)
  {
    HandleScope scope;
    ::Windows::Foundation::Point returnValue;
    
    if (!value->IsObject())
    {
      ThrowException(Exception::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Handle<Object> obj = value.As<Object>();
    Handle<String> symbol;

    return returnValue;
  }

  Handle<Value> PointToJsObject(::Windows::Foundation::Point value)
  {
    HandleScope scope;

    Handle<Object> obj = Object::New();

    
    return scope.Close(obj);
  }

  
  static bool IsRectJsObject(Handle<Value> value)
  {
    if (!value->IsObject())
    {
      return false;
    }

    Handle<String> symbol;
    Handle<Object> obj = value.As<Object>();

    return true;
  }

  ::Windows::Foundation::Rect RectFromJsObject(Handle<Value> value)
  {
    HandleScope scope;
    ::Windows::Foundation::Rect returnValue;
    
    if (!value->IsObject())
    {
      ThrowException(Exception::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Handle<Object> obj = value.As<Object>();
    Handle<String> symbol;

    return returnValue;
  }

  Handle<Value> RectToJsObject(::Windows::Foundation::Rect value)
  {
    HandleScope scope;

    Handle<Object> obj = Object::New();

    
    return scope.Close(obj);
  }

  
  class EdgeGestureEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("EdgeGestureEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("kind"), KindGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("EdgeGestureEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    EdgeGestureEventArgs(::Windows::UI::Input::EdgeGestureEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::EdgeGestureEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGestureEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::EdgeGestureEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      EdgeGestureEventArgs *wrapperInstance = new EdgeGestureEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> KindGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGestureEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      EdgeGestureEventArgs *wrapper = EdgeGestureEventArgs::Unwrap<EdgeGestureEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::EdgeGestureKind result = wrapper->_instance->Kind;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::EdgeGestureEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapEdgeGestureEventArgs(::Windows::UI::Input::EdgeGestureEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::EdgeGestureEventArgs^ UnwrapEdgeGestureEventArgs(Handle<Value> value);
    friend bool IsEdgeGestureEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> EdgeGestureEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapEdgeGestureEventArgs(::Windows::UI::Input::EdgeGestureEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(EdgeGestureEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::EdgeGestureEventArgs^ UnwrapEdgeGestureEventArgs(Handle<Value> value)
  {
     return EdgeGestureEventArgs::Unwrap<EdgeGestureEventArgs>(value.As<Object>())->_instance;
  }

  void InitEdgeGestureEventArgs(Handle<Object> exports)
  {
    EdgeGestureEventArgs::Init(exports);
  }

  class EdgeGesture : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("EdgeGesture"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                        
      Local<Function> addListenerFunc = FunctionTemplate::New(AddListener)->GetFunction();
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("addListener"), addListenerFunc);
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("on"), addListenerFunc);
      Local<Function> removeListenerFunc = FunctionTemplate::New(RemoveListener)->GetFunction();
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("removeListener"), removeListenerFunc);
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("off"), removeListenerFunc);
            
      Local<Function> constructor = s_constructorTemplate->GetFunction();

      constructor->Set(String::NewSymbol("getForCurrentView"), FunctionTemplate::New(GetForCurrentView)->GetFunction());

      exports->Set(String::NewSymbol("EdgeGesture"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    EdgeGesture(::Windows::UI::Input::EdgeGesture^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::EdgeGesture^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGesture^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::EdgeGesture^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      EdgeGesture *wrapperInstance = new EdgeGesture(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  


    static Handle<Value> GetForCurrentView(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() == 0)
      {
        try
        {
          ::Windows::UI::Input::EdgeGesture^ result;
          result = ::Windows::UI::Input::EdgeGesture::GetForCurrentView();
          return scope.Close(WrapEdgeGesture(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static v8::Handle<v8::Value> AddListener(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsFunction())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return scope.Close(Undefined());
      }

      String::Value eventName(args[0]);
      auto str = *eventName;
      
      Local<Function> callback = args[1].As<Function>();
      
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"canceled", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGesture^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        EdgeGesture *wrapper = EdgeGesture::Unwrap<EdgeGesture>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Canceled::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::EdgeGesture^, ::Windows::UI::Input::EdgeGestureEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::EdgeGesture^ arg0, ::Windows::UI::Input::EdgeGestureEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapEdgeGesture(arg0);
                Handle<Value> wrappedArg1 = WrapEdgeGestureEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"completed", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGesture^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        EdgeGesture *wrapper = EdgeGesture::Unwrap<EdgeGesture>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Completed::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::EdgeGesture^, ::Windows::UI::Input::EdgeGestureEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::EdgeGesture^ arg0, ::Windows::UI::Input::EdgeGestureEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapEdgeGesture(arg0);
                Handle<Value> wrappedArg1 = WrapEdgeGestureEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"starting", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGesture^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        EdgeGesture *wrapper = EdgeGesture::Unwrap<EdgeGesture>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Starting::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::EdgeGesture^, ::Windows::UI::Input::EdgeGestureEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::EdgeGesture^ arg0, ::Windows::UI::Input::EdgeGestureEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapEdgeGesture(arg0);
                Handle<Value> wrappedArg1 = WrapEdgeGestureEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else 
      {
        ThrowException(Exception::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), args[0].As<String>())));
        return scope.Close(Undefined());
      }

      Local<Value> tokenMap = callback->GetHiddenValue(String::NewSymbol(REGISTRATION_TOKEN_MAP_PROPERTY_NAME));
                
      if (tokenMap.IsEmpty() || tokenMap->Equals(Undefined()))
      {
          tokenMap = Object::New();
          callback->SetHiddenValue(String::NewSymbol(REGISTRATION_TOKEN_MAP_PROPERTY_NAME), tokenMap);
      }

      tokenMap.As<Object>()->Set(args[1], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
                
      return scope.Close(Undefined());
    }

    static v8::Handle<v8::Value> RemoveListener(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsFunction())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return scope.Close(Undefined());
      }

      String::Value eventName(args[0]);
      auto str = *eventName;

      if ((NodeRT::Utils::CaseInsenstiveEquals(L"canceled", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"completed", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"starting", str)))
      {
        ThrowException(Exception::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), args[0].As<String>())));
        return scope.Close(Undefined());
      }

      Local<Function> callback = args[1].As<Function>();
      Handle<Value> tokenMap = callback->GetHiddenValue(String::NewSymbol(REGISTRATION_TOKEN_MAP_PROPERTY_NAME));
                
      if (tokenMap.IsEmpty() || tokenMap->Equals(Undefined()))
      {
        return scope.Close(Undefined());
      }

      Handle<Value> opaqueWrapperObj =  tokenMap.As<Object>()->Get(args[1]);

      if (opaqueWrapperObj.IsEmpty() || opaqueWrapperObj->Equals(Undefined()))
      {
        return scope.Close(Undefined());
      }

      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"canceled", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGesture^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          EdgeGesture *wrapper = EdgeGesture::Unwrap<EdgeGesture>(args.This());
          wrapper->_instance->Canceled::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"completed", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGesture^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          EdgeGesture *wrapper = EdgeGesture::Unwrap<EdgeGesture>(args.This());
          wrapper->_instance->Completed::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"starting", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::EdgeGesture^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          EdgeGesture *wrapper = EdgeGesture::Unwrap<EdgeGesture>(args.This());
          wrapper->_instance->Starting::remove(registrationToken);
        }
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      tokenMap.As<Object>()->Delete(args[0].As<String>());

      return scope.Close(Undefined());
    }
  private:
    ::Windows::UI::Input::EdgeGesture^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapEdgeGesture(::Windows::UI::Input::EdgeGesture^ wintRtInstance);
    friend ::Windows::UI::Input::EdgeGesture^ UnwrapEdgeGesture(Handle<Value> value);
    friend bool IsEdgeGestureWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> EdgeGesture::s_constructorTemplate;

  v8::Handle<v8::Value> WrapEdgeGesture(::Windows::UI::Input::EdgeGesture^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(EdgeGesture::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::EdgeGesture^ UnwrapEdgeGesture(Handle<Value> value)
  {
     return EdgeGesture::Unwrap<EdgeGesture>(value.As<Object>())->_instance;
  }

  void InitEdgeGesture(Handle<Object> exports)
  {
    EdgeGesture::Init(exports);
  }

  class MouseWheelParameters : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("MouseWheelParameters"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pageTranslation"), PageTranslationGetter, PageTranslationSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("deltaScale"), DeltaScaleGetter, DeltaScaleSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("deltaRotationAngle"), DeltaRotationAngleGetter, DeltaRotationAngleSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("charTranslation"), CharTranslationGetter, CharTranslationSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("MouseWheelParameters"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    MouseWheelParameters(::Windows::UI::Input::MouseWheelParameters^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::MouseWheelParameters^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::MouseWheelParameters^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      MouseWheelParameters *wrapperInstance = new MouseWheelParameters(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> PageTranslationGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->PageTranslation;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void PageTranslationSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsPoint(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return;
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        
        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->PageTranslation = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> DeltaScaleGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        float result = wrapper->_instance->DeltaScale;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void DeltaScaleSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return;
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->DeltaScale = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> DeltaRotationAngleGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        float result = wrapper->_instance->DeltaRotationAngle;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void DeltaRotationAngleSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return;
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->DeltaRotationAngle = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> CharTranslationGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->CharTranslation;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void CharTranslationSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsPoint(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::MouseWheelParameters^>(info.This()))
      {
        return;
      }

      MouseWheelParameters *wrapper = MouseWheelParameters::Unwrap<MouseWheelParameters>(info.This());

      try 
      {
        
        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->CharTranslation = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::UI::Input::MouseWheelParameters^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapMouseWheelParameters(::Windows::UI::Input::MouseWheelParameters^ wintRtInstance);
    friend ::Windows::UI::Input::MouseWheelParameters^ UnwrapMouseWheelParameters(Handle<Value> value);
    friend bool IsMouseWheelParametersWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> MouseWheelParameters::s_constructorTemplate;

  v8::Handle<v8::Value> WrapMouseWheelParameters(::Windows::UI::Input::MouseWheelParameters^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(MouseWheelParameters::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::MouseWheelParameters^ UnwrapMouseWheelParameters(Handle<Value> value)
  {
     return MouseWheelParameters::Unwrap<MouseWheelParameters>(value.As<Object>())->_instance;
  }

  void InitMouseWheelParameters(Handle<Object> exports)
  {
    MouseWheelParameters::Init(exports);
  }

  class GestureRecognizer : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("GestureRecognizer"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("canBeDoubleTap"), FunctionTemplate::New(CanBeDoubleTap)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("processDownEvent"), FunctionTemplate::New(ProcessDownEvent)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("processMoveEvents"), FunctionTemplate::New(ProcessMoveEvents)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("processUpEvent"), FunctionTemplate::New(ProcessUpEvent)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("processMouseWheelEvent"), FunctionTemplate::New(ProcessMouseWheelEvent)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("processInertia"), FunctionTemplate::New(ProcessInertia)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("completeGesture"), FunctionTemplate::New(CompleteGesture)->GetFunction());
      
                  
      Local<Function> addListenerFunc = FunctionTemplate::New(AddListener)->GetFunction();
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("addListener"), addListenerFunc);
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("on"), addListenerFunc);
      Local<Function> removeListenerFunc = FunctionTemplate::New(RemoveListener)->GetFunction();
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("removeListener"), removeListenerFunc);
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("off"), removeListenerFunc);
            
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("inertiaRotationDeceleration"), InertiaRotationDecelerationGetter, InertiaRotationDecelerationSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("inertiaRotationAngle"), InertiaRotationAngleGetter, InertiaRotationAngleSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("inertiaExpansionDeceleration"), InertiaExpansionDecelerationGetter, InertiaExpansionDecelerationSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("inertiaExpansion"), InertiaExpansionGetter, InertiaExpansionSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("gestureSettings"), GestureSettingsGetter, GestureSettingsSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("crossSlideThresholds"), CrossSlideThresholdsGetter, CrossSlideThresholdsSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("crossSlideHorizontally"), CrossSlideHorizontallyGetter, CrossSlideHorizontallySetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("crossSlideExact"), CrossSlideExactGetter, CrossSlideExactSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("autoProcessInertia"), AutoProcessInertiaGetter, AutoProcessInertiaSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("showGestureFeedback"), ShowGestureFeedbackGetter, ShowGestureFeedbackSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pivotRadius"), PivotRadiusGetter, PivotRadiusSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pivotCenter"), PivotCenterGetter, PivotCenterSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("manipulationExact"), ManipulationExactGetter, ManipulationExactSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("inertiaTranslationDisplacement"), InertiaTranslationDisplacementGetter, InertiaTranslationDisplacementSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("inertiaTranslationDeceleration"), InertiaTranslationDecelerationGetter, InertiaTranslationDecelerationSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isActive"), IsActiveGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isInertial"), IsInertialGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("mouseWheelParameters"), MouseWheelParametersGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("GestureRecognizer"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    GestureRecognizer(::Windows::UI::Input::GestureRecognizer^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::GestureRecognizer^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::GestureRecognizer^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::UI::Input::GestureRecognizer();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      GestureRecognizer *wrapperInstance = new GestureRecognizer(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> CanBeDoubleTap(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());

      if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(args[0]))
      {
        try
        {
          ::Windows::UI::Input::PointerPoint^ arg0 = UnwrapPointerPoint(args[0]);
          
          bool result;
          result = wrapper->_instance->CanBeDoubleTap(arg0);
          return scope.Close(Boolean::New(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> ProcessDownEvent(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());

      if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(args[0]))
      {
        try
        {
          ::Windows::UI::Input::PointerPoint^ arg0 = UnwrapPointerPoint(args[0]);
          
          wrapper->_instance->ProcessDownEvent(arg0);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> ProcessMoveEvents(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());

      if (args.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Collections::IVector<::Windows::UI::Input::PointerPoint^>^>(args[0]) || args[0]->IsArray()))
      {
        try
        {
          ::Windows::Foundation::Collections::IVector<::Windows::UI::Input::PointerPoint^>^ arg0 = 
            [] (v8::Handle<v8::Value> value) -> ::Windows::Foundation::Collections::IVector<::Windows::UI::Input::PointerPoint^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtVector<::Windows::UI::Input::PointerPoint^>(value.As<Array>(), 
                 [](Handle<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(value);
                 },
                 [](Handle<Value> value) -> ::Windows::UI::Input::PointerPoint^ {
                   return UnwrapPointerPoint(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Windows::Foundation::Collections::IVector<::Windows::UI::Input::PointerPoint^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (args[0]);
          
          wrapper->_instance->ProcessMoveEvents(arg0);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> ProcessUpEvent(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());

      if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(args[0]))
      {
        try
        {
          ::Windows::UI::Input::PointerPoint^ arg0 = UnwrapPointerPoint(args[0]);
          
          wrapper->_instance->ProcessUpEvent(arg0);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> ProcessMouseWheelEvent(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());

      if (args.Length() == 3
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(args[0])
        && args[1]->IsBoolean()
        && args[2]->IsBoolean())
      {
        try
        {
          ::Windows::UI::Input::PointerPoint^ arg0 = UnwrapPointerPoint(args[0]);
          bool arg1 = args[1]->BooleanValue();
          bool arg2 = args[2]->BooleanValue();
          
          wrapper->_instance->ProcessMouseWheelEvent(arg0, arg1, arg2);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> ProcessInertia(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());

      if (args.Length() == 0)
      {
        try
        {
          wrapper->_instance->ProcessInertia();
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> CompleteGesture(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());

      if (args.Length() == 0)
      {
        try
        {
          wrapper->_instance->CompleteGesture();
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> InertiaRotationDecelerationGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        float result = wrapper->_instance->InertiaRotationDeceleration;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void InertiaRotationDecelerationSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->InertiaRotationDeceleration = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> InertiaRotationAngleGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        float result = wrapper->_instance->InertiaRotationAngle;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void InertiaRotationAngleSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->InertiaRotationAngle = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> InertiaExpansionDecelerationGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        float result = wrapper->_instance->InertiaExpansionDeceleration;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void InertiaExpansionDecelerationSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->InertiaExpansionDeceleration = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> InertiaExpansionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        float result = wrapper->_instance->InertiaExpansion;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void InertiaExpansionSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->InertiaExpansion = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> GestureSettingsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        ::Windows::UI::Input::GestureSettings result = wrapper->_instance->GestureSettings;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void GestureSettingsSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsInt32())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        ::Windows::UI::Input::GestureSettings winRtValue = static_cast<::Windows::UI::Input::GestureSettings>(value->Int32Value());

        wrapper->_instance->GestureSettings = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> CrossSlideThresholdsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        ::Windows::UI::Input::CrossSlideThresholds result = wrapper->_instance->CrossSlideThresholds;
        return scope.Close(CrossSlideThresholdsToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void CrossSlideThresholdsSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!IsCrossSlideThresholdsJsObject(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        ::Windows::UI::Input::CrossSlideThresholds winRtValue = CrossSlideThresholdsFromJsObject(value);

        wrapper->_instance->CrossSlideThresholds = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> CrossSlideHorizontallyGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        bool result = wrapper->_instance->CrossSlideHorizontally;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void CrossSlideHorizontallySetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->CrossSlideHorizontally = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> CrossSlideExactGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        bool result = wrapper->_instance->CrossSlideExact;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void CrossSlideExactSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->CrossSlideExact = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AutoProcessInertiaGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        bool result = wrapper->_instance->AutoProcessInertia;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void AutoProcessInertiaSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->AutoProcessInertia = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ShowGestureFeedbackGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        bool result = wrapper->_instance->ShowGestureFeedback;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ShowGestureFeedbackSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->ShowGestureFeedback = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> PivotRadiusGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        float result = wrapper->_instance->PivotRadius;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void PivotRadiusSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->PivotRadius = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> PivotCenterGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->PivotCenter;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void PivotCenterSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsPoint(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        ::Windows::Foundation::Point winRtValue = NodeRT::Utils::PointFromJs(value);

        wrapper->_instance->PivotCenter = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ManipulationExactGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        bool result = wrapper->_instance->ManipulationExact;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ManipulationExactSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->ManipulationExact = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> InertiaTranslationDisplacementGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        float result = wrapper->_instance->InertiaTranslationDisplacement;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void InertiaTranslationDisplacementSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->InertiaTranslationDisplacement = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> InertiaTranslationDecelerationGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        float result = wrapper->_instance->InertiaTranslationDeceleration;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void InertiaTranslationDecelerationSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return;
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(value->NumberValue());

        wrapper->_instance->InertiaTranslationDeceleration = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> IsActiveGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsActive;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsInertialGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsInertial;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> MouseWheelParametersGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(info.This());

      try 
      {
        ::Windows::UI::Input::MouseWheelParameters^ result = wrapper->_instance->MouseWheelParameters;
        return scope.Close(WrapMouseWheelParameters(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


    static v8::Handle<v8::Value> AddListener(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsFunction())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return scope.Close(Undefined());
      }

      String::Value eventName(args[0]);
      auto str = *eventName;
      
      Local<Function> callback = args[1].As<Function>();
      
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"crossSliding", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->CrossSliding::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::CrossSlidingEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::CrossSlidingEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapCrossSlidingEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"dragging", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Dragging::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::DraggingEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::DraggingEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapDraggingEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"holding", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Holding::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::HoldingEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::HoldingEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapHoldingEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationCompleted", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ManipulationCompleted::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::ManipulationCompletedEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::ManipulationCompletedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapManipulationCompletedEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationInertiaStarting", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ManipulationInertiaStarting::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::ManipulationInertiaStartingEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapManipulationInertiaStartingEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationStarted", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ManipulationStarted::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::ManipulationStartedEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::ManipulationStartedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapManipulationStartedEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationUpdated", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->ManipulationUpdated::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::ManipulationUpdatedEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::ManipulationUpdatedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapManipulationUpdatedEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"rightTapped", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->RightTapped::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::RightTappedEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::RightTappedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapRightTappedEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"tapped", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
        {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
          return scope.Close(Undefined());
        }
        GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
      
        try
        {
          std::shared_ptr<Persistent<Object>> callbackObjPtr(new Persistent<Object>(Persistent<Object>::New(NodeRT::Utils::CreateCallbackObjectInDomain(callback))), 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Dispose();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Tapped::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::UI::Input::GestureRecognizer^, ::Windows::UI::Input::TappedEventArgs^>(
            [callbackObjPtr](::Windows::UI::Input::GestureRecognizer^ arg0, ::Windows::UI::Input::TappedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Handle<Value> error;

                Handle<Value> wrappedArg0 = WrapGestureRecognizer(arg0);
                Handle<Value> wrappedArg1 = WrapTappedEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = tryCatch.Exception()->ToObject();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Handle<Value> args[] = { wrappedArg0, wrappedArg1 };
                NodeRT::Utils::CallCallbackInDomain(*callbackObjPtr, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }

      }
      else 
      {
        ThrowException(Exception::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), args[0].As<String>())));
        return scope.Close(Undefined());
      }

      Local<Value> tokenMap = callback->GetHiddenValue(String::NewSymbol(REGISTRATION_TOKEN_MAP_PROPERTY_NAME));
                
      if (tokenMap.IsEmpty() || tokenMap->Equals(Undefined()))
      {
          tokenMap = Object::New();
          callback->SetHiddenValue(String::NewSymbol(REGISTRATION_TOKEN_MAP_PROPERTY_NAME), tokenMap);
      }

      tokenMap.As<Object>()->Set(args[1], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
                
      return scope.Close(Undefined());
    }

    static v8::Handle<v8::Value> RemoveListener(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() < 2 || !args[0]->IsString() || !args[1]->IsFunction())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return scope.Close(Undefined());
      }

      String::Value eventName(args[0]);
      auto str = *eventName;

      if ((NodeRT::Utils::CaseInsenstiveEquals(L"crossSliding", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"dragging", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"holding", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"manipulationCompleted", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"manipulationInertiaStarting", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"manipulationStarted", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"manipulationUpdated", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"rightTapped", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"tapped", str)))
      {
        ThrowException(Exception::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), args[0].As<String>())));
        return scope.Close(Undefined());
      }

      Local<Function> callback = args[1].As<Function>();
      Handle<Value> tokenMap = callback->GetHiddenValue(String::NewSymbol(REGISTRATION_TOKEN_MAP_PROPERTY_NAME));
                
      if (tokenMap.IsEmpty() || tokenMap->Equals(Undefined()))
      {
        return scope.Close(Undefined());
      }

      Handle<Value> opaqueWrapperObj =  tokenMap.As<Object>()->Get(args[1]);

      if (opaqueWrapperObj.IsEmpty() || opaqueWrapperObj->Equals(Undefined()))
      {
        return scope.Close(Undefined());
      }

      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"crossSliding", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->CrossSliding::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"dragging", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->Dragging::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"holding", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->Holding::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationCompleted", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->ManipulationCompleted::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationInertiaStarting", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->ManipulationInertiaStarting::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationStarted", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->ManipulationStarted::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"manipulationUpdated", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->ManipulationUpdated::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"rightTapped", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->RightTapped::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"tapped", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::GestureRecognizer^>(args.This()))
          {
            ThrowException(Exception::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return scope.Close(Undefined());
          }
          GestureRecognizer *wrapper = GestureRecognizer::Unwrap<GestureRecognizer>(args.This());
          wrapper->_instance->Tapped::remove(registrationToken);
        }
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      tokenMap.As<Object>()->Delete(args[0].As<String>());

      return scope.Close(Undefined());
    }
  private:
    ::Windows::UI::Input::GestureRecognizer^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapGestureRecognizer(::Windows::UI::Input::GestureRecognizer^ wintRtInstance);
    friend ::Windows::UI::Input::GestureRecognizer^ UnwrapGestureRecognizer(Handle<Value> value);
    friend bool IsGestureRecognizerWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> GestureRecognizer::s_constructorTemplate;

  v8::Handle<v8::Value> WrapGestureRecognizer(::Windows::UI::Input::GestureRecognizer^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(GestureRecognizer::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::GestureRecognizer^ UnwrapGestureRecognizer(Handle<Value> value)
  {
     return GestureRecognizer::Unwrap<GestureRecognizer>(value.As<Object>())->_instance;
  }

  void InitGestureRecognizer(Handle<Object> exports)
  {
    GestureRecognizer::Init(exports);
  }

  class TappedEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("TappedEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("tapCount"), TapCountGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("TappedEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    TappedEventArgs(::Windows::UI::Input::TappedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::TappedEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::TappedEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::TappedEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      TappedEventArgs *wrapperInstance = new TappedEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::TappedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      TappedEventArgs *wrapper = TappedEventArgs::Unwrap<TappedEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::TappedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      TappedEventArgs *wrapper = TappedEventArgs::Unwrap<TappedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> TapCountGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::TappedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      TappedEventArgs *wrapper = TappedEventArgs::Unwrap<TappedEventArgs>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->TapCount;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::TappedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapTappedEventArgs(::Windows::UI::Input::TappedEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::TappedEventArgs^ UnwrapTappedEventArgs(Handle<Value> value);
    friend bool IsTappedEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> TappedEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapTappedEventArgs(::Windows::UI::Input::TappedEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(TappedEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::TappedEventArgs^ UnwrapTappedEventArgs(Handle<Value> value)
  {
     return TappedEventArgs::Unwrap<TappedEventArgs>(value.As<Object>())->_instance;
  }

  void InitTappedEventArgs(Handle<Object> exports)
  {
    TappedEventArgs::Init(exports);
  }

  class RightTappedEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("RightTappedEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("RightTappedEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    RightTappedEventArgs(::Windows::UI::Input::RightTappedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::RightTappedEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::RightTappedEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::RightTappedEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      RightTappedEventArgs *wrapperInstance = new RightTappedEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::RightTappedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      RightTappedEventArgs *wrapper = RightTappedEventArgs::Unwrap<RightTappedEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::RightTappedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      RightTappedEventArgs *wrapper = RightTappedEventArgs::Unwrap<RightTappedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::RightTappedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapRightTappedEventArgs(::Windows::UI::Input::RightTappedEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::RightTappedEventArgs^ UnwrapRightTappedEventArgs(Handle<Value> value);
    friend bool IsRightTappedEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> RightTappedEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapRightTappedEventArgs(::Windows::UI::Input::RightTappedEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(RightTappedEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::RightTappedEventArgs^ UnwrapRightTappedEventArgs(Handle<Value> value)
  {
     return RightTappedEventArgs::Unwrap<RightTappedEventArgs>(value.As<Object>())->_instance;
  }

  void InitRightTappedEventArgs(Handle<Object> exports)
  {
    RightTappedEventArgs::Init(exports);
  }

  class HoldingEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("HoldingEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("holdingState"), HoldingStateGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("HoldingEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    HoldingEventArgs(::Windows::UI::Input::HoldingEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::HoldingEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::HoldingEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::HoldingEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      HoldingEventArgs *wrapperInstance = new HoldingEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> HoldingStateGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::HoldingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      HoldingEventArgs *wrapper = HoldingEventArgs::Unwrap<HoldingEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::HoldingState result = wrapper->_instance->HoldingState;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::HoldingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      HoldingEventArgs *wrapper = HoldingEventArgs::Unwrap<HoldingEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::HoldingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      HoldingEventArgs *wrapper = HoldingEventArgs::Unwrap<HoldingEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::HoldingEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapHoldingEventArgs(::Windows::UI::Input::HoldingEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::HoldingEventArgs^ UnwrapHoldingEventArgs(Handle<Value> value);
    friend bool IsHoldingEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> HoldingEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapHoldingEventArgs(::Windows::UI::Input::HoldingEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(HoldingEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::HoldingEventArgs^ UnwrapHoldingEventArgs(Handle<Value> value)
  {
     return HoldingEventArgs::Unwrap<HoldingEventArgs>(value.As<Object>())->_instance;
  }

  void InitHoldingEventArgs(Handle<Object> exports)
  {
    HoldingEventArgs::Init(exports);
  }

  class DraggingEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("DraggingEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("draggingState"), DraggingStateGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("DraggingEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    DraggingEventArgs(::Windows::UI::Input::DraggingEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::DraggingEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::DraggingEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::DraggingEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      DraggingEventArgs *wrapperInstance = new DraggingEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> DraggingStateGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::DraggingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      DraggingEventArgs *wrapper = DraggingEventArgs::Unwrap<DraggingEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::DraggingState result = wrapper->_instance->DraggingState;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::DraggingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      DraggingEventArgs *wrapper = DraggingEventArgs::Unwrap<DraggingEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::DraggingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      DraggingEventArgs *wrapper = DraggingEventArgs::Unwrap<DraggingEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::DraggingEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapDraggingEventArgs(::Windows::UI::Input::DraggingEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::DraggingEventArgs^ UnwrapDraggingEventArgs(Handle<Value> value);
    friend bool IsDraggingEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> DraggingEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapDraggingEventArgs(::Windows::UI::Input::DraggingEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(DraggingEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::DraggingEventArgs^ UnwrapDraggingEventArgs(Handle<Value> value)
  {
     return DraggingEventArgs::Unwrap<DraggingEventArgs>(value.As<Object>())->_instance;
  }

  void InitDraggingEventArgs(Handle<Object> exports)
  {
    DraggingEventArgs::Init(exports);
  }

  class ManipulationStartedEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("ManipulationStartedEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("cumulative"), CumulativeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("ManipulationStartedEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ManipulationStartedEventArgs(::Windows::UI::Input::ManipulationStartedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::ManipulationStartedEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationStartedEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::ManipulationStartedEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      ManipulationStartedEventArgs *wrapperInstance = new ManipulationStartedEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> CumulativeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationStartedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationStartedEventArgs *wrapper = ManipulationStartedEventArgs::Unwrap<ManipulationStartedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationDelta result = wrapper->_instance->Cumulative;
        return scope.Close(ManipulationDeltaToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationStartedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationStartedEventArgs *wrapper = ManipulationStartedEventArgs::Unwrap<ManipulationStartedEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationStartedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationStartedEventArgs *wrapper = ManipulationStartedEventArgs::Unwrap<ManipulationStartedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::ManipulationStartedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapManipulationStartedEventArgs(::Windows::UI::Input::ManipulationStartedEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::ManipulationStartedEventArgs^ UnwrapManipulationStartedEventArgs(Handle<Value> value);
    friend bool IsManipulationStartedEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> ManipulationStartedEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapManipulationStartedEventArgs(::Windows::UI::Input::ManipulationStartedEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(ManipulationStartedEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::ManipulationStartedEventArgs^ UnwrapManipulationStartedEventArgs(Handle<Value> value)
  {
     return ManipulationStartedEventArgs::Unwrap<ManipulationStartedEventArgs>(value.As<Object>())->_instance;
  }

  void InitManipulationStartedEventArgs(Handle<Object> exports)
  {
    ManipulationStartedEventArgs::Init(exports);
  }

  class ManipulationUpdatedEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("ManipulationUpdatedEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("cumulative"), CumulativeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("delta"), DeltaGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("velocities"), VelocitiesGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("ManipulationUpdatedEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ManipulationUpdatedEventArgs(::Windows::UI::Input::ManipulationUpdatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::ManipulationUpdatedEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationUpdatedEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::ManipulationUpdatedEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      ManipulationUpdatedEventArgs *wrapperInstance = new ManipulationUpdatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> CumulativeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationUpdatedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationUpdatedEventArgs *wrapper = ManipulationUpdatedEventArgs::Unwrap<ManipulationUpdatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationDelta result = wrapper->_instance->Cumulative;
        return scope.Close(ManipulationDeltaToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> DeltaGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationUpdatedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationUpdatedEventArgs *wrapper = ManipulationUpdatedEventArgs::Unwrap<ManipulationUpdatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationDelta result = wrapper->_instance->Delta;
        return scope.Close(ManipulationDeltaToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationUpdatedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationUpdatedEventArgs *wrapper = ManipulationUpdatedEventArgs::Unwrap<ManipulationUpdatedEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationUpdatedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationUpdatedEventArgs *wrapper = ManipulationUpdatedEventArgs::Unwrap<ManipulationUpdatedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> VelocitiesGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationUpdatedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationUpdatedEventArgs *wrapper = ManipulationUpdatedEventArgs::Unwrap<ManipulationUpdatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationVelocities result = wrapper->_instance->Velocities;
        return scope.Close(ManipulationVelocitiesToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::ManipulationUpdatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapManipulationUpdatedEventArgs(::Windows::UI::Input::ManipulationUpdatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::ManipulationUpdatedEventArgs^ UnwrapManipulationUpdatedEventArgs(Handle<Value> value);
    friend bool IsManipulationUpdatedEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> ManipulationUpdatedEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapManipulationUpdatedEventArgs(::Windows::UI::Input::ManipulationUpdatedEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(ManipulationUpdatedEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::ManipulationUpdatedEventArgs^ UnwrapManipulationUpdatedEventArgs(Handle<Value> value)
  {
     return ManipulationUpdatedEventArgs::Unwrap<ManipulationUpdatedEventArgs>(value.As<Object>())->_instance;
  }

  void InitManipulationUpdatedEventArgs(Handle<Object> exports)
  {
    ManipulationUpdatedEventArgs::Init(exports);
  }

  class ManipulationInertiaStartingEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("ManipulationInertiaStartingEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("cumulative"), CumulativeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("delta"), DeltaGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("velocities"), VelocitiesGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("ManipulationInertiaStartingEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ManipulationInertiaStartingEventArgs(::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationInertiaStartingEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::ManipulationInertiaStartingEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      ManipulationInertiaStartingEventArgs *wrapperInstance = new ManipulationInertiaStartingEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> CumulativeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationInertiaStartingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationInertiaStartingEventArgs *wrapper = ManipulationInertiaStartingEventArgs::Unwrap<ManipulationInertiaStartingEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationDelta result = wrapper->_instance->Cumulative;
        return scope.Close(ManipulationDeltaToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> DeltaGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationInertiaStartingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationInertiaStartingEventArgs *wrapper = ManipulationInertiaStartingEventArgs::Unwrap<ManipulationInertiaStartingEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationDelta result = wrapper->_instance->Delta;
        return scope.Close(ManipulationDeltaToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationInertiaStartingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationInertiaStartingEventArgs *wrapper = ManipulationInertiaStartingEventArgs::Unwrap<ManipulationInertiaStartingEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationInertiaStartingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationInertiaStartingEventArgs *wrapper = ManipulationInertiaStartingEventArgs::Unwrap<ManipulationInertiaStartingEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> VelocitiesGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationInertiaStartingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationInertiaStartingEventArgs *wrapper = ManipulationInertiaStartingEventArgs::Unwrap<ManipulationInertiaStartingEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationVelocities result = wrapper->_instance->Velocities;
        return scope.Close(ManipulationVelocitiesToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapManipulationInertiaStartingEventArgs(::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ UnwrapManipulationInertiaStartingEventArgs(Handle<Value> value);
    friend bool IsManipulationInertiaStartingEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> ManipulationInertiaStartingEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapManipulationInertiaStartingEventArgs(::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(ManipulationInertiaStartingEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::ManipulationInertiaStartingEventArgs^ UnwrapManipulationInertiaStartingEventArgs(Handle<Value> value)
  {
     return ManipulationInertiaStartingEventArgs::Unwrap<ManipulationInertiaStartingEventArgs>(value.As<Object>())->_instance;
  }

  void InitManipulationInertiaStartingEventArgs(Handle<Object> exports)
  {
    ManipulationInertiaStartingEventArgs::Init(exports);
  }

  class ManipulationCompletedEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("ManipulationCompletedEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("cumulative"), CumulativeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("velocities"), VelocitiesGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("ManipulationCompletedEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ManipulationCompletedEventArgs(::Windows::UI::Input::ManipulationCompletedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::ManipulationCompletedEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationCompletedEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::ManipulationCompletedEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      ManipulationCompletedEventArgs *wrapperInstance = new ManipulationCompletedEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> CumulativeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationCompletedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationCompletedEventArgs *wrapper = ManipulationCompletedEventArgs::Unwrap<ManipulationCompletedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationDelta result = wrapper->_instance->Cumulative;
        return scope.Close(ManipulationDeltaToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationCompletedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationCompletedEventArgs *wrapper = ManipulationCompletedEventArgs::Unwrap<ManipulationCompletedEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationCompletedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationCompletedEventArgs *wrapper = ManipulationCompletedEventArgs::Unwrap<ManipulationCompletedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> VelocitiesGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::ManipulationCompletedEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ManipulationCompletedEventArgs *wrapper = ManipulationCompletedEventArgs::Unwrap<ManipulationCompletedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::ManipulationVelocities result = wrapper->_instance->Velocities;
        return scope.Close(ManipulationVelocitiesToJsObject(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::ManipulationCompletedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapManipulationCompletedEventArgs(::Windows::UI::Input::ManipulationCompletedEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::ManipulationCompletedEventArgs^ UnwrapManipulationCompletedEventArgs(Handle<Value> value);
    friend bool IsManipulationCompletedEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> ManipulationCompletedEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapManipulationCompletedEventArgs(::Windows::UI::Input::ManipulationCompletedEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(ManipulationCompletedEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::ManipulationCompletedEventArgs^ UnwrapManipulationCompletedEventArgs(Handle<Value> value)
  {
     return ManipulationCompletedEventArgs::Unwrap<ManipulationCompletedEventArgs>(value.As<Object>())->_instance;
  }

  void InitManipulationCompletedEventArgs(Handle<Object> exports)
  {
    ManipulationCompletedEventArgs::Init(exports);
  }

  class CrossSlidingEventArgs : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("CrossSlidingEventArgs"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("crossSlidingState"), CrossSlidingStateGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDeviceType"), PointerDeviceTypeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("CrossSlidingEventArgs"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    CrossSlidingEventArgs(::Windows::UI::Input::CrossSlidingEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::CrossSlidingEventArgs^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::CrossSlidingEventArgs^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::CrossSlidingEventArgs^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      CrossSlidingEventArgs *wrapperInstance = new CrossSlidingEventArgs(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> CrossSlidingStateGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::CrossSlidingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      CrossSlidingEventArgs *wrapper = CrossSlidingEventArgs::Unwrap<CrossSlidingEventArgs>(info.This());

      try 
      {
        ::Windows::UI::Input::CrossSlidingState result = wrapper->_instance->CrossSlidingState;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::CrossSlidingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      CrossSlidingEventArgs *wrapper = CrossSlidingEventArgs::Unwrap<CrossSlidingEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDeviceType result = wrapper->_instance->PointerDeviceType;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::CrossSlidingEventArgs^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      CrossSlidingEventArgs *wrapper = CrossSlidingEventArgs::Unwrap<CrossSlidingEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::CrossSlidingEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapCrossSlidingEventArgs(::Windows::UI::Input::CrossSlidingEventArgs^ wintRtInstance);
    friend ::Windows::UI::Input::CrossSlidingEventArgs^ UnwrapCrossSlidingEventArgs(Handle<Value> value);
    friend bool IsCrossSlidingEventArgsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> CrossSlidingEventArgs::s_constructorTemplate;

  v8::Handle<v8::Value> WrapCrossSlidingEventArgs(::Windows::UI::Input::CrossSlidingEventArgs^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(CrossSlidingEventArgs::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::CrossSlidingEventArgs^ UnwrapCrossSlidingEventArgs(Handle<Value> value)
  {
     return CrossSlidingEventArgs::Unwrap<CrossSlidingEventArgs>(value.As<Object>())->_instance;
  }

  void InitCrossSlidingEventArgs(Handle<Object> exports)
  {
    CrossSlidingEventArgs::Init(exports);
  }

  class PointerPoint : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("PointerPoint"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("frameId"), FrameIdGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isInContact"), IsInContactGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerDevice"), PointerDeviceGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerId"), PointerIdGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("position"), PositionGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("properties"), PropertiesGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("rawPosition"), RawPositionGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("timestamp"), TimestampGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();

      constructor->Set(String::NewSymbol("getCurrentPoint"), FunctionTemplate::New(GetCurrentPoint)->GetFunction());
      constructor->Set(String::NewSymbol("getIntermediatePoints"), FunctionTemplate::New(GetIntermediatePoints)->GetFunction());

      exports->Set(String::NewSymbol("PointerPoint"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    PointerPoint(::Windows::UI::Input::PointerPoint^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::PointerPoint^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::PointerPoint^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      PointerPoint *wrapperInstance = new PointerPoint(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  


    static Handle<Value> GetCurrentPoint(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() == 1
        && args[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(args[0]->IntegerValue());
          
          ::Windows::UI::Input::PointerPoint^ result;
          result = ::Windows::UI::Input::PointerPoint::GetCurrentPoint(arg0);
          return scope.Close(WrapPointerPoint(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 2
        && args[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::IPointerPointTransform^>(args[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(args[0]->IntegerValue());
          ::Windows::UI::Input::IPointerPointTransform^ arg1 = UnwrapIPointerPointTransform(args[1]);
          
          ::Windows::UI::Input::PointerPoint^ result;
          result = ::Windows::UI::Input::PointerPoint::GetCurrentPoint(arg0, arg1);
          return scope.Close(WrapPointerPoint(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> GetIntermediatePoints(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() == 1
        && args[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(args[0]->IntegerValue());
          
          ::Windows::Foundation::Collections::IVector<::Windows::UI::Input::PointerPoint^>^ result;
          result = ::Windows::UI::Input::PointerPoint::GetIntermediatePoints(arg0);
          return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::UI::Input::PointerPoint^>::CreateVectorWrapper(result, 
            [](::Windows::UI::Input::PointerPoint^ val) -> Handle<Value> {
              return WrapPointerPoint(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(value);
            },
            [](Handle<Value> value) -> ::Windows::UI::Input::PointerPoint^ {
              return UnwrapPointerPoint(value);
            }
          ));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 2
        && args[0]->IsUint32()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::IPointerPointTransform^>(args[1]))
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(args[0]->IntegerValue());
          ::Windows::UI::Input::IPointerPointTransform^ arg1 = UnwrapIPointerPointTransform(args[1]);
          
          ::Windows::Foundation::Collections::IVector<::Windows::UI::Input::PointerPoint^>^ result;
          result = ::Windows::UI::Input::PointerPoint::GetIntermediatePoints(arg0, arg1);
          return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::UI::Input::PointerPoint^>::CreateVectorWrapper(result, 
            [](::Windows::UI::Input::PointerPoint^ val) -> Handle<Value> {
              return WrapPointerPoint(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(value);
            },
            [](Handle<Value> value) -> ::Windows::UI::Input::PointerPoint^ {
              return UnwrapPointerPoint(value);
            }
          ));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }

    static Handle<Value> FrameIdGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->FrameId;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsInContactGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsInContact;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerDeviceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        ::Windows::Devices::Input::PointerDevice^ result = wrapper->_instance->PointerDevice;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Devices.Input", "PointerDevice", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerIdGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->PointerId;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->Position;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PropertiesGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        ::Windows::UI::Input::PointerPointProperties^ result = wrapper->_instance->Properties;
        return scope.Close(WrapPointerPointProperties(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> RawPositionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        ::Windows::Foundation::Point result = wrapper->_instance->RawPosition;
        return scope.Close(NodeRT::Utils::PointToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> TimestampGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPoint^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPoint *wrapper = PointerPoint::Unwrap<PointerPoint>(info.This());

      try 
      {
        unsigned __int64 result = wrapper->_instance->Timestamp;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::PointerPoint^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapPointerPoint(::Windows::UI::Input::PointerPoint^ wintRtInstance);
    friend ::Windows::UI::Input::PointerPoint^ UnwrapPointerPoint(Handle<Value> value);
    friend bool IsPointerPointWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> PointerPoint::s_constructorTemplate;

  v8::Handle<v8::Value> WrapPointerPoint(::Windows::UI::Input::PointerPoint^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(PointerPoint::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::PointerPoint^ UnwrapPointerPoint(Handle<Value> value)
  {
     return PointerPoint::Unwrap<PointerPoint>(value.As<Object>())->_instance;
  }

  void InitPointerPoint(Handle<Object> exports)
  {
    PointerPoint::Init(exports);
  }

  class IPointerPointTransform : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("IPointerPointTransform"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("tryTransform"), FunctionTemplate::New(TryTransform)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("transformBounds"), FunctionTemplate::New(TransformBounds)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("inverse"), InverseGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("IPointerPointTransform"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    IPointerPointTransform(::Windows::UI::Input::IPointerPointTransform^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::IPointerPointTransform^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::IPointerPointTransform^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::IPointerPointTransform^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      IPointerPointTransform *wrapperInstance = new IPointerPointTransform(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> TryTransform(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::IPointerPointTransform^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      IPointerPointTransform *wrapper = IPointerPointTransform::Unwrap<IPointerPointTransform>(args.This());

      if (args.Length() == 1
        && NodeRT::Utils::IsPoint(args[0]))
      {
        try
        {
          ::Windows::Foundation::Point arg0 = NodeRT::Utils::PointFromJs(args[0]);
          ::Windows::Foundation::Point arg1;
          
          bool result;
          result = wrapper->_instance->TryTransform(arg0, &arg1);
          Handle<Object> resObj = Object::New();
          resObj->Set(String::NewSymbol("boolean"), Boolean::New(result));
          resObj->Set(String::NewSymbol("outPoint"), NodeRT::Utils::PointToJs(arg1));
          return scope.Close(resObj);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> TransformBounds(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::IPointerPointTransform^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      IPointerPointTransform *wrapper = IPointerPointTransform::Unwrap<IPointerPointTransform>(args.This());

      if (args.Length() == 1
        && NodeRT::Utils::IsRect(args[0]))
      {
        try
        {
          ::Windows::Foundation::Rect arg0 = NodeRT::Utils::RectFromJs(args[0]);
          
          ::Windows::Foundation::Rect result;
          result = wrapper->_instance->TransformBounds(arg0);
          return scope.Close(NodeRT::Utils::RectToJs(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> InverseGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::IPointerPointTransform^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      IPointerPointTransform *wrapper = IPointerPointTransform::Unwrap<IPointerPointTransform>(info.This());

      try 
      {
        ::Windows::UI::Input::IPointerPointTransform^ result = wrapper->_instance->Inverse;
        return scope.Close(WrapIPointerPointTransform(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::IPointerPointTransform^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapIPointerPointTransform(::Windows::UI::Input::IPointerPointTransform^ wintRtInstance);
    friend ::Windows::UI::Input::IPointerPointTransform^ UnwrapIPointerPointTransform(Handle<Value> value);
    friend bool IsIPointerPointTransformWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> IPointerPointTransform::s_constructorTemplate;

  v8::Handle<v8::Value> WrapIPointerPointTransform(::Windows::UI::Input::IPointerPointTransform^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(IPointerPointTransform::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::IPointerPointTransform^ UnwrapIPointerPointTransform(Handle<Value> value)
  {
     return IPointerPointTransform::Unwrap<IPointerPointTransform>(value.As<Object>())->_instance;
  }

  void InitIPointerPointTransform(Handle<Object> exports)
  {
    IPointerPointTransform::Init(exports);
  }

  class PointerPointProperties : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("PointerPointProperties"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("hasUsage"), FunctionTemplate::New(HasUsage)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getUsageValue"), FunctionTemplate::New(GetUsageValue)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("contactRect"), ContactRectGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("contactRectRaw"), ContactRectRawGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isBarrelButtonPressed"), IsBarrelButtonPressedGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isCanceled"), IsCanceledGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isEraser"), IsEraserGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isHorizontalMouseWheel"), IsHorizontalMouseWheelGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isInRange"), IsInRangeGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isInverted"), IsInvertedGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isLeftButtonPressed"), IsLeftButtonPressedGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isMiddleButtonPressed"), IsMiddleButtonPressedGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isPrimary"), IsPrimaryGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isRightButtonPressed"), IsRightButtonPressedGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isXButton1Pressed"), IsXButton1PressedGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isXButton2Pressed"), IsXButton2PressedGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("mouseWheelDelta"), MouseWheelDeltaGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("orientation"), OrientationGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pointerUpdateKind"), PointerUpdateKindGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("pressure"), PressureGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("touchConfidence"), TouchConfidenceGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("twist"), TwistGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("xTilt"), XTiltGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("yTilt"), YTiltGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("PointerPointProperties"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    PointerPointProperties(::Windows::UI::Input::PointerPointProperties^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::PointerPointProperties^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::PointerPointProperties^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      PointerPointProperties *wrapperInstance = new PointerPointProperties(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> HasUsage(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(args.This());

      if (args.Length() == 2
        && args[0]->IsUint32()
        && args[1]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(args[0]->IntegerValue());
          unsigned int arg1 = static_cast<unsigned int>(args[1]->IntegerValue());
          
          bool result;
          result = wrapper->_instance->HasUsage(arg0, arg1);
          return scope.Close(Boolean::New(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> GetUsageValue(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(args.This());

      if (args.Length() == 2
        && args[0]->IsUint32()
        && args[1]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(args[0]->IntegerValue());
          unsigned int arg1 = static_cast<unsigned int>(args[1]->IntegerValue());
          
          int result;
          result = wrapper->_instance->GetUsageValue(arg0, arg1);
          return scope.Close(Integer::New(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> ContactRectGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        ::Windows::Foundation::Rect result = wrapper->_instance->ContactRect;
        return scope.Close(NodeRT::Utils::RectToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ContactRectRawGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        ::Windows::Foundation::Rect result = wrapper->_instance->ContactRectRaw;
        return scope.Close(NodeRT::Utils::RectToJs(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsBarrelButtonPressedGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsBarrelButtonPressed;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsCanceledGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsCanceled;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsEraserGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsEraser;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsHorizontalMouseWheelGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsHorizontalMouseWheel;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsInRangeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsInRange;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsInvertedGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsInverted;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsLeftButtonPressedGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsLeftButtonPressed;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsMiddleButtonPressedGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsMiddleButtonPressed;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsPrimaryGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsPrimary;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsRightButtonPressedGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsRightButtonPressed;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsXButton1PressedGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsXButton1Pressed;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> IsXButton2PressedGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsXButton2Pressed;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> MouseWheelDeltaGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        int result = wrapper->_instance->MouseWheelDelta;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> OrientationGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        float result = wrapper->_instance->Orientation;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PointerUpdateKindGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        ::Windows::UI::Input::PointerUpdateKind result = wrapper->_instance->PointerUpdateKind;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PressureGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        float result = wrapper->_instance->Pressure;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> TouchConfidenceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        bool result = wrapper->_instance->TouchConfidence;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> TwistGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        float result = wrapper->_instance->Twist;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> XTiltGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        float result = wrapper->_instance->XTilt;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> YTiltGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerPointProperties^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerPointProperties *wrapper = PointerPointProperties::Unwrap<PointerPointProperties>(info.This());

      try 
      {
        float result = wrapper->_instance->YTilt;
        return scope.Close(Number::New(static_cast<double>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::UI::Input::PointerPointProperties^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapPointerPointProperties(::Windows::UI::Input::PointerPointProperties^ wintRtInstance);
    friend ::Windows::UI::Input::PointerPointProperties^ UnwrapPointerPointProperties(Handle<Value> value);
    friend bool IsPointerPointPropertiesWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> PointerPointProperties::s_constructorTemplate;

  v8::Handle<v8::Value> WrapPointerPointProperties(::Windows::UI::Input::PointerPointProperties^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(PointerPointProperties::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::PointerPointProperties^ UnwrapPointerPointProperties(Handle<Value> value)
  {
     return PointerPointProperties::Unwrap<PointerPointProperties>(value.As<Object>())->_instance;
  }

  void InitPointerPointProperties(Handle<Object> exports)
  {
    PointerPointProperties::Init(exports);
  }

  class PointerVisualizationSettings : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("PointerVisualizationSettings"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isContactFeedbackEnabled"), IsContactFeedbackEnabledGetter, IsContactFeedbackEnabledSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("isBarrelButtonFeedbackEnabled"), IsBarrelButtonFeedbackEnabledGetter, IsBarrelButtonFeedbackEnabledSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();

      constructor->Set(String::NewSymbol("getForCurrentView"), FunctionTemplate::New(GetForCurrentView)->GetFunction());

      exports->Set(String::NewSymbol("PointerVisualizationSettings"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    PointerVisualizationSettings(::Windows::UI::Input::PointerVisualizationSettings^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::UI::Input::PointerVisualizationSettings^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerVisualizationSettings^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::Input::PointerVisualizationSettings^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      PointerVisualizationSettings *wrapperInstance = new PointerVisualizationSettings(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  


    static Handle<Value> GetForCurrentView(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() == 0)
      {
        try
        {
          ::Windows::UI::Input::PointerVisualizationSettings^ result;
          result = ::Windows::UI::Input::PointerVisualizationSettings::GetForCurrentView();
          return scope.Close(WrapPointerVisualizationSettings(result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }

    static Handle<Value> IsContactFeedbackEnabledGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerVisualizationSettings^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerVisualizationSettings *wrapper = PointerVisualizationSettings::Unwrap<PointerVisualizationSettings>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsContactFeedbackEnabled;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void IsContactFeedbackEnabledSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerVisualizationSettings^>(info.This()))
      {
        return;
      }

      PointerVisualizationSettings *wrapper = PointerVisualizationSettings::Unwrap<PointerVisualizationSettings>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->IsContactFeedbackEnabled = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> IsBarrelButtonFeedbackEnabledGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerVisualizationSettings^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      PointerVisualizationSettings *wrapper = PointerVisualizationSettings::Unwrap<PointerVisualizationSettings>(info.This());

      try 
      {
        bool result = wrapper->_instance->IsBarrelButtonFeedbackEnabled;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void IsBarrelButtonFeedbackEnabledSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::Input::PointerVisualizationSettings^>(info.This()))
      {
        return;
      }

      PointerVisualizationSettings *wrapper = PointerVisualizationSettings::Unwrap<PointerVisualizationSettings>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->IsBarrelButtonFeedbackEnabled = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::UI::Input::PointerVisualizationSettings^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapPointerVisualizationSettings(::Windows::UI::Input::PointerVisualizationSettings^ wintRtInstance);
    friend ::Windows::UI::Input::PointerVisualizationSettings^ UnwrapPointerVisualizationSettings(Handle<Value> value);
    friend bool IsPointerVisualizationSettingsWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> PointerVisualizationSettings::s_constructorTemplate;

  v8::Handle<v8::Value> WrapPointerVisualizationSettings(::Windows::UI::Input::PointerVisualizationSettings^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(PointerVisualizationSettings::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::UI::Input::PointerVisualizationSettings^ UnwrapPointerVisualizationSettings(Handle<Value> value)
  {
     return PointerVisualizationSettings::Unwrap<PointerVisualizationSettings>(value.As<Object>())->_instance;
  }

  void InitPointerVisualizationSettings(Handle<Object> exports)
  {
    PointerVisualizationSettings::Init(exports);
  }

} } } } 

void init(Handle<Object> exports)
{
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
  {
    ThrowException(v8::Exception::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  
  NodeRT::Windows::UI::Input::InitEdgeGestureKindEnum(exports);
  NodeRT::Windows::UI::Input::InitHoldingStateEnum(exports);
  NodeRT::Windows::UI::Input::InitDraggingStateEnum(exports);
  NodeRT::Windows::UI::Input::InitCrossSlidingStateEnum(exports);
  NodeRT::Windows::UI::Input::InitGestureSettingsEnum(exports);
  NodeRT::Windows::UI::Input::InitPointerUpdateKindEnum(exports);
  NodeRT::Windows::UI::Input::InitEdgeGestureEventArgs(exports);
  NodeRT::Windows::UI::Input::InitEdgeGesture(exports);
  NodeRT::Windows::UI::Input::InitMouseWheelParameters(exports);
  NodeRT::Windows::UI::Input::InitGestureRecognizer(exports);
  NodeRT::Windows::UI::Input::InitTappedEventArgs(exports);
  NodeRT::Windows::UI::Input::InitRightTappedEventArgs(exports);
  NodeRT::Windows::UI::Input::InitHoldingEventArgs(exports);
  NodeRT::Windows::UI::Input::InitDraggingEventArgs(exports);
  NodeRT::Windows::UI::Input::InitManipulationStartedEventArgs(exports);
  NodeRT::Windows::UI::Input::InitManipulationUpdatedEventArgs(exports);
  NodeRT::Windows::UI::Input::InitManipulationInertiaStartingEventArgs(exports);
  NodeRT::Windows::UI::Input::InitManipulationCompletedEventArgs(exports);
  NodeRT::Windows::UI::Input::InitCrossSlidingEventArgs(exports);
  NodeRT::Windows::UI::Input::InitPointerPoint(exports);
  NodeRT::Windows::UI::Input::InitIPointerPointTransform(exports);
  NodeRT::Windows::UI::Input::InitPointerPointProperties(exports);
  NodeRT::Windows::UI::Input::InitPointerVisualizationSettings(exports);

  NodeRT::Utils::RegisterNameSpace("Windows.UI.Input", exports);
}


NODE_MODULE(binding, init)