// 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.

// TODO: Verify that this is is still needed..
#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include "nan.h"
#include <string>
#include <ppltasks.h>
#include "CollectionsConverter.h"
#include "CollectionsWrap.h"
#include "node-async.h"
#include "NodeRtUtils.h"
#include "OpaqueWrapper.h"
#include "WrapperBase.h"

#using <Windows.WinMD>

// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods
#undef DocumentProperties
#undef GetObject
#undef CreateEvent
#undef FindText
#undef SendMessage

const char* REGISTRATION_TOKEN_MAP_PROPERTY_NAME = "__registrationTokenMap__";

using v8::Array;
using v8::String;
using v8::Handle;
using v8::Value;
using v8::Boolean;
using v8::Integer;
using v8::FunctionTemplate;
using v8::Object;
using v8::Local;
using v8::Function;
using v8::Date;
using v8::Number;
using v8::PropertyAttribute;
using v8::Primitive;
using Nan::HandleScope;
using Nan::Persistent;
using Nan::Undefined;
using Nan::True;
using Nan::False;
using Nan::Null;
using Nan::MaybeLocal;
using Nan::EscapableHandleScope;
using Nan::HandleScope;
using Nan::TryCatch;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace UI { namespace WebUI { 

  v8::Local<v8::Value> WrapActivatedDeferral(::Windows::UI::WebUI::ActivatedDeferral^ wintRtInstance);
  ::Windows::UI::WebUI::ActivatedDeferral^ UnwrapActivatedDeferral(Local<Value> value);
  
  v8::Local<v8::Value> WrapActivatedOperation(::Windows::UI::WebUI::ActivatedOperation^ wintRtInstance);
  ::Windows::UI::WebUI::ActivatedOperation^ UnwrapActivatedOperation(Local<Value> value);
  
  v8::Local<v8::Value> WrapIActivatedEventArgsDeferral(::Windows::UI::WebUI::IActivatedEventArgsDeferral^ wintRtInstance);
  ::Windows::UI::WebUI::IActivatedEventArgsDeferral^ UnwrapIActivatedEventArgsDeferral(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUILaunchActivatedEventArgs(::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ UnwrapWebUILaunchActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUISearchActivatedEventArgs(::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ UnwrapWebUISearchActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIShareTargetActivatedEventArgs(::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ UnwrapWebUIShareTargetActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIFileActivatedEventArgs(::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ UnwrapWebUIFileActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIProtocolActivatedEventArgs(::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ UnwrapWebUIProtocolActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIFileOpenPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ UnwrapWebUIFileOpenPickerActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIFileSavePickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ UnwrapWebUIFileSavePickerActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUICachedFileUpdaterActivatedEventArgs(::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ UnwrapWebUICachedFileUpdaterActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIContactPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ UnwrapWebUIContactPickerActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIDeviceActivatedEventArgs(::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ UnwrapWebUIDeviceActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIPrintTaskSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ UnwrapWebUIPrintTaskSettingsActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUICameraSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ UnwrapWebUICameraSettingsActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ UnwrapWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIContactCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ UnwrapWebUIContactCallActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIContactMessageActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ UnwrapWebUIContactMessageActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIContactMapActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ UnwrapWebUIContactMapActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIContactPostActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ UnwrapWebUIContactPostActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIContactVideoCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ UnwrapWebUIContactVideoCallActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUILockScreenCallActivatedEventArgs(::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ UnwrapWebUILockScreenCallActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIRestrictedLaunchActivatedEventArgs(::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ UnwrapWebUIRestrictedLaunchActivatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapIWebUINavigatedEventArgs(::Windows::UI::WebUI::IWebUINavigatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::IWebUINavigatedEventArgs^ UnwrapIWebUINavigatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUINavigatedOperation(::Windows::UI::WebUI::WebUINavigatedOperation^ wintRtInstance);
  ::Windows::UI::WebUI::WebUINavigatedOperation^ UnwrapWebUINavigatedOperation(Local<Value> value);
  
  v8::Local<v8::Value> WrapSuspendingDeferral(::Windows::UI::WebUI::SuspendingDeferral^ wintRtInstance);
  ::Windows::UI::WebUI::SuspendingDeferral^ UnwrapSuspendingDeferral(Local<Value> value);
  
  v8::Local<v8::Value> WrapSuspendingOperation(::Windows::UI::WebUI::SuspendingOperation^ wintRtInstance);
  ::Windows::UI::WebUI::SuspendingOperation^ UnwrapSuspendingOperation(Local<Value> value);
  
  v8::Local<v8::Value> WrapSuspendingEventArgs(::Windows::UI::WebUI::SuspendingEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::SuspendingEventArgs^ UnwrapSuspendingEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapIWebUIBackgroundTaskInstance(::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ wintRtInstance);
  ::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ UnwrapIWebUIBackgroundTaskInstance(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIBackgroundTaskInstanceRuntimeClass(::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ UnwrapWebUIBackgroundTaskInstanceRuntimeClass(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIBackgroundTaskInstance(::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ UnwrapWebUIBackgroundTaskInstance(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUINavigatedDeferral(::Windows::UI::WebUI::WebUINavigatedDeferral^ wintRtInstance);
  ::Windows::UI::WebUI::WebUINavigatedDeferral^ UnwrapWebUINavigatedDeferral(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUINavigatedEventArgs(::Windows::UI::WebUI::WebUINavigatedEventArgs^ wintRtInstance);
  ::Windows::UI::WebUI::WebUINavigatedEventArgs^ UnwrapWebUINavigatedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapWebUIApplication(::Windows::UI::WebUI::WebUIApplication^ wintRtInstance);
  ::Windows::UI::WebUI::WebUIApplication^ UnwrapWebUIApplication(Local<Value> value);
  
  v8::Local<v8::Value> WrapHtmlPrintDocumentSource(::Windows::UI::WebUI::HtmlPrintDocumentSource^ wintRtInstance);
  ::Windows::UI::WebUI::HtmlPrintDocumentSource^ UnwrapHtmlPrintDocumentSource(Local<Value> value);
  


  static void InitPrintContentEnum(const Local<Object> exports)
  {
    HandleScope scope;
    
	Local<Object> enumObject = Nan::New<Object>();
    Nan::Set(exports, Nan::New<String>("PrintContent").ToLocalChecked(), enumObject);
	Nan::Set(enumObject, Nan::New<String>("allPages").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::WebUI::PrintContent::AllPages)));
	Nan::Set(enumObject, Nan::New<String>("currentPage").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::WebUI::PrintContent::CurrentPage)));
	Nan::Set(enumObject, Nan::New<String>("customPageRange").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::WebUI::PrintContent::CustomPageRange)));
	Nan::Set(enumObject, Nan::New<String>("currentSelection").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::UI::WebUI::PrintContent::CurrentSelection)));
  }



  
  class ActivatedDeferral : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("ActivatedDeferral").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "complete", Complete);
      
                        
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("ActivatedDeferral").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ActivatedDeferral(::Windows::UI::WebUI::ActivatedDeferral^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::ActivatedDeferral^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::ActivatedDeferral^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::ActivatedDeferral^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ActivatedDeferral *wrapperInstance = new ActivatedDeferral(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void Complete(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::ActivatedDeferral^>(info.This()))
      {
        return;
      }

      ActivatedDeferral *wrapper = ActivatedDeferral::Unwrap<ActivatedDeferral>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Complete();
          return;   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





  private:
    ::Windows::UI::WebUI::ActivatedDeferral^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapActivatedDeferral(::Windows::UI::WebUI::ActivatedDeferral^ wintRtInstance);
    friend ::Windows::UI::WebUI::ActivatedDeferral^ UnwrapActivatedDeferral(Local<Value> value);
  };
  Persistent<FunctionTemplate> ActivatedDeferral::s_constructorTemplate;

  v8::Local<v8::Value> WrapActivatedDeferral(::Windows::UI::WebUI::ActivatedDeferral^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ActivatedDeferral::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::ActivatedDeferral^ UnwrapActivatedDeferral(Local<Value> value)
  {
     return ActivatedDeferral::Unwrap<ActivatedDeferral>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitActivatedDeferral(Local<Object> exports)
  {
    ActivatedDeferral::Init(exports);
  }

  class ActivatedOperation : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("ActivatedOperation").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
      
                        
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("ActivatedOperation").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ActivatedOperation(::Windows::UI::WebUI::ActivatedOperation^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::ActivatedOperation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::ActivatedOperation^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::ActivatedOperation^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      ActivatedOperation *wrapperInstance = new ActivatedOperation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::ActivatedOperation^>(info.This()))
      {
        return;
      }

      ActivatedOperation *wrapper = ActivatedOperation::Unwrap<ActivatedOperation>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::WebUI::ActivatedDeferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(WrapActivatedDeferral(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





  private:
    ::Windows::UI::WebUI::ActivatedOperation^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapActivatedOperation(::Windows::UI::WebUI::ActivatedOperation^ wintRtInstance);
    friend ::Windows::UI::WebUI::ActivatedOperation^ UnwrapActivatedOperation(Local<Value> value);
  };
  Persistent<FunctionTemplate> ActivatedOperation::s_constructorTemplate;

  v8::Local<v8::Value> WrapActivatedOperation(::Windows::UI::WebUI::ActivatedOperation^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(ActivatedOperation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::ActivatedOperation^ UnwrapActivatedOperation(Local<Value> value)
  {
     return ActivatedOperation::Unwrap<ActivatedOperation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitActivatedOperation(Local<Object> exports)
  {
    ActivatedOperation::Init(exports);
  }

  class IActivatedEventArgsDeferral : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("IActivatedEventArgsDeferral").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("IActivatedEventArgsDeferral").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    IActivatedEventArgsDeferral(::Windows::UI::WebUI::IActivatedEventArgsDeferral^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::IActivatedEventArgsDeferral^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::IActivatedEventArgsDeferral^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::IActivatedEventArgsDeferral^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      IActivatedEventArgsDeferral *wrapperInstance = new IActivatedEventArgsDeferral(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::IActivatedEventArgsDeferral^>(info.This()))
      {
        return;
      }

      IActivatedEventArgsDeferral *wrapper = IActivatedEventArgsDeferral::Unwrap<IActivatedEventArgsDeferral>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::IActivatedEventArgsDeferral^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapIActivatedEventArgsDeferral(::Windows::UI::WebUI::IActivatedEventArgsDeferral^ wintRtInstance);
    friend ::Windows::UI::WebUI::IActivatedEventArgsDeferral^ UnwrapIActivatedEventArgsDeferral(Local<Value> value);
  };
  Persistent<FunctionTemplate> IActivatedEventArgsDeferral::s_constructorTemplate;

  v8::Local<v8::Value> WrapIActivatedEventArgsDeferral(::Windows::UI::WebUI::IActivatedEventArgsDeferral^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(IActivatedEventArgsDeferral::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::IActivatedEventArgsDeferral^ UnwrapIActivatedEventArgsDeferral(Local<Value> value)
  {
     return IActivatedEventArgsDeferral::Unwrap<IActivatedEventArgsDeferral>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitIActivatedEventArgsDeferral(Local<Object> exports)
  {
    IActivatedEventArgsDeferral::Init(exports);
  }

  class WebUILaunchActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUILaunchActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("arguments").ToLocalChecked(), ArgumentsGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("tileId").ToLocalChecked(), TileIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("prelaunchActivated").ToLocalChecked(), PrelaunchActivatedGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("currentlyShownApplicationViewId").ToLocalChecked(), CurrentlyShownApplicationViewIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUILaunchActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUILaunchActivatedEventArgs(::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUILaunchActivatedEventArgs *wrapperInstance = new WebUILaunchActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ArgumentsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Arguments;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void TileIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->TileId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PrelaunchActivatedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        bool result = wrapper->_instance->PrelaunchActivated;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void CurrentlyShownApplicationViewIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        int result = wrapper->_instance->CurrentlyShownApplicationViewId;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILaunchActivatedEventArgs *wrapper = WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUILaunchActivatedEventArgs(::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ UnwrapWebUILaunchActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUILaunchActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUILaunchActivatedEventArgs(::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUILaunchActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUILaunchActivatedEventArgs^ UnwrapWebUILaunchActivatedEventArgs(Local<Value> value)
  {
     return WebUILaunchActivatedEventArgs::Unwrap<WebUILaunchActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUILaunchActivatedEventArgs(Local<Object> exports)
  {
    WebUILaunchActivatedEventArgs::Init(exports);
  }

  class WebUISearchActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUISearchActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("language").ToLocalChecked(), LanguageGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("queryText").ToLocalChecked(), QueryTextGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("linguisticDetails").ToLocalChecked(), LinguisticDetailsGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("currentlyShownApplicationViewId").ToLocalChecked(), CurrentlyShownApplicationViewIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUISearchActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUISearchActivatedEventArgs(::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUISearchActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUISearchActivatedEventArgs *wrapperInstance = new WebUISearchActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void LanguageGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void QueryTextGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->QueryText;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void LinguisticDetailsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Search::SearchPaneQueryLinguisticDetails^ result = wrapper->_instance->LinguisticDetails;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Search", "SearchPaneQueryLinguisticDetails", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void CurrentlyShownApplicationViewIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        int result = wrapper->_instance->CurrentlyShownApplicationViewId;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUISearchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUISearchActivatedEventArgs *wrapper = WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUISearchActivatedEventArgs(::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ UnwrapWebUISearchActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUISearchActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUISearchActivatedEventArgs(::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUISearchActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUISearchActivatedEventArgs^ UnwrapWebUISearchActivatedEventArgs(Local<Value> value)
  {
     return WebUISearchActivatedEventArgs::Unwrap<WebUISearchActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUISearchActivatedEventArgs(Local<Object> exports)
  {
    WebUISearchActivatedEventArgs::Init(exports);
  }

  class WebUIShareTargetActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIShareTargetActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("shareOperation").ToLocalChecked(), ShareOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIShareTargetActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIShareTargetActivatedEventArgs(::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIShareTargetActivatedEventArgs *wrapperInstance = new WebUIShareTargetActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ShareOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIShareTargetActivatedEventArgs *wrapper = WebUIShareTargetActivatedEventArgs::Unwrap<WebUIShareTargetActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation^ result = wrapper->_instance->ShareOperation;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.DataTransfer.ShareTarget", "ShareOperation", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIShareTargetActivatedEventArgs *wrapper = WebUIShareTargetActivatedEventArgs::Unwrap<WebUIShareTargetActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIShareTargetActivatedEventArgs *wrapper = WebUIShareTargetActivatedEventArgs::Unwrap<WebUIShareTargetActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIShareTargetActivatedEventArgs *wrapper = WebUIShareTargetActivatedEventArgs::Unwrap<WebUIShareTargetActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIShareTargetActivatedEventArgs *wrapper = WebUIShareTargetActivatedEventArgs::Unwrap<WebUIShareTargetActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIShareTargetActivatedEventArgs(::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ UnwrapWebUIShareTargetActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIShareTargetActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIShareTargetActivatedEventArgs(::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIShareTargetActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIShareTargetActivatedEventArgs^ UnwrapWebUIShareTargetActivatedEventArgs(Local<Value> value)
  {
     return WebUIShareTargetActivatedEventArgs::Unwrap<WebUIShareTargetActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIShareTargetActivatedEventArgs(Local<Object> exports)
  {
    WebUIShareTargetActivatedEventArgs::Init(exports);
  }

  class WebUIFileActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIFileActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("files").ToLocalChecked(), FilesGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("currentlyShownApplicationViewId").ToLocalChecked(), CurrentlyShownApplicationViewIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("neighboringFilesQuery").ToLocalChecked(), NeighboringFilesQueryGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIFileActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIFileActivatedEventArgs(::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIFileActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIFileActivatedEventArgs *wrapperInstance = new WebUIFileActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void FilesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVectorView<::Windows::Storage::IStorageItem^>^ result = wrapper->_instance->Files;
        info.GetReturnValue().Set(NodeRT::Collections::VectorViewWrapper<::Windows::Storage::IStorageItem^>::CreateVectorViewWrapper(result, 
            [](::Windows::Storage::IStorageItem^ val) -> Local<Value> {
              return NodeRT::Utils::CreateExternalWinRTObject("Windows.Storage", "IStorageItem", val);
            },
            [](Local<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Storage::IStorageItem^>(value);
            },
            [](Local<Value> value) -> ::Windows::Storage::IStorageItem^ {
              return dynamic_cast<::Windows::Storage::IStorageItem^>(NodeRT::Utils::GetObjectInstance(value));
            }
          ));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void CurrentlyShownApplicationViewIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        int result = wrapper->_instance->CurrentlyShownApplicationViewId;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void NeighboringFilesQueryGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Storage::Search::StorageFileQueryResult^ result = wrapper->_instance->NeighboringFilesQuery;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Storage.Search", "StorageFileQueryResult", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileActivatedEventArgs *wrapper = WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIFileActivatedEventArgs(::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ UnwrapWebUIFileActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIFileActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIFileActivatedEventArgs(::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIFileActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIFileActivatedEventArgs^ UnwrapWebUIFileActivatedEventArgs(Local<Value> value)
  {
     return WebUIFileActivatedEventArgs::Unwrap<WebUIFileActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIFileActivatedEventArgs(Local<Object> exports)
  {
    WebUIFileActivatedEventArgs::Init(exports);
  }

  class WebUIProtocolActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIProtocolActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("currentlyShownApplicationViewId").ToLocalChecked(), CurrentlyShownApplicationViewIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("uri").ToLocalChecked(), UriGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIProtocolActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIProtocolActivatedEventArgs(::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIProtocolActivatedEventArgs *wrapperInstance = new WebUIProtocolActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIProtocolActivatedEventArgs *wrapper = WebUIProtocolActivatedEventArgs::Unwrap<WebUIProtocolActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIProtocolActivatedEventArgs *wrapper = WebUIProtocolActivatedEventArgs::Unwrap<WebUIProtocolActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIProtocolActivatedEventArgs *wrapper = WebUIProtocolActivatedEventArgs::Unwrap<WebUIProtocolActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIProtocolActivatedEventArgs *wrapper = WebUIProtocolActivatedEventArgs::Unwrap<WebUIProtocolActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void CurrentlyShownApplicationViewIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIProtocolActivatedEventArgs *wrapper = WebUIProtocolActivatedEventArgs::Unwrap<WebUIProtocolActivatedEventArgs>(info.This());

      try 
      {
        int result = wrapper->_instance->CurrentlyShownApplicationViewId;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void UriGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIProtocolActivatedEventArgs *wrapper = WebUIProtocolActivatedEventArgs::Unwrap<WebUIProtocolActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->Uri;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIProtocolActivatedEventArgs(::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ UnwrapWebUIProtocolActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIProtocolActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIProtocolActivatedEventArgs(::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIProtocolActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIProtocolActivatedEventArgs^ UnwrapWebUIProtocolActivatedEventArgs(Local<Value> value)
  {
     return WebUIProtocolActivatedEventArgs::Unwrap<WebUIProtocolActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIProtocolActivatedEventArgs(Local<Object> exports)
  {
    WebUIProtocolActivatedEventArgs::Init(exports);
  }

  class WebUIFileOpenPickerActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIFileOpenPickerActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fileOpenPickerUI").ToLocalChecked(), FileOpenPickerUIGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIFileOpenPickerActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIFileOpenPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIFileOpenPickerActivatedEventArgs *wrapperInstance = new WebUIFileOpenPickerActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileOpenPickerActivatedEventArgs *wrapper = WebUIFileOpenPickerActivatedEventArgs::Unwrap<WebUIFileOpenPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileOpenPickerActivatedEventArgs *wrapper = WebUIFileOpenPickerActivatedEventArgs::Unwrap<WebUIFileOpenPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileOpenPickerActivatedEventArgs *wrapper = WebUIFileOpenPickerActivatedEventArgs::Unwrap<WebUIFileOpenPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void FileOpenPickerUIGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileOpenPickerActivatedEventArgs *wrapper = WebUIFileOpenPickerActivatedEventArgs::Unwrap<WebUIFileOpenPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Storage::Pickers::Provider::FileOpenPickerUI^ result = wrapper->_instance->FileOpenPickerUI;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Storage.Pickers.Provider", "FileOpenPickerUI", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileOpenPickerActivatedEventArgs *wrapper = WebUIFileOpenPickerActivatedEventArgs::Unwrap<WebUIFileOpenPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIFileOpenPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ UnwrapWebUIFileOpenPickerActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIFileOpenPickerActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIFileOpenPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIFileOpenPickerActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIFileOpenPickerActivatedEventArgs^ UnwrapWebUIFileOpenPickerActivatedEventArgs(Local<Value> value)
  {
     return WebUIFileOpenPickerActivatedEventArgs::Unwrap<WebUIFileOpenPickerActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIFileOpenPickerActivatedEventArgs(Local<Object> exports)
  {
    WebUIFileOpenPickerActivatedEventArgs::Init(exports);
  }

  class WebUIFileSavePickerActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIFileSavePickerActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("fileSavePickerUI").ToLocalChecked(), FileSavePickerUIGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIFileSavePickerActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIFileSavePickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIFileSavePickerActivatedEventArgs *wrapperInstance = new WebUIFileSavePickerActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileSavePickerActivatedEventArgs *wrapper = WebUIFileSavePickerActivatedEventArgs::Unwrap<WebUIFileSavePickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void FileSavePickerUIGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileSavePickerActivatedEventArgs *wrapper = WebUIFileSavePickerActivatedEventArgs::Unwrap<WebUIFileSavePickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Storage::Pickers::Provider::FileSavePickerUI^ result = wrapper->_instance->FileSavePickerUI;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Storage.Pickers.Provider", "FileSavePickerUI", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileSavePickerActivatedEventArgs *wrapper = WebUIFileSavePickerActivatedEventArgs::Unwrap<WebUIFileSavePickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileSavePickerActivatedEventArgs *wrapper = WebUIFileSavePickerActivatedEventArgs::Unwrap<WebUIFileSavePickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIFileSavePickerActivatedEventArgs *wrapper = WebUIFileSavePickerActivatedEventArgs::Unwrap<WebUIFileSavePickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIFileSavePickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ UnwrapWebUIFileSavePickerActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIFileSavePickerActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIFileSavePickerActivatedEventArgs(::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIFileSavePickerActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIFileSavePickerActivatedEventArgs^ UnwrapWebUIFileSavePickerActivatedEventArgs(Local<Value> value)
  {
     return WebUIFileSavePickerActivatedEventArgs::Unwrap<WebUIFileSavePickerActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIFileSavePickerActivatedEventArgs(Local<Object> exports)
  {
    WebUIFileSavePickerActivatedEventArgs::Init(exports);
  }

  class WebUICachedFileUpdaterActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUICachedFileUpdaterActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("cachedFileUpdaterUI").ToLocalChecked(), CachedFileUpdaterUIGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUICachedFileUpdaterActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUICachedFileUpdaterActivatedEventArgs(::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUICachedFileUpdaterActivatedEventArgs *wrapperInstance = new WebUICachedFileUpdaterActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICachedFileUpdaterActivatedEventArgs *wrapper = WebUICachedFileUpdaterActivatedEventArgs::Unwrap<WebUICachedFileUpdaterActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICachedFileUpdaterActivatedEventArgs *wrapper = WebUICachedFileUpdaterActivatedEventArgs::Unwrap<WebUICachedFileUpdaterActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICachedFileUpdaterActivatedEventArgs *wrapper = WebUICachedFileUpdaterActivatedEventArgs::Unwrap<WebUICachedFileUpdaterActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICachedFileUpdaterActivatedEventArgs *wrapper = WebUICachedFileUpdaterActivatedEventArgs::Unwrap<WebUICachedFileUpdaterActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void CachedFileUpdaterUIGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICachedFileUpdaterActivatedEventArgs *wrapper = WebUICachedFileUpdaterActivatedEventArgs::Unwrap<WebUICachedFileUpdaterActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Storage::Provider::CachedFileUpdaterUI^ result = wrapper->_instance->CachedFileUpdaterUI;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Storage.Provider", "CachedFileUpdaterUI", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUICachedFileUpdaterActivatedEventArgs(::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ UnwrapWebUICachedFileUpdaterActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUICachedFileUpdaterActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUICachedFileUpdaterActivatedEventArgs(::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUICachedFileUpdaterActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUICachedFileUpdaterActivatedEventArgs^ UnwrapWebUICachedFileUpdaterActivatedEventArgs(Local<Value> value)
  {
     return WebUICachedFileUpdaterActivatedEventArgs::Unwrap<WebUICachedFileUpdaterActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUICachedFileUpdaterActivatedEventArgs(Local<Object> exports)
  {
    WebUICachedFileUpdaterActivatedEventArgs::Init(exports);
  }

  class WebUIContactPickerActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIContactPickerActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("contactPickerUI").ToLocalChecked(), ContactPickerUIGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIContactPickerActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIContactPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIContactPickerActivatedEventArgs *wrapperInstance = new WebUIContactPickerActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ContactPickerUIGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPickerActivatedEventArgs *wrapper = WebUIContactPickerActivatedEventArgs::Unwrap<WebUIContactPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Contacts::Provider::ContactPickerUI^ result = wrapper->_instance->ContactPickerUI;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Contacts.Provider", "ContactPickerUI", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPickerActivatedEventArgs *wrapper = WebUIContactPickerActivatedEventArgs::Unwrap<WebUIContactPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPickerActivatedEventArgs *wrapper = WebUIContactPickerActivatedEventArgs::Unwrap<WebUIContactPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPickerActivatedEventArgs *wrapper = WebUIContactPickerActivatedEventArgs::Unwrap<WebUIContactPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPickerActivatedEventArgs *wrapper = WebUIContactPickerActivatedEventArgs::Unwrap<WebUIContactPickerActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIContactPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ UnwrapWebUIContactPickerActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIContactPickerActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIContactPickerActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIContactPickerActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIContactPickerActivatedEventArgs^ UnwrapWebUIContactPickerActivatedEventArgs(Local<Value> value)
  {
     return WebUIContactPickerActivatedEventArgs::Unwrap<WebUIContactPickerActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIContactPickerActivatedEventArgs(Local<Object> exports)
  {
    WebUIContactPickerActivatedEventArgs::Init(exports);
  }

  class WebUIDeviceActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIDeviceActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("currentlyShownApplicationViewId").ToLocalChecked(), CurrentlyShownApplicationViewIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("deviceInformationId").ToLocalChecked(), DeviceInformationIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIDeviceActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIDeviceActivatedEventArgs(::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIDeviceActivatedEventArgs *wrapperInstance = new WebUIDeviceActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void CurrentlyShownApplicationViewIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIDeviceActivatedEventArgs *wrapper = WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(info.This());

      try 
      {
        int result = wrapper->_instance->CurrentlyShownApplicationViewId;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIDeviceActivatedEventArgs *wrapper = WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIDeviceActivatedEventArgs *wrapper = WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIDeviceActivatedEventArgs *wrapper = WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIDeviceActivatedEventArgs *wrapper = WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void DeviceInformationIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIDeviceActivatedEventArgs *wrapper = WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->DeviceInformationId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIDeviceActivatedEventArgs *wrapper = WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIDeviceActivatedEventArgs(::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ UnwrapWebUIDeviceActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIDeviceActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIDeviceActivatedEventArgs(::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIDeviceActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIDeviceActivatedEventArgs^ UnwrapWebUIDeviceActivatedEventArgs(Local<Value> value)
  {
     return WebUIDeviceActivatedEventArgs::Unwrap<WebUIDeviceActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIDeviceActivatedEventArgs(Local<Object> exports)
  {
    WebUIDeviceActivatedEventArgs::Init(exports);
  }

  class WebUIPrintTaskSettingsActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIPrintTaskSettingsActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("configuration").ToLocalChecked(), ConfigurationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIPrintTaskSettingsActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIPrintTaskSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIPrintTaskSettingsActivatedEventArgs *wrapperInstance = new WebUIPrintTaskSettingsActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIPrintTaskSettingsActivatedEventArgs *wrapper = WebUIPrintTaskSettingsActivatedEventArgs::Unwrap<WebUIPrintTaskSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ConfigurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIPrintTaskSettingsActivatedEventArgs *wrapper = WebUIPrintTaskSettingsActivatedEventArgs::Unwrap<WebUIPrintTaskSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Devices::Printers::Extensions::PrintTaskConfiguration^ result = wrapper->_instance->Configuration;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.Devices.Printers.Extensions", "PrintTaskConfiguration", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIPrintTaskSettingsActivatedEventArgs *wrapper = WebUIPrintTaskSettingsActivatedEventArgs::Unwrap<WebUIPrintTaskSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIPrintTaskSettingsActivatedEventArgs *wrapper = WebUIPrintTaskSettingsActivatedEventArgs::Unwrap<WebUIPrintTaskSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIPrintTaskSettingsActivatedEventArgs *wrapper = WebUIPrintTaskSettingsActivatedEventArgs::Unwrap<WebUIPrintTaskSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIPrintTaskSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ UnwrapWebUIPrintTaskSettingsActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIPrintTaskSettingsActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIPrintTaskSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIPrintTaskSettingsActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIPrintTaskSettingsActivatedEventArgs^ UnwrapWebUIPrintTaskSettingsActivatedEventArgs(Local<Value> value)
  {
     return WebUIPrintTaskSettingsActivatedEventArgs::Unwrap<WebUIPrintTaskSettingsActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIPrintTaskSettingsActivatedEventArgs(Local<Object> exports)
  {
    WebUIPrintTaskSettingsActivatedEventArgs::Init(exports);
  }

  class WebUICameraSettingsActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUICameraSettingsActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("videoDeviceController").ToLocalChecked(), VideoDeviceControllerGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("videoDeviceExtension").ToLocalChecked(), VideoDeviceExtensionGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUICameraSettingsActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUICameraSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUICameraSettingsActivatedEventArgs *wrapperInstance = new WebUICameraSettingsActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void VideoDeviceControllerGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICameraSettingsActivatedEventArgs *wrapper = WebUICameraSettingsActivatedEventArgs::Unwrap<WebUICameraSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Platform::Object^ result = wrapper->_instance->VideoDeviceController;
        info.GetReturnValue().Set(CreateOpaqueWrapper(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VideoDeviceExtensionGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICameraSettingsActivatedEventArgs *wrapper = WebUICameraSettingsActivatedEventArgs::Unwrap<WebUICameraSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Platform::Object^ result = wrapper->_instance->VideoDeviceExtension;
        info.GetReturnValue().Set(CreateOpaqueWrapper(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICameraSettingsActivatedEventArgs *wrapper = WebUICameraSettingsActivatedEventArgs::Unwrap<WebUICameraSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICameraSettingsActivatedEventArgs *wrapper = WebUICameraSettingsActivatedEventArgs::Unwrap<WebUICameraSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICameraSettingsActivatedEventArgs *wrapper = WebUICameraSettingsActivatedEventArgs::Unwrap<WebUICameraSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUICameraSettingsActivatedEventArgs *wrapper = WebUICameraSettingsActivatedEventArgs::Unwrap<WebUICameraSettingsActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUICameraSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ UnwrapWebUICameraSettingsActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUICameraSettingsActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUICameraSettingsActivatedEventArgs(::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUICameraSettingsActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUICameraSettingsActivatedEventArgs^ UnwrapWebUICameraSettingsActivatedEventArgs(Local<Value> value)
  {
     return WebUICameraSettingsActivatedEventArgs::Unwrap<WebUICameraSettingsActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUICameraSettingsActivatedEventArgs(Local<Object> exports)
  {
    WebUICameraSettingsActivatedEventArgs::Init(exports);
  }

  class WebUIAppointmentsProviderAddAppointmentActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIAppointmentsProviderAddAppointmentActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("addAppointmentOperation").ToLocalChecked(), AddAppointmentOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIAppointmentsProviderAddAppointmentActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIAppointmentsProviderAddAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIAppointmentsProviderAddAppointmentActivatedEventArgs *wrapperInstance = new WebUIAppointmentsProviderAddAppointmentActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderAddAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void AddAppointmentOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderAddAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Appointments::AppointmentsProvider::AddAppointmentOperation^ result = wrapper->_instance->AddAppointmentOperation;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Appointments.AppointmentsProvider", "AddAppointmentOperation", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderAddAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderAddAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderAddAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderAddAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIAppointmentsProviderAddAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(Local<Value> value)
  {
     return WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderAddAppointmentActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(Local<Object> exports)
  {
    WebUIAppointmentsProviderAddAppointmentActivatedEventArgs::Init(exports);
  }

  class WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("replaceAppointmentOperation").ToLocalChecked(), ReplaceAppointmentOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs *wrapperInstance = new WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ReplaceAppointmentOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Appointments::AppointmentsProvider::ReplaceAppointmentOperation^ result = wrapper->_instance->ReplaceAppointmentOperation;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Appointments.AppointmentsProvider", "ReplaceAppointmentOperation", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(Local<Value> value)
  {
     return WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(Local<Object> exports)
  {
    WebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs::Init(exports);
  }

  class WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("removeAppointmentOperation").ToLocalChecked(), RemoveAppointmentOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs *wrapperInstance = new WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void RemoveAppointmentOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Appointments::AppointmentsProvider::RemoveAppointmentOperation^ result = wrapper->_instance->RemoveAppointmentOperation;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Appointments.AppointmentsProvider", "RemoveAppointmentOperation", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs *wrapper = WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs^ UnwrapWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(Local<Value> value)
  {
     return WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Unwrap<WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(Local<Object> exports)
  {
    WebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs::Init(exports);
  }

  class WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("timeToShow").ToLocalChecked(), TimeToShowGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapperInstance = new WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapper = WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapper = WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void TimeToShowGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapper = WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::Foundation::DateTime result = wrapper->_instance->TimeToShow;
        info.GetReturnValue().Set(NodeRT::Utils::DateTimeToJS(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapper = WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapper = WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapper = WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs *wrapper = WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ UnwrapWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs^ UnwrapWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(Local<Value> value)
  {
     return WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Unwrap<WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(Local<Object> exports)
  {
    WebUIAppointmentsProviderShowTimeFrameActivatedEventArgs::Init(exports);
  }

  class WebUIContactCallActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIContactCallActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("contact").ToLocalChecked(), ContactGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceId").ToLocalChecked(), ServiceIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceUserId").ToLocalChecked(), ServiceUserIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIContactCallActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIContactCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIContactCallActivatedEventArgs *wrapperInstance = new WebUIContactCallActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ContactGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Contacts::Contact^ result = wrapper->_instance->Contact;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Contacts", "Contact", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceUserIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceUserId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactCallActivatedEventArgs *wrapper = WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIContactCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ UnwrapWebUIContactCallActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIContactCallActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIContactCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIContactCallActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIContactCallActivatedEventArgs^ UnwrapWebUIContactCallActivatedEventArgs(Local<Value> value)
  {
     return WebUIContactCallActivatedEventArgs::Unwrap<WebUIContactCallActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIContactCallActivatedEventArgs(Local<Object> exports)
  {
    WebUIContactCallActivatedEventArgs::Init(exports);
  }

  class WebUIContactMessageActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIContactMessageActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("contact").ToLocalChecked(), ContactGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceId").ToLocalChecked(), ServiceIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceUserId").ToLocalChecked(), ServiceUserIdGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIContactMessageActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIContactMessageActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIContactMessageActivatedEventArgs *wrapperInstance = new WebUIContactMessageActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ContactGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Contacts::Contact^ result = wrapper->_instance->Contact;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Contacts", "Contact", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceUserIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMessageActivatedEventArgs *wrapper = WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceUserId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIContactMessageActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ UnwrapWebUIContactMessageActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIContactMessageActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIContactMessageActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIContactMessageActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIContactMessageActivatedEventArgs^ UnwrapWebUIContactMessageActivatedEventArgs(Local<Value> value)
  {
     return WebUIContactMessageActivatedEventArgs::Unwrap<WebUIContactMessageActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIContactMessageActivatedEventArgs(Local<Object> exports)
  {
    WebUIContactMessageActivatedEventArgs::Init(exports);
  }

  class WebUIContactMapActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIContactMapActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("address").ToLocalChecked(), AddressGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("contact").ToLocalChecked(), ContactGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIContactMapActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIContactMapActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIContactMapActivatedEventArgs *wrapperInstance = new WebUIContactMapActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void AddressGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMapActivatedEventArgs *wrapper = WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Contacts::ContactAddress^ result = wrapper->_instance->Address;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Contacts", "ContactAddress", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ContactGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMapActivatedEventArgs *wrapper = WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Contacts::Contact^ result = wrapper->_instance->Contact;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Contacts", "Contact", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMapActivatedEventArgs *wrapper = WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMapActivatedEventArgs *wrapper = WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMapActivatedEventArgs *wrapper = WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMapActivatedEventArgs *wrapper = WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactMapActivatedEventArgs *wrapper = WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIContactMapActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ UnwrapWebUIContactMapActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIContactMapActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIContactMapActivatedEventArgs(::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIContactMapActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIContactMapActivatedEventArgs^ UnwrapWebUIContactMapActivatedEventArgs(Local<Value> value)
  {
     return WebUIContactMapActivatedEventArgs::Unwrap<WebUIContactMapActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIContactMapActivatedEventArgs(Local<Object> exports)
  {
    WebUIContactMapActivatedEventArgs::Init(exports);
  }

  class WebUIContactPostActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIContactPostActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("contact").ToLocalChecked(), ContactGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceId").ToLocalChecked(), ServiceIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceUserId").ToLocalChecked(), ServiceUserIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIContactPostActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIContactPostActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIContactPostActivatedEventArgs *wrapperInstance = new WebUIContactPostActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ContactGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Contacts::Contact^ result = wrapper->_instance->Contact;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Contacts", "Contact", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceUserIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceUserId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactPostActivatedEventArgs *wrapper = WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIContactPostActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ UnwrapWebUIContactPostActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIContactPostActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIContactPostActivatedEventArgs(::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIContactPostActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIContactPostActivatedEventArgs^ UnwrapWebUIContactPostActivatedEventArgs(Local<Value> value)
  {
     return WebUIContactPostActivatedEventArgs::Unwrap<WebUIContactPostActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIContactPostActivatedEventArgs(Local<Object> exports)
  {
    WebUIContactPostActivatedEventArgs::Init(exports);
  }

  class WebUIContactVideoCallActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIContactVideoCallActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("contact").ToLocalChecked(), ContactGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceId").ToLocalChecked(), ServiceIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("serviceUserId").ToLocalChecked(), ServiceUserIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("verb").ToLocalChecked(), VerbGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIContactVideoCallActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIContactVideoCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIContactVideoCallActivatedEventArgs *wrapperInstance = new WebUIContactVideoCallActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ContactGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Contacts::Contact^ result = wrapper->_instance->Contact;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Contacts", "Contact", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ServiceUserIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ServiceUserId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void VerbGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIContactVideoCallActivatedEventArgs *wrapper = WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Verb;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIContactVideoCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ UnwrapWebUIContactVideoCallActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIContactVideoCallActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIContactVideoCallActivatedEventArgs(::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIContactVideoCallActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIContactVideoCallActivatedEventArgs^ UnwrapWebUIContactVideoCallActivatedEventArgs(Local<Value> value)
  {
     return WebUIContactVideoCallActivatedEventArgs::Unwrap<WebUIContactVideoCallActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIContactVideoCallActivatedEventArgs(Local<Object> exports)
  {
    WebUIContactVideoCallActivatedEventArgs::Init(exports);
  }

  class WebUILockScreenCallActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUILockScreenCallActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("currentlyShownApplicationViewId").ToLocalChecked(), CurrentlyShownApplicationViewIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("callUI").ToLocalChecked(), CallUIGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("arguments").ToLocalChecked(), ArgumentsGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("tileId").ToLocalChecked(), TileIdGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUILockScreenCallActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUILockScreenCallActivatedEventArgs(::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUILockScreenCallActivatedEventArgs *wrapperInstance = new WebUILockScreenCallActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void CurrentlyShownApplicationViewIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        int result = wrapper->_instance->CurrentlyShownApplicationViewId;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void CallUIGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Calls::LockScreenCallUI^ result = wrapper->_instance->CallUI;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Calls", "LockScreenCallUI", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ArgumentsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Arguments;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void TileIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUILockScreenCallActivatedEventArgs *wrapper = WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->TileId;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUILockScreenCallActivatedEventArgs(::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ UnwrapWebUILockScreenCallActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUILockScreenCallActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUILockScreenCallActivatedEventArgs(::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUILockScreenCallActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUILockScreenCallActivatedEventArgs^ UnwrapWebUILockScreenCallActivatedEventArgs(Local<Value> value)
  {
     return WebUILockScreenCallActivatedEventArgs::Unwrap<WebUILockScreenCallActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUILockScreenCallActivatedEventArgs(Local<Object> exports)
  {
    WebUILockScreenCallActivatedEventArgs::Init(exports);
  }

  class WebUIRestrictedLaunchActivatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIRestrictedLaunchActivatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("kind").ToLocalChecked(), KindGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("previousExecutionState").ToLocalChecked(), PreviousExecutionStateGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("splashScreen").ToLocalChecked(), SplashScreenGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("activatedOperation").ToLocalChecked(), ActivatedOperationGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("sharedContext").ToLocalChecked(), SharedContextGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIRestrictedLaunchActivatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIRestrictedLaunchActivatedEventArgs(::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIRestrictedLaunchActivatedEventArgs *wrapperInstance = new WebUIRestrictedLaunchActivatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void KindGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIRestrictedLaunchActivatedEventArgs *wrapper = WebUIRestrictedLaunchActivatedEventArgs::Unwrap<WebUIRestrictedLaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ActivationKind result = wrapper->_instance->Kind;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PreviousExecutionStateGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIRestrictedLaunchActivatedEventArgs *wrapper = WebUIRestrictedLaunchActivatedEventArgs::Unwrap<WebUIRestrictedLaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::ApplicationExecutionState result = wrapper->_instance->PreviousExecutionState;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SplashScreenGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIRestrictedLaunchActivatedEventArgs *wrapper = WebUIRestrictedLaunchActivatedEventArgs::Unwrap<WebUIRestrictedLaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Activation::SplashScreen^ result = wrapper->_instance->SplashScreen;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "SplashScreen", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ActivatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIRestrictedLaunchActivatedEventArgs *wrapper = WebUIRestrictedLaunchActivatedEventArgs::Unwrap<WebUIRestrictedLaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::ActivatedOperation^ result = wrapper->_instance->ActivatedOperation;
        info.GetReturnValue().Set(WrapActivatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SharedContextGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUIRestrictedLaunchActivatedEventArgs *wrapper = WebUIRestrictedLaunchActivatedEventArgs::Unwrap<WebUIRestrictedLaunchActivatedEventArgs>(info.This());

      try 
      {
        ::Platform::Object^ result = wrapper->_instance->SharedContext;
        info.GetReturnValue().Set(CreateOpaqueWrapper(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIRestrictedLaunchActivatedEventArgs(::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ UnwrapWebUIRestrictedLaunchActivatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIRestrictedLaunchActivatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIRestrictedLaunchActivatedEventArgs(::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIRestrictedLaunchActivatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIRestrictedLaunchActivatedEventArgs^ UnwrapWebUIRestrictedLaunchActivatedEventArgs(Local<Value> value)
  {
     return WebUIRestrictedLaunchActivatedEventArgs::Unwrap<WebUIRestrictedLaunchActivatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIRestrictedLaunchActivatedEventArgs(Local<Object> exports)
  {
    WebUIRestrictedLaunchActivatedEventArgs::Init(exports);
  }

  class IWebUINavigatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("IWebUINavigatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("navigatedOperation").ToLocalChecked(), NavigatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("IWebUINavigatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    IWebUINavigatedEventArgs(::Windows::UI::WebUI::IWebUINavigatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::IWebUINavigatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::IWebUINavigatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::IWebUINavigatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      IWebUINavigatedEventArgs *wrapperInstance = new IWebUINavigatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void NavigatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::IWebUINavigatedEventArgs^>(info.This()))
      {
        return;
      }

      IWebUINavigatedEventArgs *wrapper = IWebUINavigatedEventArgs::Unwrap<IWebUINavigatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::WebUINavigatedOperation^ result = wrapper->_instance->NavigatedOperation;
        info.GetReturnValue().Set(WrapWebUINavigatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::IWebUINavigatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapIWebUINavigatedEventArgs(::Windows::UI::WebUI::IWebUINavigatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::IWebUINavigatedEventArgs^ UnwrapIWebUINavigatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> IWebUINavigatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapIWebUINavigatedEventArgs(::Windows::UI::WebUI::IWebUINavigatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(IWebUINavigatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::IWebUINavigatedEventArgs^ UnwrapIWebUINavigatedEventArgs(Local<Value> value)
  {
     return IWebUINavigatedEventArgs::Unwrap<IWebUINavigatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitIWebUINavigatedEventArgs(Local<Object> exports)
  {
    IWebUINavigatedEventArgs::Init(exports);
  }

  class WebUINavigatedOperation : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUINavigatedOperation").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
      
                        
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUINavigatedOperation").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUINavigatedOperation(::Windows::UI::WebUI::WebUINavigatedOperation^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUINavigatedOperation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUINavigatedOperation^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUINavigatedOperation^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUINavigatedOperation *wrapperInstance = new WebUINavigatedOperation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUINavigatedOperation^>(info.This()))
      {
        return;
      }

      WebUINavigatedOperation *wrapper = WebUINavigatedOperation::Unwrap<WebUINavigatedOperation>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::UI::WebUI::WebUINavigatedDeferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(WrapWebUINavigatedDeferral(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





  private:
    ::Windows::UI::WebUI::WebUINavigatedOperation^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUINavigatedOperation(::Windows::UI::WebUI::WebUINavigatedOperation^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUINavigatedOperation^ UnwrapWebUINavigatedOperation(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUINavigatedOperation::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUINavigatedOperation(::Windows::UI::WebUI::WebUINavigatedOperation^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUINavigatedOperation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUINavigatedOperation^ UnwrapWebUINavigatedOperation(Local<Value> value)
  {
     return WebUINavigatedOperation::Unwrap<WebUINavigatedOperation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUINavigatedOperation(Local<Object> exports)
  {
    WebUINavigatedOperation::Init(exports);
  }

  class SuspendingDeferral : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("SuspendingDeferral").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "complete", Complete);
      
                        
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("SuspendingDeferral").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SuspendingDeferral(::Windows::UI::WebUI::SuspendingDeferral^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::SuspendingDeferral^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::SuspendingDeferral^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::SuspendingDeferral^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SuspendingDeferral *wrapperInstance = new SuspendingDeferral(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void Complete(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::SuspendingDeferral^>(info.This()))
      {
        return;
      }

      SuspendingDeferral *wrapper = SuspendingDeferral::Unwrap<SuspendingDeferral>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Complete();
          return;   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





  private:
    ::Windows::UI::WebUI::SuspendingDeferral^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapSuspendingDeferral(::Windows::UI::WebUI::SuspendingDeferral^ wintRtInstance);
    friend ::Windows::UI::WebUI::SuspendingDeferral^ UnwrapSuspendingDeferral(Local<Value> value);
  };
  Persistent<FunctionTemplate> SuspendingDeferral::s_constructorTemplate;

  v8::Local<v8::Value> WrapSuspendingDeferral(::Windows::UI::WebUI::SuspendingDeferral^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SuspendingDeferral::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::SuspendingDeferral^ UnwrapSuspendingDeferral(Local<Value> value)
  {
     return SuspendingDeferral::Unwrap<SuspendingDeferral>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSuspendingDeferral(Local<Object> exports)
  {
    SuspendingDeferral::Init(exports);
  }

  class SuspendingOperation : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("SuspendingOperation").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
      
                        
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("deadline").ToLocalChecked(), DeadlineGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("SuspendingOperation").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SuspendingOperation(::Windows::UI::WebUI::SuspendingOperation^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::SuspendingOperation^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::SuspendingOperation^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::SuspendingOperation^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SuspendingOperation *wrapperInstance = new SuspendingOperation(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::SuspendingOperation^>(info.This()))
      {
        return;
      }

      SuspendingOperation *wrapper = SuspendingOperation::Unwrap<SuspendingOperation>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::ApplicationModel::SuspendingDeferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel", "SuspendingDeferral", result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void DeadlineGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::SuspendingOperation^>(info.This()))
      {
        return;
      }

      SuspendingOperation *wrapper = SuspendingOperation::Unwrap<SuspendingOperation>(info.This());

      try 
      {
        ::Windows::Foundation::DateTime result = wrapper->_instance->Deadline;
        info.GetReturnValue().Set(NodeRT::Utils::DateTimeToJS(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::SuspendingOperation^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapSuspendingOperation(::Windows::UI::WebUI::SuspendingOperation^ wintRtInstance);
    friend ::Windows::UI::WebUI::SuspendingOperation^ UnwrapSuspendingOperation(Local<Value> value);
  };
  Persistent<FunctionTemplate> SuspendingOperation::s_constructorTemplate;

  v8::Local<v8::Value> WrapSuspendingOperation(::Windows::UI::WebUI::SuspendingOperation^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SuspendingOperation::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::SuspendingOperation^ UnwrapSuspendingOperation(Local<Value> value)
  {
     return SuspendingOperation::Unwrap<SuspendingOperation>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSuspendingOperation(Local<Object> exports)
  {
    SuspendingOperation::Init(exports);
  }

  class SuspendingEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("SuspendingEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("suspendingOperation").ToLocalChecked(), SuspendingOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("SuspendingEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SuspendingEventArgs(::Windows::UI::WebUI::SuspendingEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::SuspendingEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::SuspendingEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::SuspendingEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      SuspendingEventArgs *wrapperInstance = new SuspendingEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void SuspendingOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::SuspendingEventArgs^>(info.This()))
      {
        return;
      }

      SuspendingEventArgs *wrapper = SuspendingEventArgs::Unwrap<SuspendingEventArgs>(info.This());

      try 
      {
        ::Windows::ApplicationModel::SuspendingOperation^ result = wrapper->_instance->SuspendingOperation;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel", "SuspendingOperation", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::SuspendingEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapSuspendingEventArgs(::Windows::UI::WebUI::SuspendingEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::SuspendingEventArgs^ UnwrapSuspendingEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> SuspendingEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapSuspendingEventArgs(::Windows::UI::WebUI::SuspendingEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(SuspendingEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::SuspendingEventArgs^ UnwrapSuspendingEventArgs(Local<Value> value)
  {
     return SuspendingEventArgs::Unwrap<SuspendingEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitSuspendingEventArgs(Local<Object> exports)
  {
    SuspendingEventArgs::Init(exports);
  }

  class IWebUIBackgroundTaskInstance : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("IWebUIBackgroundTaskInstance").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("succeeded").ToLocalChecked(), SucceededGetter, SucceededSetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("IWebUIBackgroundTaskInstance").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    IWebUIBackgroundTaskInstance(::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      IWebUIBackgroundTaskInstance *wrapperInstance = new IWebUIBackgroundTaskInstance(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void SucceededGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^>(info.This()))
      {
        return;
      }

      IWebUIBackgroundTaskInstance *wrapper = IWebUIBackgroundTaskInstance::Unwrap<IWebUIBackgroundTaskInstance>(info.This());

      try 
      {
        bool result = wrapper->_instance->Succeeded;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SucceededSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^>(info.This()))
      {
        return;
      }

      IWebUIBackgroundTaskInstance *wrapper = IWebUIBackgroundTaskInstance::Unwrap<IWebUIBackgroundTaskInstance>(info.This());

      try 
      {
        
        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->Succeeded = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapIWebUIBackgroundTaskInstance(::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ wintRtInstance);
    friend ::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ UnwrapIWebUIBackgroundTaskInstance(Local<Value> value);
  };
  Persistent<FunctionTemplate> IWebUIBackgroundTaskInstance::s_constructorTemplate;

  v8::Local<v8::Value> WrapIWebUIBackgroundTaskInstance(::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(IWebUIBackgroundTaskInstance::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ UnwrapIWebUIBackgroundTaskInstance(Local<Value> value)
  {
     return IWebUIBackgroundTaskInstance::Unwrap<IWebUIBackgroundTaskInstance>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitIWebUIBackgroundTaskInstance(Local<Object> exports)
  {
    IWebUIBackgroundTaskInstance::Init(exports);
  }

  class WebUIBackgroundTaskInstanceRuntimeClass : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIBackgroundTaskInstanceRuntimeClass").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "getDeferral", GetDeferral);
      
                  
      Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
      Nan::SetPrototypeMethod(localRef,"on", AddListener);
      Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
      Nan::SetPrototypeMethod(localRef, "off", RemoveListener);
            
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("succeeded").ToLocalChecked(), SucceededGetter, SucceededSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("progress").ToLocalChecked(), ProgressGetter, ProgressSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("instanceId").ToLocalChecked(), InstanceIdGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("suspendedCount").ToLocalChecked(), SuspendedCountGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("task").ToLocalChecked(), TaskGetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("triggerDetails").ToLocalChecked(), TriggerDetailsGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUIBackgroundTaskInstanceRuntimeClass").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIBackgroundTaskInstanceRuntimeClass(::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIBackgroundTaskInstanceRuntimeClass *wrapperInstance = new WebUIBackgroundTaskInstanceRuntimeClass(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void GetDeferral(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::ApplicationModel::Background::BackgroundTaskDeferral^ result;
          result = wrapper->_instance->GetDeferral();
          info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Background", "BackgroundTaskDeferral", result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void SucceededGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        bool result = wrapper->_instance->Succeeded;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SucceededSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        
        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->Succeeded = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void ProgressGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->Progress;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ProgressSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsUint32())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        
        unsigned int winRtValue = static_cast<unsigned int>(Nan::To<uint32_t>(value).FromMaybe(0));

        wrapper->_instance->Progress = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void InstanceIdGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        ::Platform::Guid result = wrapper->_instance->InstanceId;
        info.GetReturnValue().Set(NodeRT::Utils::GuidToJs(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void SuspendedCountGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->SuspendedCount;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void TaskGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        ::Windows::ApplicationModel::Background::BackgroundTaskRegistration^ result = wrapper->_instance->Task;
        info.GetReturnValue().Set(NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Background", "BackgroundTaskRegistration", result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void TriggerDetailsGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
      {
        return;
      }

      WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());

      try 
      {
        ::Platform::Object^ result = wrapper->_instance->TriggerDetails;
        info.GetReturnValue().Set(CreateOpaqueWrapper(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
		return;
      }

      String::Value eventName(info[0]);
      auto str = *eventName;
      
      Local<Function> callback = info[1].As<Function>();
      
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"canceled", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
        {
          Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
		  return;
        }
        WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());
      
        try
        {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr, 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = wrapper->_instance->Canceled::add(
            ref new ::Windows::ApplicationModel::Background::BackgroundTaskCanceledEventHandler(
            [callbackObjPtr](::Windows::ApplicationModel::Background::IBackgroundTaskInstance^ arg0, ::Windows::ApplicationModel::Background::BackgroundTaskCancellationReason arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Local<Value> error;

                Local<Value> wrappedArg0 = NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Background", "IBackgroundTaskInstance", arg0);
                Local<Value> wrappedArg1 = Nan::New<Integer>(static_cast<int>(arg1));

                if (tryCatch.HasCaught())
                {
                  error = Nan::To<Object>(tryCatch.Exception()).ToLocalChecked();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else 
      {
        Nan::ThrowError(Nan::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
		return;
      }

      Local<Object> tokenMap = Nan::To<Object>(NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked())).ToLocalChecked();
                
      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap,Undefined()).FromMaybe(false))
      {
		  tokenMap = Nan::New<Object>();
		  NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      }

      Nan::Set(tokenMap, info[1], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(info[0]);
      auto str = *eventName;

      if ((NodeRT::Utils::CaseInsenstiveEquals(L"canceled", str)))
      {
        Nan::ThrowError(Nan::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
                
      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false))
      {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[1]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false))
      {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());
            
      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;
        
      try 
      {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"canceled", str))
        {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^>(info.This()))
          {
            Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"The caller of this method isn't of the expected type or internal WinRt object was disposed")));
            return;
          }
          WebUIBackgroundTaskInstanceRuntimeClass *wrapper = WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(info.This());
          wrapper->_instance->Canceled::remove(registrationToken);
        }
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
  private:
    ::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIBackgroundTaskInstanceRuntimeClass(::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ UnwrapWebUIBackgroundTaskInstanceRuntimeClass(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIBackgroundTaskInstanceRuntimeClass::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIBackgroundTaskInstanceRuntimeClass(::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIBackgroundTaskInstanceRuntimeClass::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIBackgroundTaskInstanceRuntimeClass^ UnwrapWebUIBackgroundTaskInstanceRuntimeClass(Local<Value> value)
  {
     return WebUIBackgroundTaskInstanceRuntimeClass::Unwrap<WebUIBackgroundTaskInstanceRuntimeClass>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIBackgroundTaskInstanceRuntimeClass(Local<Object> exports)
  {
    WebUIBackgroundTaskInstanceRuntimeClass::Init(exports);
  }

  class WebUIBackgroundTaskInstance : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIBackgroundTaskInstance").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();

      Nan::SetAccessor(constructor, Nan::New<String>("current").ToLocalChecked(), CurrentGetter);

      Nan::Set(exports, Nan::New<String>("WebUIBackgroundTaskInstance").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIBackgroundTaskInstance(::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIBackgroundTaskInstance^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIBackgroundTaskInstance^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIBackgroundTaskInstance *wrapperInstance = new WebUIBackgroundTaskInstance(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  




    static void CurrentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;

      try 
      {
        ::Windows::UI::WebUI::IWebUIBackgroundTaskInstance^ result = ::Windows::UI::WebUI::WebUIBackgroundTaskInstance::Current;
        info.GetReturnValue().Set(WrapIWebUIBackgroundTaskInstance(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    

  private:
    ::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIBackgroundTaskInstance(::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ UnwrapWebUIBackgroundTaskInstance(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIBackgroundTaskInstance::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIBackgroundTaskInstance(::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIBackgroundTaskInstance::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIBackgroundTaskInstance^ UnwrapWebUIBackgroundTaskInstance(Local<Value> value)
  {
     return WebUIBackgroundTaskInstance::Unwrap<WebUIBackgroundTaskInstance>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIBackgroundTaskInstance(Local<Object> exports)
  {
    WebUIBackgroundTaskInstance::Init(exports);
  }

  class WebUINavigatedDeferral : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUINavigatedDeferral").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "complete", Complete);
      
                        
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUINavigatedDeferral").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUINavigatedDeferral(::Windows::UI::WebUI::WebUINavigatedDeferral^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUINavigatedDeferral^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUINavigatedDeferral^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUINavigatedDeferral^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUINavigatedDeferral *wrapperInstance = new WebUINavigatedDeferral(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void Complete(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUINavigatedDeferral^>(info.This()))
      {
        return;
      }

      WebUINavigatedDeferral *wrapper = WebUINavigatedDeferral::Unwrap<WebUINavigatedDeferral>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Complete();
          return;   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }





  private:
    ::Windows::UI::WebUI::WebUINavigatedDeferral^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUINavigatedDeferral(::Windows::UI::WebUI::WebUINavigatedDeferral^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUINavigatedDeferral^ UnwrapWebUINavigatedDeferral(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUINavigatedDeferral::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUINavigatedDeferral(::Windows::UI::WebUI::WebUINavigatedDeferral^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUINavigatedDeferral::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUINavigatedDeferral^ UnwrapWebUINavigatedDeferral(Local<Value> value)
  {
     return WebUINavigatedDeferral::Unwrap<WebUINavigatedDeferral>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUINavigatedDeferral(Local<Object> exports)
  {
    WebUINavigatedDeferral::Init(exports);
  }

  class WebUINavigatedEventArgs : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUINavigatedEventArgs").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("navigatedOperation").ToLocalChecked(), NavigatedOperationGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("WebUINavigatedEventArgs").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUINavigatedEventArgs(::Windows::UI::WebUI::WebUINavigatedEventArgs^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUINavigatedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUINavigatedEventArgs^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUINavigatedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUINavigatedEventArgs *wrapperInstance = new WebUINavigatedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  



    static void NavigatedOperationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUINavigatedEventArgs^>(info.This()))
      {
        return;
      }

      WebUINavigatedEventArgs *wrapper = WebUINavigatedEventArgs::Unwrap<WebUINavigatedEventArgs>(info.This());

      try 
      {
        ::Windows::UI::WebUI::WebUINavigatedOperation^ result = wrapper->_instance->NavigatedOperation;
        info.GetReturnValue().Set(WrapWebUINavigatedOperation(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::WebUINavigatedEventArgs^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUINavigatedEventArgs(::Windows::UI::WebUI::WebUINavigatedEventArgs^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUINavigatedEventArgs^ UnwrapWebUINavigatedEventArgs(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUINavigatedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUINavigatedEventArgs(::Windows::UI::WebUI::WebUINavigatedEventArgs^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUINavigatedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUINavigatedEventArgs^ UnwrapWebUINavigatedEventArgs(Local<Value> value)
  {
     return WebUINavigatedEventArgs::Unwrap<WebUINavigatedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUINavigatedEventArgs(Local<Object> exports)
  {
    WebUINavigatedEventArgs::Init(exports);
  }

  class WebUIApplication : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("WebUIApplication").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();

      
      Local<Function> addListenerFunc = Nan::GetFunction(Nan::New<FunctionTemplate>(AddListener)).ToLocalChecked();
      Nan::Set(constructor, Nan::New<String>("addListener").ToLocalChecked(), addListenerFunc);
      Nan::Set(constructor, Nan::New<String>("on").ToLocalChecked(), addListenerFunc);
      Local<Function> removeListenerFunc = Nan::GetFunction(Nan::New<FunctionTemplate>(RemoveListener)).ToLocalChecked();
      Nan::Set(constructor, Nan::New<String>("removeListener").ToLocalChecked(), removeListenerFunc);
      Nan::Set(constructor, Nan::New<String>("off").ToLocalChecked(), removeListenerFunc);

      Nan::Set(exports, Nan::New<String>("WebUIApplication").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    WebUIApplication(::Windows::UI::WebUI::WebUIApplication^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::WebUIApplication^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::WebUIApplication^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::WebUIApplication^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      WebUIApplication *wrapperInstance = new WebUIApplication(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  





    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
		return;
      }

      String::Value eventName(info[0]);
      auto str = *eventName;
      
      Local<Function> callback = info[1].As<Function>();
      
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"activated", str))
      {
      
        try
        {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr, 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = ::Windows::UI::WebUI::WebUIApplication::Activated::add(
            ref new ::Windows::UI::WebUI::ActivatedEventHandler(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::ApplicationModel::Activation::IActivatedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Local<Value> error;

                Local<Value> wrappedArg0 = CreateOpaqueWrapper(arg0);
                Local<Value> wrappedArg1 = NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel.Activation", "IActivatedEventArgs", arg1);

                if (tryCatch.HasCaught())
                {
                  error = Nan::To<Object>(tryCatch.Exception()).ToLocalChecked();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"navigated", str))
      {
      
        try
        {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr, 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = ::Windows::UI::WebUI::WebUIApplication::Navigated::add(
            ref new ::Windows::UI::WebUI::NavigatedEventHandler(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::UI::WebUI::IWebUINavigatedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Local<Value> error;

                Local<Value> wrappedArg0 = CreateOpaqueWrapper(arg0);
                Local<Value> wrappedArg1 = WrapIWebUINavigatedEventArgs(arg1);

                if (tryCatch.HasCaught())
                {
                  error = Nan::To<Object>(tryCatch.Exception()).ToLocalChecked();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"resuming", str))
      {
      
        try
        {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr, 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = ::Windows::UI::WebUI::WebUIApplication::Resuming::add(
            ref new ::Windows::UI::WebUI::ResumingEventHandler(
            [callbackObjPtr](::Platform::Object^ arg0) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0]() {
                TryCatch tryCatch;
              
                Local<Value> error;

                Local<Value> wrappedArg0 = CreateOpaqueWrapper(arg0);

                if (tryCatch.HasCaught())
                {
                  error = Nan::To<Object>(tryCatch.Exception()).ToLocalChecked();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();

                Local<Value> args[] = { wrappedArg0 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else if (NodeRT::Utils::CaseInsenstiveEquals(L"suspending", str))
      {
      
        try
        {
          Persistent<Object>* perstPtr = new Persistent<Object>();
          perstPtr->Reset(NodeRT::Utils::CreateCallbackObjectInDomain(callback));
          std::shared_ptr<Persistent<Object>> callbackObjPtr(perstPtr, 
            [] (Persistent<Object> *ptr ) {
              NodeUtils::Async::RunOnMain([ptr]() {
                ptr->Reset();
                delete ptr;
            });
          });

          registrationToken = ::Windows::UI::WebUI::WebUIApplication::Suspending::add(
            ref new ::Windows::UI::WebUI::SuspendingEventHandler(
            [callbackObjPtr](::Platform::Object^ arg0, ::Windows::ApplicationModel::ISuspendingEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                TryCatch tryCatch;
              
                Local<Value> error;

                Local<Value> wrappedArg0 = CreateOpaqueWrapper(arg0);
                Local<Value> wrappedArg1 = NodeRT::Utils::CreateExternalWinRTObject("Windows.ApplicationModel", "ISuspendingEventArgs", arg1);

                if (tryCatch.HasCaught())
                {
                  error = Nan::To<Object>(tryCatch.Exception()).ToLocalChecked();
                }
                else 
                {
                  error = Undefined();
                }


                if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
      else 
      {
        Nan::ThrowError(Nan::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
		return;
      }

      Local<Object> tokenMap = Nan::To<Object>(NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked())).ToLocalChecked();
                
      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap,Undefined()).FromMaybe(false))
      {
		  tokenMap = Nan::New<Object>();
		  NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      }

      Nan::Set(tokenMap, info[1], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(info[0]);
      auto str = *eventName;

      if ((NodeRT::Utils::CaseInsenstiveEquals(L"activated", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"navigated", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"resuming", str)) &&(NodeRT::Utils::CaseInsenstiveEquals(L"suspending", str)))
      {
        Nan::ThrowError(Nan::Error(String::Concat(NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
                
      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false))
      {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[1]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false))
      {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());
            
      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;
        
      try 
      {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"activated", str))
        {
          ::Windows::UI::WebUI::WebUIApplication::Activated::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"navigated", str))
        {
          ::Windows::UI::WebUI::WebUIApplication::Navigated::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"resuming", str))
        {
          ::Windows::UI::WebUI::WebUIApplication::Resuming::remove(registrationToken);
        }
        else if (NodeRT::Utils::CaseInsenstiveEquals(L"suspending", str))
        {
          ::Windows::UI::WebUI::WebUIApplication::Suspending::remove(registrationToken);
        }
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }

      Nan::Delete(Nan::To<Object>(tokenMap).ToLocalChecked(), Nan::To<String>(info[0]).ToLocalChecked());
    }
  private:
    ::Windows::UI::WebUI::WebUIApplication^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapWebUIApplication(::Windows::UI::WebUI::WebUIApplication^ wintRtInstance);
    friend ::Windows::UI::WebUI::WebUIApplication^ UnwrapWebUIApplication(Local<Value> value);
  };
  Persistent<FunctionTemplate> WebUIApplication::s_constructorTemplate;

  v8::Local<v8::Value> WrapWebUIApplication(::Windows::UI::WebUI::WebUIApplication^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(WebUIApplication::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::WebUIApplication^ UnwrapWebUIApplication(Local<Value> value)
  {
     return WebUIApplication::Unwrap<WebUIApplication>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitWebUIApplication(Local<Object> exports)
  {
    WebUIApplication::Init(exports);
  }

  class HtmlPrintDocumentSource : public WrapperBase
  {
  public:    
    static void Init(const Local<Object> exports)
    {
      HandleScope scope;
      
      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(New);
      s_constructorTemplate.Reset(localRef);
      localRef->SetClassName(Nan::New<String>("HtmlPrintDocumentSource").ToLocalChecked());
      localRef->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      Nan::SetPrototypeMethod(localRef, "trySetPageRange", TrySetPageRange);
      Nan::SetPrototypeMethod(localRef, "close", Close);
      
                        
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("topMargin").ToLocalChecked(), TopMarginGetter, TopMarginSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("shrinkToFit").ToLocalChecked(), ShrinkToFitGetter, ShrinkToFitSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rightMargin").ToLocalChecked(), RightMarginGetter, RightMarginSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("percentScale").ToLocalChecked(), PercentScaleGetter, PercentScaleSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("leftMargin").ToLocalChecked(), LeftMarginGetter, LeftMarginSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("enableHeaderFooter").ToLocalChecked(), EnableHeaderFooterGetter, EnableHeaderFooterSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("content").ToLocalChecked(), ContentGetter, ContentSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("bottomMargin").ToLocalChecked(), BottomMarginGetter, BottomMarginSetter);
      Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("pageRange").ToLocalChecked(), PageRangeGetter);
      
      Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();


      Nan::Set(exports, Nan::New<String>("HtmlPrintDocumentSource").ToLocalChecked(), constructor);
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    HtmlPrintDocumentSource(::Windows::UI::WebUI::HtmlPrintDocumentSource^ instance)
    {
      _instance = instance;
    }
    
    
    static void New(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

	    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This()))
      {
        if (info.Length() > 0)
        {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++)
          {
            argsPtr[i] = info[i];
          }

          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get()).ToLocalChecked());
	    	  return;
        }
        else
        {
          info.GetReturnValue().Set(Nan::CallAsConstructor(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr).ToLocalChecked());
		       return;
        }
      }
      
      ::Windows::UI::WebUI::HtmlPrintDocumentSource^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info[0]))
      {
        try 
        {
          winRtInstance = (::Windows::UI::WebUI::HtmlPrintDocumentSource^) NodeRT::Utils::GetObjectInstance(info[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
	    	return;
      }

      NodeRT::Utils::SetHiddenValue(info.This(), Nan::New<String>("__winRtInstance__").ToLocalChecked(), True());

      HtmlPrintDocumentSource *wrapperInstance = new HtmlPrintDocumentSource(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


  
    static void TrySetPageRange(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      if (info.Length() == 1
        && info[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(info[0])));
          
          bool result;
          result = wrapper->_instance->TrySetPageRange(arg0);
          info.GetReturnValue().Set(Nan::New<Boolean>(result));
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Close(Nan::NAN_METHOD_ARGS_TYPE info)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
	    return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          delete wrapper->_instance;
          wrapper->_instance = nullptr;
		  return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
		  return;
        }
      }
      else 
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
		return;
      }
    }




    static void TopMarginGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        float result = wrapper->_instance->TopMargin;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void TopMarginSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->TopMargin = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void ShrinkToFitGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        bool result = wrapper->_instance->ShrinkToFit;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ShrinkToFitSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->ShrinkToFit = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void RightMarginGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        float result = wrapper->_instance->RightMargin;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void RightMarginSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->RightMargin = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void PercentScaleGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        float result = wrapper->_instance->PercentScale;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void PercentScaleSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->PercentScale = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void LeftMarginGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        float result = wrapper->_instance->LeftMargin;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void LeftMarginSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->LeftMargin = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void EnableHeaderFooterGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        bool result = wrapper->_instance->EnableHeaderFooter;
        info.GetReturnValue().Set(Nan::New<Boolean>(result));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void EnableHeaderFooterSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        bool winRtValue = Nan::To<bool>(value).FromMaybe(false);

        wrapper->_instance->EnableHeaderFooter = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void ContentGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        ::Windows::UI::WebUI::PrintContent result = wrapper->_instance->Content;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void ContentSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsInt32())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        ::Windows::UI::WebUI::PrintContent winRtValue = static_cast<::Windows::UI::WebUI::PrintContent>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Content = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void BottomMarginGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        float result = wrapper->_instance->BottomMargin;
        info.GetReturnValue().Set(Nan::New<Number>(static_cast<double>(result)));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    
    static void BottomMarginSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info)
    {
      HandleScope scope;
      
      if (!value->IsNumber())
      {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        
        float winRtValue = static_cast<float>(Nan::To<double>(value).FromMaybe(0.0));

        wrapper->_instance->BottomMargin = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static void PageRangeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::UI::WebUI::HtmlPrintDocumentSource^>(info.This()))
      {
        return;
      }

      HtmlPrintDocumentSource *wrapper = HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->PageRange;
        info.GetReturnValue().Set(NodeRT::Utils::NewString(result->Data()));
        return;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
    


  private:
    ::Windows::UI::WebUI::HtmlPrintDocumentSource^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Local<v8::Value> WrapHtmlPrintDocumentSource(::Windows::UI::WebUI::HtmlPrintDocumentSource^ wintRtInstance);
    friend ::Windows::UI::WebUI::HtmlPrintDocumentSource^ UnwrapHtmlPrintDocumentSource(Local<Value> value);
  };
  Persistent<FunctionTemplate> HtmlPrintDocumentSource::s_constructorTemplate;

  v8::Local<v8::Value> WrapHtmlPrintDocumentSource(::Windows::UI::WebUI::HtmlPrintDocumentSource^ winRtInstance)
  {
    EscapableHandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Escape(Undefined());
    }

    Local<Value> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Local<Value> args[] = {opaqueWrapper};
    Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(HtmlPrintDocumentSource::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::UI::WebUI::HtmlPrintDocumentSource^ UnwrapHtmlPrintDocumentSource(Local<Value> value)
  {
     return HtmlPrintDocumentSource::Unwrap<HtmlPrintDocumentSource>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitHtmlPrintDocumentSource(Local<Object> exports)
  {
    HtmlPrintDocumentSource::Init(exports);
  }

} } } } 

NAN_MODULE_INIT(init)
{
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
  {
    Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  
  NodeRT::Windows::UI::WebUI::InitPrintContentEnum(target);
  NodeRT::Windows::UI::WebUI::InitActivatedDeferral(target);
  NodeRT::Windows::UI::WebUI::InitActivatedOperation(target);
  NodeRT::Windows::UI::WebUI::InitIActivatedEventArgsDeferral(target);
  NodeRT::Windows::UI::WebUI::InitWebUILaunchActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUISearchActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIShareTargetActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIFileActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIProtocolActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIFileOpenPickerActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIFileSavePickerActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUICachedFileUpdaterActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIContactPickerActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIDeviceActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIPrintTaskSettingsActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUICameraSettingsActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIAppointmentsProviderAddAppointmentActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIAppointmentsProviderReplaceAppointmentActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIAppointmentsProviderRemoveAppointmentActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIAppointmentsProviderShowTimeFrameActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIContactCallActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIContactMessageActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIContactMapActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIContactPostActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIContactVideoCallActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUILockScreenCallActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIRestrictedLaunchActivatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitIWebUINavigatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUINavigatedOperation(target);
  NodeRT::Windows::UI::WebUI::InitSuspendingDeferral(target);
  NodeRT::Windows::UI::WebUI::InitSuspendingOperation(target);
  NodeRT::Windows::UI::WebUI::InitSuspendingEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitIWebUIBackgroundTaskInstance(target);
  NodeRT::Windows::UI::WebUI::InitWebUIBackgroundTaskInstanceRuntimeClass(target);
  NodeRT::Windows::UI::WebUI::InitWebUIBackgroundTaskInstance(target);
  NodeRT::Windows::UI::WebUI::InitWebUINavigatedDeferral(target);
  NodeRT::Windows::UI::WebUI::InitWebUINavigatedEventArgs(target);
  NodeRT::Windows::UI::WebUI::InitWebUIApplication(target);
  NodeRT::Windows::UI::WebUI::InitHtmlPrintDocumentSource(target);

  NodeRT::Utils::RegisterNameSpace("Windows.UI.WebUI", target);
}


NODE_MODULE(binding, init)