// Copyright (c) The NodeRT Contributors
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may
// not use this file except in compliance with the License. You may obtain a
// copy of the License at http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
// OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
// IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
//
// See the Apache Version 2.0 License for specific language governing permissions
// and limitations under the License.

// TODO: Verify that this is is still needed..
#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include "nan.h"
#include <string>
#include <ppltasks.h>
#include "CollectionsConverter.h"
#include "CollectionsWrap.h"
#include "node-async.h"
#include "NodeRtUtils.h"
#include "OpaqueWrapper.h"
#include "WrapperBase.h"

#using <Windows.WinMD>

// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods
#undef DocumentProperties
#undef GetObject
#undef CreateEvent
#undef FindText
#undef SendMessage

const char* REGISTRATION_TOKEN_MAP_PROPERTY_NAME = "__registrationTokenMap__";

using v8::Array;
using v8::String;
using v8::Value;
using v8::Boolean;
using v8::Integer;
using v8::FunctionTemplate;
using v8::Object;
using v8::Local;
using v8::Function;
using v8::Date;
using v8::Number;
using v8::PropertyAttribute;
using v8::Primitive;
using Nan::HandleScope;
using Nan::Persistent;
using Nan::Undefined;
using Nan::True;
using Nan::False;
using Nan::Null;
using Nan::MaybeLocal;
using Nan::EscapableHandleScope;
using Nan::HandleScope;
using Nan::TryCatch;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace Devices { namespace Lights { namespace Effects { 
  v8::Local<v8::Value> WrapILampArrayEffect(::Windows::Devices::Lights::Effects::ILampArrayEffect^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::ILampArrayEffect^ UnwrapILampArrayEffect(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArrayBitmapEffect(::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ UnwrapLampArrayBitmapEffect(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArrayBitmapRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ UnwrapLampArrayBitmapRequestedEventArgs(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArrayBlinkEffect(::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ UnwrapLampArrayBlinkEffect(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArrayColorRampEffect(::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ UnwrapLampArrayColorRampEffect(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArrayCustomEffect(::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ UnwrapLampArrayCustomEffect(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArrayEffectPlaylist(::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ UnwrapLampArrayEffectPlaylist(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArraySolidEffect(::Windows::Devices::Lights::Effects::LampArraySolidEffect^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArraySolidEffect^ UnwrapLampArraySolidEffect(Local<Value> value);
  
  v8::Local<v8::Value> WrapLampArrayUpdateRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ wintRtInstance);
  ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ UnwrapLampArrayUpdateRequestedEventArgs(Local<Value> value);
  



  static void InitLampArrayEffectCompletionBehaviorEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("LampArrayEffectCompletionBehavior").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("clearState").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior::ClearState)));
    Nan::Set(enumObject, Nan::New<String>("keepState").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior::KeepState)));
  }

  static void InitLampArrayEffectStartModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("LampArrayEffectStartMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("sequential").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::Devices::Lights::Effects::LampArrayEffectStartMode::Sequential)));
    Nan::Set(enumObject, Nan::New<String>("simultaneous").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::Devices::Lights::Effects::LampArrayEffectStartMode::Simultaneous)));
  }

  static void InitLampArrayRepetitionModeEnum(const Local<Object> exports) {
    HandleScope scope;

    Local<Object> enumObject = Nan::New<Object>();

    Nan::Set(exports, Nan::New<String>("LampArrayRepetitionMode").ToLocalChecked(), enumObject);
    Nan::Set(enumObject, Nan::New<String>("occurrences").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::Devices::Lights::Effects::LampArrayRepetitionMode::Occurrences)));
    Nan::Set(enumObject, Nan::New<String>("forever").ToLocalChecked(), Nan::New<Integer>(static_cast<int>(::Windows::Devices::Lights::Effects::LampArrayRepetitionMode::Forever)));
  }


  static bool IsSizeJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::Foundation::Size SizeFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::Foundation::Size returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> SizeToJsObject(::Windows::Foundation::Size value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }
  static bool IsColorJsObject(Local<Value> value) {
    if (!value->IsObject()) {
      return false;
    }

    Local<String> symbol;
    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();

    return true;
  }

  ::Windows::UI::Color ColorFromJsObject(Local<Value> value) {
    HandleScope scope;
    ::Windows::UI::Color returnValue;

    if (!value->IsObject()) {
      Nan::ThrowError(Nan::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Local<Object> obj = Nan::To<Object>(value).ToLocalChecked();
    Local<String> symbol;

    return returnValue;
  }

  Local<Value> ColorToJsObject(::Windows::UI::Color value) {
    EscapableHandleScope scope;

    Local<Object> obj = Nan::New<Object>();


    return scope.Escape(obj);
  }

  class ILampArrayEffect : 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>("ILampArrayEffect").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("zIndex").ToLocalChecked(), ZIndexGetter, ZIndexSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("ILampArrayEffect").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      ILampArrayEffect(::Windows::Devices::Lights::Effects::ILampArrayEffect^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::ILampArrayEffect^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::ILampArrayEffect^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::ILampArrayEffect^) 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());

      ILampArrayEffect *wrapperInstance = new ILampArrayEffect(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::ILampArrayEffect^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::ILampArrayEffect^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::ILampArrayEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapILampArrayEffect(winRtInstance));
    }





    static void ZIndexGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::ILampArrayEffect^>(info.This())) {
        return;
      }

      ILampArrayEffect *wrapper = ILampArrayEffect::Unwrap<ILampArrayEffect>(info.This());

      try  {
        int result = wrapper->_instance->ZIndex;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ZIndexSetter(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::Devices::Lights::Effects::ILampArrayEffect^>(info.This())) {
        return;
      }

      ILampArrayEffect *wrapper = ILampArrayEffect::Unwrap<ILampArrayEffect>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ZIndex = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::Devices::Lights::Effects::ILampArrayEffect^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapILampArrayEffect(::Windows::Devices::Lights::Effects::ILampArrayEffect^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::ILampArrayEffect^ UnwrapILampArrayEffect(Local<Value> value);
  };

  Persistent<FunctionTemplate> ILampArrayEffect::s_constructorTemplate;

  v8::Local<v8::Value> WrapILampArrayEffect(::Windows::Devices::Lights::Effects::ILampArrayEffect^ 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>(ILampArrayEffect::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::ILampArrayEffect^ UnwrapILampArrayEffect(Local<Value> value) {
     return ILampArrayEffect::Unwrap<ILampArrayEffect>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitILampArrayEffect(Local<Object> exports) {
    ILampArrayEffect::Init(exports);
  }

  class LampArrayBitmapEffect : 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>("LampArrayBitmapEffect").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);




          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);

          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("updateInterval").ToLocalChecked(), UpdateIntervalGetter, UpdateIntervalSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("startDelay").ToLocalChecked(), StartDelayGetter, StartDelaySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("suggestedBitmapSize").ToLocalChecked(), SuggestedBitmapSizeGetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("zIndex").ToLocalChecked(), ZIndexGetter, ZIndexSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LampArrayBitmapEffect").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArrayBitmapEffect(::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::LampArray^>(info[0])
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<int>^>(info[1]) || info[1]->IsArray()))
      {
        try {
          ::Windows::Devices::Lights::LampArray^ arg0 = dynamic_cast<::Windows::Devices::Lights::LampArray^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Platform::Array<int>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<int>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<int>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> int {
                   return static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<int>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          winRtInstance = ref new ::Windows::Devices::Lights::Effects::LampArrayBitmapEffect(arg0,arg1);
        } 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());

      LampArrayBitmapEffect *wrapperInstance = new LampArrayBitmapEffect(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArrayBitmapEffect(winRtInstance));
    }





    static void UpdateIntervalGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->UpdateInterval;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void UpdateIntervalSetter(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::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->UpdateInterval = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void StartDelayGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->StartDelay;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StartDelaySetter(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::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->StartDelay = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void SuggestedBitmapSizeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try  {
        ::Windows::Foundation::Size result = wrapper->_instance->SuggestedBitmapSize;
        info.GetReturnValue().Set(NodeRT::Utils::SizeToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ZIndexGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try  {
        int result = wrapper->_instance->ZIndex;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ZIndexSetter(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::Devices::Lights::Effects::LampArrayBitmapEffect^>(info.This())) {
        return;
      }

      LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ZIndex = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"bitmapRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(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;
        }
        LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(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->BitmapRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^, ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^>(
            [callbackObjPtr](::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ arg0, ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapLampArrayBitmapEffect(arg0);
                  wrappedArg1 = WrapLampArrayBitmapRequestedEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"bitmapRequested", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"bitmapRequested", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^>(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;
          }
          LampArrayBitmapEffect *wrapper = LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(info.This());
          wrapper->_instance->BitmapRequested::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::Devices::Lights::Effects::LampArrayBitmapEffect^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArrayBitmapEffect(::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ UnwrapLampArrayBitmapEffect(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArrayBitmapEffect::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArrayBitmapEffect(::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ 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>(LampArrayBitmapEffect::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArrayBitmapEffect^ UnwrapLampArrayBitmapEffect(Local<Value> value) {
     return LampArrayBitmapEffect::Unwrap<LampArrayBitmapEffect>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArrayBitmapEffect(Local<Object> exports) {
    LampArrayBitmapEffect::Init(exports);
  }

  class LampArrayBitmapRequestedEventArgs : 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>("LampArrayBitmapRequestedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "updateBitmap", UpdateBitmap);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("sinceStarted").ToLocalChecked(), SinceStartedGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LampArrayBitmapRequestedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArrayBitmapRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^) 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());

      LampArrayBitmapRequestedEventArgs *wrapperInstance = new LampArrayBitmapRequestedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArrayBitmapRequestedEventArgs(winRtInstance));
    }


    static void UpdateBitmap(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^>(info.This())) {
        return;
      }

      LampArrayBitmapRequestedEventArgs *wrapper = LampArrayBitmapRequestedEventArgs::Unwrap<LampArrayBitmapRequestedEventArgs>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Graphics::Imaging::SoftwareBitmap^>(info[0]))
      {
        try
        {
          ::Windows::Graphics::Imaging::SoftwareBitmap^ arg0 = dynamic_cast<::Windows::Graphics::Imaging::SoftwareBitmap^>(NodeRT::Utils::GetObjectInstance(info[0]));
          
          wrapper->_instance->UpdateBitmap(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void SinceStartedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^>(info.This())) {
        return;
      }

      LampArrayBitmapRequestedEventArgs *wrapper = LampArrayBitmapRequestedEventArgs::Unwrap<LampArrayBitmapRequestedEventArgs>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->SinceStarted;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArrayBitmapRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ UnwrapLampArrayBitmapRequestedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArrayBitmapRequestedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArrayBitmapRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ 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>(LampArrayBitmapRequestedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArrayBitmapRequestedEventArgs^ UnwrapLampArrayBitmapRequestedEventArgs(Local<Value> value) {
     return LampArrayBitmapRequestedEventArgs::Unwrap<LampArrayBitmapRequestedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArrayBitmapRequestedEventArgs(Local<Object> exports) {
    LampArrayBitmapRequestedEventArgs::Init(exports);
  }

  class LampArrayBlinkEffect : 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>("LampArrayBlinkEffect").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("sustainDuration").ToLocalChecked(), SustainDurationGetter, SustainDurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("startDelay").ToLocalChecked(), StartDelayGetter, StartDelaySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("repetitionMode").ToLocalChecked(), RepetitionModeGetter, RepetitionModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("repetitionDelay").ToLocalChecked(), RepetitionDelayGetter, RepetitionDelaySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("occurrences").ToLocalChecked(), OccurrencesGetter, OccurrencesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("decayDuration").ToLocalChecked(), DecayDurationGetter, DecayDurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("attackDuration").ToLocalChecked(), AttackDurationGetter, AttackDurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("zIndex").ToLocalChecked(), ZIndexGetter, ZIndexSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LampArrayBlinkEffect").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArrayBlinkEffect(::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::LampArray^>(info[0])
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<int>^>(info[1]) || info[1]->IsArray()))
      {
        try {
          ::Windows::Devices::Lights::LampArray^ arg0 = dynamic_cast<::Windows::Devices::Lights::LampArray^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Platform::Array<int>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<int>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<int>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> int {
                   return static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<int>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          winRtInstance = ref new ::Windows::Devices::Lights::Effects::LampArrayBlinkEffect(arg0,arg1);
        } 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());

      LampArrayBlinkEffect *wrapperInstance = new LampArrayBlinkEffect(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArrayBlinkEffect(winRtInstance));
    }





    static void SustainDurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->SustainDuration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void SustainDurationSetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->SustainDuration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void StartDelayGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->StartDelay;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StartDelaySetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->StartDelay = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RepetitionModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        ::Windows::Devices::Lights::Effects::LampArrayRepetitionMode result = wrapper->_instance->RepetitionMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RepetitionModeSetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        ::Windows::Devices::Lights::Effects::LampArrayRepetitionMode winRtValue = static_cast<::Windows::Devices::Lights::Effects::LampArrayRepetitionMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->RepetitionMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RepetitionDelayGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->RepetitionDelay;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RepetitionDelaySetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->RepetitionDelay = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OccurrencesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        int result = wrapper->_instance->Occurrences;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OccurrencesSetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Occurrences = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DecayDurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->DecayDuration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DecayDurationSetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->DecayDuration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void AttackDurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->AttackDuration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void AttackDurationSetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->AttackDuration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ZIndexGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try  {
        int result = wrapper->_instance->ZIndex;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ZIndexSetter(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::Devices::Lights::Effects::LampArrayBlinkEffect^>(info.This())) {
        return;
      }

      LampArrayBlinkEffect *wrapper = LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ZIndex = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArrayBlinkEffect(::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ UnwrapLampArrayBlinkEffect(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArrayBlinkEffect::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArrayBlinkEffect(::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ 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>(LampArrayBlinkEffect::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArrayBlinkEffect^ UnwrapLampArrayBlinkEffect(Local<Value> value) {
     return LampArrayBlinkEffect::Unwrap<LampArrayBlinkEffect>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArrayBlinkEffect(Local<Object> exports) {
    LampArrayBlinkEffect::Init(exports);
  }

  class LampArrayColorRampEffect : 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>("LampArrayColorRampEffect").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("startDelay").ToLocalChecked(), StartDelayGetter, StartDelaySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("rampDuration").ToLocalChecked(), RampDurationGetter, RampDurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("completionBehavior").ToLocalChecked(), CompletionBehaviorGetter, CompletionBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("zIndex").ToLocalChecked(), ZIndexGetter, ZIndexSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LampArrayColorRampEffect").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArrayColorRampEffect(::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::LampArray^>(info[0])
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<int>^>(info[1]) || info[1]->IsArray()))
      {
        try {
          ::Windows::Devices::Lights::LampArray^ arg0 = dynamic_cast<::Windows::Devices::Lights::LampArray^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Platform::Array<int>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<int>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<int>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> int {
                   return static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<int>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          winRtInstance = ref new ::Windows::Devices::Lights::Effects::LampArrayColorRampEffect(arg0,arg1);
        } 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());

      LampArrayColorRampEffect *wrapperInstance = new LampArrayColorRampEffect(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArrayColorRampEffect(winRtInstance));
    }





    static void StartDelayGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->StartDelay;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StartDelaySetter(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::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->StartDelay = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void RampDurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->RampDuration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RampDurationSetter(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::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->RampDuration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompletionBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try  {
        ::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior result = wrapper->_instance->CompletionBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompletionBehaviorSetter(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::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try {

        ::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior winRtValue = static_cast<::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->CompletionBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ZIndexGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try  {
        int result = wrapper->_instance->ZIndex;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ZIndexSetter(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::Devices::Lights::Effects::LampArrayColorRampEffect^>(info.This())) {
        return;
      }

      LampArrayColorRampEffect *wrapper = LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ZIndex = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArrayColorRampEffect(::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ UnwrapLampArrayColorRampEffect(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArrayColorRampEffect::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArrayColorRampEffect(::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ 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>(LampArrayColorRampEffect::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArrayColorRampEffect^ UnwrapLampArrayColorRampEffect(Local<Value> value) {
     return LampArrayColorRampEffect::Unwrap<LampArrayColorRampEffect>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArrayColorRampEffect(Local<Object> exports) {
    LampArrayColorRampEffect::Init(exports);
  }

  class LampArrayCustomEffect : 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>("LampArrayCustomEffect").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);




          
          Nan::SetPrototypeMethod(localRef,"addListener", AddListener);
          Nan::SetPrototypeMethod(localRef,"on", AddListener);
          Nan::SetPrototypeMethod(localRef,"removeListener", RemoveListener);
          Nan::SetPrototypeMethod(localRef, "off", RemoveListener);

          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("updateInterval").ToLocalChecked(), UpdateIntervalGetter, UpdateIntervalSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("zIndex").ToLocalChecked(), ZIndexGetter, ZIndexSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LampArrayCustomEffect").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArrayCustomEffect(::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayCustomEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::LampArray^>(info[0])
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<int>^>(info[1]) || info[1]->IsArray()))
      {
        try {
          ::Windows::Devices::Lights::LampArray^ arg0 = dynamic_cast<::Windows::Devices::Lights::LampArray^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Platform::Array<int>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<int>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<int>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> int {
                   return static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<int>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          winRtInstance = ref new ::Windows::Devices::Lights::Effects::LampArrayCustomEffect(arg0,arg1);
        } 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());

      LampArrayCustomEffect *wrapperInstance = new LampArrayCustomEffect(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayCustomEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArrayCustomEffect(winRtInstance));
    }





    static void UpdateIntervalGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(info.This())) {
        return;
      }

      LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->UpdateInterval;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void UpdateIntervalSetter(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::Devices::Lights::Effects::LampArrayCustomEffect^>(info.This())) {
        return;
      }

      LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->UpdateInterval = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(info.This())) {
        return;
      }

      LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(info.This())) {
        return;
      }

      LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ZIndexGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(info.This())) {
        return;
      }

      LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(info.This());

      try  {
        int result = wrapper->_instance->ZIndex;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ZIndexSetter(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::Devices::Lights::Effects::LampArrayCustomEffect^>(info.This())) {
        return;
      }

      LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ZIndex = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    static void AddListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected arguments are eventName(string),callback(function)")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      Local<Function> callback = info[1].As<Function>();

      ::Windows::Foundation::EventRegistrationToken registrationToken;
      if (NodeRT::Utils::CaseInsenstiveEquals(L"updateRequested", str))
      {
        if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(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;
        }
        LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(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->UpdateRequested::add(
            ref new ::Windows::Foundation::TypedEventHandler<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^, ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(
            [callbackObjPtr](::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ arg0, ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ arg1) {
              NodeUtils::Async::RunOnMain([callbackObjPtr , arg0, arg1]() {
                HandleScope scope;


                Local<Value> wrappedArg0;
                Local<Value> wrappedArg1;

                {
                  TryCatch tryCatch;


                  wrappedArg0 = WrapLampArrayCustomEffect(arg0);
                  wrappedArg1 = WrapLampArrayUpdateRequestedEventArgs(arg1);


                  if (wrappedArg0.IsEmpty()) wrappedArg0 = Undefined();
                  if (wrappedArg1.IsEmpty()) wrappedArg1 = Undefined();
                }

                Local<Value> args[] = { wrappedArg0, wrappedArg1 };
                Local<Object> callbackObjLocalRef = Nan::New<Object>(*callbackObjPtr);
                NodeRT::Utils::CallCallbackInDomain(callbackObjLocalRef, _countof(args), args);
              });
            })
          );
        }
        catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }

      }
 else  {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Value> tokenMapVal = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());
      Local<Object> tokenMap;

      if (tokenMapVal.IsEmpty() || Nan::Equals(tokenMapVal, Undefined()).FromMaybe(false)) {
        tokenMap = Nan::New<Object>();
        NodeRT::Utils::SetHiddenValueWithObject(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked(), tokenMap);
      } else {
        tokenMap = Nan::To<Object>(tokenMapVal).ToLocalChecked();
      }

      Nan::Set(tokenMap, info[0], CreateOpaqueWrapper(::Windows::Foundation::PropertyValue::CreateInt64(registrationToken.Value)));
    }

    static void RemoveListener(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() < 2 || !info[0]->IsString() || !info[1]->IsFunction()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"wrong arguments, expected a string and a callback")));
        return;
      }

      String::Value eventName(v8::Isolate::GetCurrent(), info[0]);
      auto str = *eventName;

      if ((!NodeRT::Utils::CaseInsenstiveEquals(L"updateRequested", str))) {
        Nan::ThrowError(Nan::Error(String::Concat(v8::Isolate::GetCurrent(), NodeRT::Utils::NewString(L"given event name isn't supported: "), info[0].As<String>())));
        return;
      }

      Local<Function> callback = info[1].As<Function>();
      Local<Value> tokenMap = NodeRT::Utils::GetHiddenValue(callback, Nan::New<String>(REGISTRATION_TOKEN_MAP_PROPERTY_NAME).ToLocalChecked());

      if (tokenMap.IsEmpty() || Nan::Equals(tokenMap, Undefined()).FromMaybe(false)) {
        return;
      }

      Local<Value> opaqueWrapperObj =  Nan::Get(Nan::To<Object>(tokenMap).ToLocalChecked(), info[0]).ToLocalChecked();

      if (opaqueWrapperObj.IsEmpty() || Nan::Equals(opaqueWrapperObj,Undefined()).FromMaybe(false)) {
        return;
      }

      OpaqueWrapper *opaqueWrapper = OpaqueWrapper::Unwrap<OpaqueWrapper>(opaqueWrapperObj.As<Object>());

      long long tokenValue = (long long) opaqueWrapper->GetObjectInstance();
      ::Windows::Foundation::EventRegistrationToken registrationToken;
      registrationToken.Value = tokenValue;

      try  {
        if (NodeRT::Utils::CaseInsenstiveEquals(L"updateRequested", str)) {
          if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayCustomEffect^>(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;
          }
          LampArrayCustomEffect *wrapper = LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(info.This());
          wrapper->_instance->UpdateRequested::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::Devices::Lights::Effects::LampArrayCustomEffect^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArrayCustomEffect(::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ UnwrapLampArrayCustomEffect(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArrayCustomEffect::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArrayCustomEffect(::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ 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>(LampArrayCustomEffect::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArrayCustomEffect^ UnwrapLampArrayCustomEffect(Local<Value> value) {
     return LampArrayCustomEffect::Unwrap<LampArrayCustomEffect>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArrayCustomEffect(Local<Object> exports) {
    LampArrayCustomEffect::Init(exports);
  }

  class LampArrayEffectPlaylist : 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>("LampArrayEffectPlaylist").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "append", Append);
            Nan::SetPrototypeMethod(localRef, "overrideZIndex", OverrideZIndex);
            Nan::SetPrototypeMethod(localRef, "start", Start);
            Nan::SetPrototypeMethod(localRef, "stop", Stop);
            Nan::SetPrototypeMethod(localRef, "pause", Pause);
            Nan::SetPrototypeMethod(localRef, "getAt", GetAt);
            Nan::SetPrototypeMethod(localRef, "indexOf", IndexOf);
            Nan::SetPrototypeMethod(localRef, "getMany", GetMany);
            Nan::SetPrototypeMethod(localRef, "first", First);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("repetitionMode").ToLocalChecked(), RepetitionModeGetter, RepetitionModeSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("occurrences").ToLocalChecked(), OccurrencesGetter, OccurrencesSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("effectStartMode").ToLocalChecked(), EffectStartModeGetter, EffectStartModeSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);

        Nan::SetMethod(constructor, "startAll", StartAll);
        Nan::SetMethod(constructor, "stopAll", StopAll);
        Nan::SetMethod(constructor, "pauseAll", PauseAll);


        Nan::Set(exports, Nan::New<String>("LampArrayEffectPlaylist").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArrayEffectPlaylist(::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 0)
      {
        try {
          winRtInstance = ref new ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist();
        } 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());

      LampArrayEffectPlaylist *wrapperInstance = new LampArrayEffectPlaylist(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArrayEffectPlaylist(winRtInstance));
    }


    static void Append(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::ILampArrayEffect^>(info[0]))
      {
        try
        {
          ::Windows::Devices::Lights::Effects::ILampArrayEffect^ arg0 = UnwrapILampArrayEffect(info[0]);
          
          wrapper->_instance->Append(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void OverrideZIndex(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 1
        && info[0]->IsInt32())
      {
        try
        {
          int arg0 = static_cast<int>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          
          wrapper->_instance->OverrideZIndex(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void Start(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Start();
          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 Stop(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Stop();
          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 Pause(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          wrapper->_instance->Pause();
          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 GetAt(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 1
        && info[0]->IsUint32())
      {
        try
        {
          unsigned int arg0 = static_cast<unsigned int>(Nan::To<uint32_t>(info[0]).FromMaybe(0));
          
          ::Windows::Devices::Lights::Effects::ILampArrayEffect^ result;
          result = wrapper->_instance->GetAt(arg0);
          info.GetReturnValue().Set(WrapILampArrayEffect(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 IndexOf(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::ILampArrayEffect^>(info[0]))
      {
        try
        {
          ::Windows::Devices::Lights::Effects::ILampArrayEffect^ arg0 = UnwrapILampArrayEffect(info[0]);
          unsigned int arg1;
          
          bool result;
          result = wrapper->_instance->IndexOf(arg0, &arg1);
          Local<Object> resObj = Nan::New<Object>();
          Nan::Set(resObj, Nan::New<String>("boolean").ToLocalChecked(), Nan::New<Boolean>(result));
          Nan::Set(resObj, Nan::New<String>("index").ToLocalChecked(), Nan::New<Integer>(arg1));
          info.GetReturnValue().Set(resObj);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void GetMany(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Not implemented")));
    }
    static void First(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      if (info.Length() == 0)
      {
        try
        {
          ::Windows::Foundation::Collections::IIterator<::Windows::Devices::Lights::Effects::ILampArrayEffect^>^ result;
          result = wrapper->_instance->First();
          info.GetReturnValue().Set(NodeRT::Collections::IteratorWrapper<::Windows::Devices::Lights::Effects::ILampArrayEffect^>::CreateIteratorWrapper(result, 
            [](::Windows::Devices::Lights::Effects::ILampArrayEffect^ val) -> Local<Value> {
              return WrapILampArrayEffect(val);
            }
          ));
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void StartAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtVector<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ {
                   return UnwrapLampArrayEffectPlaylist(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist::StartAll(arg0);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void StopAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtVector<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ {
                   return UnwrapLampArrayEffectPlaylist(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist::StopAll(arg0);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void PauseAll(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (info.Length() == 1
        && (NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^>(info[0]) || info[0]->IsArray()))
      {
        try
        {
          ::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtVector<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(value);
                 },
                 [](Local<Value> value) -> ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ {
                   return UnwrapLampArrayEffectPlaylist(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Windows::Foundation::Collections::IIterable<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          
          ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist::PauseAll(arg0);
          return;
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else  {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }

    static void RepetitionModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      try  {
        ::Windows::Devices::Lights::Effects::LampArrayRepetitionMode result = wrapper->_instance->RepetitionMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void RepetitionModeSetter(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::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      try {

        ::Windows::Devices::Lights::Effects::LampArrayRepetitionMode winRtValue = static_cast<::Windows::Devices::Lights::Effects::LampArrayRepetitionMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->RepetitionMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void OccurrencesGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      try  {
        int result = wrapper->_instance->Occurrences;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void OccurrencesSetter(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::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->Occurrences = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void EffectStartModeGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      try  {
        ::Windows::Devices::Lights::Effects::LampArrayEffectStartMode result = wrapper->_instance->EffectStartMode;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void EffectStartModeSetter(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::Devices::Lights::Effects::LampArrayEffectPlaylist^>(info.This())) {
        return;
      }

      LampArrayEffectPlaylist *wrapper = LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(info.This());

      try {

        ::Windows::Devices::Lights::Effects::LampArrayEffectStartMode winRtValue = static_cast<::Windows::Devices::Lights::Effects::LampArrayEffectStartMode>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->EffectStartMode = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArrayEffectPlaylist(::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ UnwrapLampArrayEffectPlaylist(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArrayEffectPlaylist::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArrayEffectPlaylist(::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ 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>(LampArrayEffectPlaylist::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArrayEffectPlaylist^ UnwrapLampArrayEffectPlaylist(Local<Value> value) {
     return LampArrayEffectPlaylist::Unwrap<LampArrayEffectPlaylist>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArrayEffectPlaylist(Local<Object> exports) {
    LampArrayEffectPlaylist::Init(exports);
  }

  class LampArraySolidEffect : 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>("LampArraySolidEffect").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);





          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("zIndex").ToLocalChecked(), ZIndexGetter, ZIndexSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("startDelay").ToLocalChecked(), StartDelayGetter, StartDelaySetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("duration").ToLocalChecked(), DurationGetter, DurationSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("completionBehavior").ToLocalChecked(), CompletionBehaviorGetter, CompletionBehaviorSetter);
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("color").ToLocalChecked(), ColorGetter, ColorSetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LampArraySolidEffect").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArraySolidEffect(::Windows::Devices::Lights::Effects::LampArraySolidEffect^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArraySolidEffect^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArraySolidEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
      else if (info.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::LampArray^>(info[0])
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<int>^>(info[1]) || info[1]->IsArray()))
      {
        try {
          ::Windows::Devices::Lights::LampArray^ arg0 = dynamic_cast<::Windows::Devices::Lights::LampArray^>(NodeRT::Utils::GetObjectInstance(info[0]));
          ::Platform::Array<int>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<int>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<int>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> int {
                   return static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<int>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          winRtInstance = ref new ::Windows::Devices::Lights::Effects::LampArraySolidEffect(arg0,arg1);
        } 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());

      LampArraySolidEffect *wrapperInstance = new LampArraySolidEffect(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArraySolidEffect^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArraySolidEffect^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArraySolidEffect(winRtInstance));
    }





    static void ZIndexGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try  {
        int result = wrapper->_instance->ZIndex;
        info.GetReturnValue().Set(Nan::New<Integer>(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ZIndexSetter(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::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try {

        int winRtValue = static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->ZIndex = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void StartDelayGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->StartDelay;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void StartDelaySetter(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::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->StartDelay = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void DurationGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->Duration;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void DurationSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!value->IsNumber()) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try {

        ::Windows::Foundation::TimeSpan winRtValue = NodeRT::Utils::TimeSpanFromMilli(Nan::To<int64_t>(value).FromMaybe(0));

        wrapper->_instance->Duration = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void CompletionBehaviorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try  {
        ::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior result = wrapper->_instance->CompletionBehavior;
        info.GetReturnValue().Set(Nan::New<Integer>(static_cast<int>(result)));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void CompletionBehaviorSetter(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::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try {

        ::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior winRtValue = static_cast<::Windows::Devices::Lights::Effects::LampArrayEffectCompletionBehavior>(Nan::To<int32_t>(value).FromMaybe(0));

        wrapper->_instance->CompletionBehavior = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      
    static void ColorGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try  {
        ::Windows::UI::Color result = wrapper->_instance->Color;
        info.GetReturnValue().Set(NodeRT::Utils::ColorToJs(result));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      
    static void ColorSetter(Local<String> property, Local<Value> value, const Nan::PropertyCallbackInfo<void> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsColor(value)) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArraySolidEffect^>(info.This())) {
        return;
      }

      LampArraySolidEffect *wrapper = LampArraySolidEffect::Unwrap<LampArraySolidEffect>(info.This());

      try {

        ::Windows::UI::Color winRtValue = NodeRT::Utils::ColorFromJs(value);

        wrapper->_instance->Color = winRtValue;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
      


    private:
      ::Windows::Devices::Lights::Effects::LampArraySolidEffect^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArraySolidEffect(::Windows::Devices::Lights::Effects::LampArraySolidEffect^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArraySolidEffect^ UnwrapLampArraySolidEffect(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArraySolidEffect::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArraySolidEffect(::Windows::Devices::Lights::Effects::LampArraySolidEffect^ 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>(LampArraySolidEffect::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArraySolidEffect^ UnwrapLampArraySolidEffect(Local<Value> value) {
     return LampArraySolidEffect::Unwrap<LampArraySolidEffect>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArraySolidEffect(Local<Object> exports) {
    LampArraySolidEffect::Init(exports);
  }

  class LampArrayUpdateRequestedEventArgs : 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>("LampArrayUpdateRequestedEventArgs").ToLocalChecked());
        localRef->InstanceTemplate()->SetInternalFieldCount(1);


          
            Nan::SetPrototypeMethod(localRef, "setColor", SetColor);
            Nan::SetPrototypeMethod(localRef, "setColorForIndex", SetColorForIndex);
            Nan::SetPrototypeMethod(localRef, "setSingleColorForIndices", SetSingleColorForIndices);
            Nan::SetPrototypeMethod(localRef, "setColorsForIndices", SetColorsForIndices);
          



          
            Nan::SetAccessor(localRef->PrototypeTemplate(), Nan::New<String>("sinceStarted").ToLocalChecked(), SinceStartedGetter);

        Local<Object> constructor = Nan::To<Object>(Nan::GetFunction(localRef).ToLocalChecked()).ToLocalChecked();
        Nan::SetMethod(constructor, "castFrom", CastFrom);



        Nan::Set(exports, Nan::New<String>("LampArrayUpdateRequestedEventArgs").ToLocalChecked(), constructor);
      }

      virtual ::Platform::Object^ GetObjectInstance() const override {
        return _instance;
      }

    private:

      LampArrayUpdateRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ instance) {
        _instance = instance;
      }

      
    static void New(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      Local<FunctionTemplate> localRef = Nan::New<FunctionTemplate>(s_constructorTemplate);

      // in case the constructor was called without the new operator
      if (!localRef->HasInstance(info.This())) {
        if (info.Length() > 0) {
          std::unique_ptr<Local<Value> []> constructorArgs(new Local<Value>[info.Length()]);

          Local<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < info.Length(); i++) {
            argsPtr[i] = info[i];
          }

          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), constructorArgs.get());
          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        } else {
          MaybeLocal<Object> res = Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(), info.Length(), nullptr);

          if (res.IsEmpty()) {
            return;
          }

          info.GetReturnValue().Set(res.ToLocalChecked());
          return;
        }
      }

      ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ winRtInstance;


      if (info.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(info[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(info[0])) {
        try {
          winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^) 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());

      LampArrayUpdateRequestedEventArgs *wrapperInstance = new LampArrayUpdateRequestedEventArgs(winRtInstance);
      wrapperInstance->Wrap(info.This());

      info.GetReturnValue().Set(info.This());
    }


      
    static void CastFrom(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;
      if (info.Length() < 1 || !NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(info[0])) {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Invalid arguments, no object provided, or given object could not be casted to requested type")));
        return;
      }

      ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ winRtInstance;
      try {
        winRtInstance = (::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^) NodeRT::Utils::GetObjectInstance(info[0]);
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }

      info.GetReturnValue().Set(WrapLampArrayUpdateRequestedEventArgs(winRtInstance));
    }


    static void SetColor(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(info.This())) {
        return;
      }

      LampArrayUpdateRequestedEventArgs *wrapper = LampArrayUpdateRequestedEventArgs::Unwrap<LampArrayUpdateRequestedEventArgs>(info.This());

      if (info.Length() == 1
        && NodeRT::Utils::IsColor(info[0]))
      {
        try
        {
          ::Windows::UI::Color arg0 = NodeRT::Utils::ColorFromJs(info[0]);
          
          wrapper->_instance->SetColor(arg0);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetColorForIndex(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(info.This())) {
        return;
      }

      LampArrayUpdateRequestedEventArgs *wrapper = LampArrayUpdateRequestedEventArgs::Unwrap<LampArrayUpdateRequestedEventArgs>(info.This());

      if (info.Length() == 2
        && info[0]->IsInt32()
        && NodeRT::Utils::IsColor(info[1]))
      {
        try
        {
          int arg0 = static_cast<int>(Nan::To<int32_t>(info[0]).FromMaybe(0));
          ::Windows::UI::Color arg1 = NodeRT::Utils::ColorFromJs(info[1]);
          
          wrapper->_instance->SetColorForIndex(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetSingleColorForIndices(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(info.This())) {
        return;
      }

      LampArrayUpdateRequestedEventArgs *wrapper = LampArrayUpdateRequestedEventArgs::Unwrap<LampArrayUpdateRequestedEventArgs>(info.This());

      if (info.Length() == 2
        && NodeRT::Utils::IsColor(info[0])
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<int>^>(info[1]) || info[1]->IsArray()))
      {
        try
        {
          ::Windows::UI::Color arg0 = NodeRT::Utils::ColorFromJs(info[0]);
          ::Platform::Array<int>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<int>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<int>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> int {
                   return static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<int>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          wrapper->_instance->SetSingleColorForIndices(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }
    static void SetColorsForIndices(Nan::NAN_METHOD_ARGS_TYPE info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(info.This())) {
        return;
      }

      LampArrayUpdateRequestedEventArgs *wrapper = LampArrayUpdateRequestedEventArgs::Unwrap<LampArrayUpdateRequestedEventArgs>(info.This());

      if (info.Length() == 2
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<::Windows::UI::Color>^>(info[0]) || info[0]->IsArray())
        && (NodeRT::Utils::IsWinRtWrapperOf<::Platform::Array<int>^>(info[1]) || info[1]->IsArray()))
      {
        try
        {
          ::Platform::Array<::Windows::UI::Color>^ arg0 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<::Windows::UI::Color>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<::Windows::UI::Color>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return NodeRT::Utils::IsColor(value);
                 },
                 [](Local<Value> value) -> ::Windows::UI::Color {
                   return NodeRT::Utils::ColorFromJs(value);
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<::Windows::UI::Color>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[0]);
          ::Platform::Array<int>^ arg1 = 
            [] (v8::Local<v8::Value> value) -> ::Platform::Array<int>^
            {
              if (value->IsArray())
              {
                return NodeRT::Collections::JsArrayToWinrtArray<int>(value.As<Array>(), 
                 [](Local<Value> value) -> bool {
                   return value->IsInt32();
                 },
                 [](Local<Value> value) -> int {
                   return static_cast<int>(Nan::To<int32_t>(value).FromMaybe(0));
                 }
                );
              }
              else
              {
                return dynamic_cast<::Platform::Array<int>^>(NodeRT::Utils::GetObjectInstance(value));
              }
            } (info[1]);
          
          wrapper->_instance->SetColorsForIndices(arg0, arg1);
          return;
        } catch (Platform::Exception ^exception) {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return;
        }
      }
 else {
        Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return;
      }
    }



    static void SinceStartedGetter(Local<String> property, const Nan::PropertyCallbackInfo<v8::Value> &info) {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^>(info.This())) {
        return;
      }

      LampArrayUpdateRequestedEventArgs *wrapper = LampArrayUpdateRequestedEventArgs::Unwrap<LampArrayUpdateRequestedEventArgs>(info.This());

      try  {
        ::Windows::Foundation::TimeSpan result = wrapper->_instance->SinceStarted;
        info.GetReturnValue().Set(Nan::New<Number>(result.Duration/10000.0));
        return;
      } catch (Platform::Exception ^exception) {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return;
      }
    }
      


    private:
      ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ _instance;
      static Persistent<FunctionTemplate> s_constructorTemplate;

      friend v8::Local<v8::Value> WrapLampArrayUpdateRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ wintRtInstance);
      friend ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ UnwrapLampArrayUpdateRequestedEventArgs(Local<Value> value);
  };

  Persistent<FunctionTemplate> LampArrayUpdateRequestedEventArgs::s_constructorTemplate;

  v8::Local<v8::Value> WrapLampArrayUpdateRequestedEventArgs(::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ 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>(LampArrayUpdateRequestedEventArgs::s_constructorTemplate);
    return scope.Escape(Nan::NewInstance(Nan::GetFunction(localRef).ToLocalChecked(),_countof(args), args).ToLocalChecked());
  }

  ::Windows::Devices::Lights::Effects::LampArrayUpdateRequestedEventArgs^ UnwrapLampArrayUpdateRequestedEventArgs(Local<Value> value) {
     return LampArrayUpdateRequestedEventArgs::Unwrap<LampArrayUpdateRequestedEventArgs>(Nan::To<Object>(value).ToLocalChecked())->_instance;
  }

  void InitLampArrayUpdateRequestedEventArgs(Local<Object> exports) {
    LampArrayUpdateRequestedEventArgs::Init(exports);
  }


} } } } } 

NAN_MODULE_INIT(init) {
  // We ignore failures for now since it probably means that
  // the initialization already happened for STA, and that's cool

  CoInitializeEx(nullptr, COINIT_MULTITHREADED);

  /*
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) {
    Nan::ThrowError(Nan::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  */

      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayEffectCompletionBehaviorEnum(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayEffectStartModeEnum(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayRepetitionModeEnum(target);
      NodeRT::Windows::Devices::Lights::Effects::InitILampArrayEffect(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayBitmapEffect(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayBitmapRequestedEventArgs(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayBlinkEffect(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayColorRampEffect(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayCustomEffect(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayEffectPlaylist(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArraySolidEffect(target);
      NodeRT::Windows::Devices::Lights::Effects::InitLampArrayUpdateRequestedEventArgs(target);


  NodeRT::Utils::RegisterNameSpace("Windows.Devices.Lights.Effects", target);
}



NODE_MODULE(binding, init)
