// Copyright (c) Microsoft Corporation
// All rights reserved. 
//
// Licensed under the Apache License, Version 2.0 (the ""License""); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 
//
// THIS CODE IS PROVIDED ON AN  *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. 
//
// See the Apache Version 2.0 License for specific language governing permissions and limitations under the License.

#define NTDDI_VERSION 0x06010000

#include <v8.h>
#include <string>
#include <node_object_wrap.h>
#include <ppltasks.h>
#include "CollectionsConverter.h"
#include "CollectionsWrap.h"
#include "node-async.h"
#include "NodeRtUtils.h"
#include "OpaqueWrapper.h"
#include "WrapperBase.h"

#using <Windows.WinMD>

// this undefs fixes the issues of compiling Windows.Data.Json, Windows.Storag.FileProperties, and Windows.Stroage.Search
// Some of the node header files brings windows definitions with the same names as some of the WinRT methods
#undef DocumentProperties
#undef GetObject
#undef CreateEvent
#undef FindText
#undef SendMessage

const char* REGISTRATION_TOKEN_MAP_PROPERTY_NAME = "__registrationTokenMap__";

using namespace v8;
using namespace node;
using namespace concurrency;

namespace NodeRT { namespace Windows { namespace Web { namespace Syndication { 
  v8::Handle<v8::Value> WrapSyndicationAttribute(::Windows::Web::Syndication::SyndicationAttribute^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationAttribute^ UnwrapSyndicationAttribute(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapISyndicationNode(::Windows::Web::Syndication::ISyndicationNode^ wintRtInstance);
  ::Windows::Web::Syndication::ISyndicationNode^ UnwrapISyndicationNode(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationNode(::Windows::Web::Syndication::SyndicationNode^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationNode^ UnwrapSyndicationNode(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationGenerator(::Windows::Web::Syndication::SyndicationGenerator^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationGenerator^ UnwrapSyndicationGenerator(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapISyndicationText(::Windows::Web::Syndication::ISyndicationText^ wintRtInstance);
  ::Windows::Web::Syndication::ISyndicationText^ UnwrapISyndicationText(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationText(::Windows::Web::Syndication::SyndicationText^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationText^ UnwrapSyndicationText(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationContent(::Windows::Web::Syndication::SyndicationContent^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationContent^ UnwrapSyndicationContent(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationLink(::Windows::Web::Syndication::SyndicationLink^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationLink^ UnwrapSyndicationLink(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationPerson(::Windows::Web::Syndication::SyndicationPerson^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationPerson^ UnwrapSyndicationPerson(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationCategory(::Windows::Web::Syndication::SyndicationCategory^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationCategory^ UnwrapSyndicationCategory(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationFeed(::Windows::Web::Syndication::SyndicationFeed^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationFeed^ UnwrapSyndicationFeed(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationItem(::Windows::Web::Syndication::SyndicationItem^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationItem^ UnwrapSyndicationItem(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapISyndicationClient(::Windows::Web::Syndication::ISyndicationClient^ wintRtInstance);
  ::Windows::Web::Syndication::ISyndicationClient^ UnwrapISyndicationClient(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationClient(::Windows::Web::Syndication::SyndicationClient^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationClient^ UnwrapSyndicationClient(Handle<Value> value);
  
  v8::Handle<v8::Value> WrapSyndicationError(::Windows::Web::Syndication::SyndicationError^ wintRtInstance);
  ::Windows::Web::Syndication::SyndicationError^ UnwrapSyndicationError(Handle<Value> value);
  


  static v8::Handle<v8::Value> InitSyndicationFormatEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("SyndicationFormat"), enumObject);

    enumObject->Set(String::NewSymbol("atom10"), Integer::New(0));
    enumObject->Set(String::NewSymbol("rss20"), Integer::New(1));
    enumObject->Set(String::NewSymbol("rss10"), Integer::New(2));
    enumObject->Set(String::NewSymbol("rss092"), Integer::New(3));
    enumObject->Set(String::NewSymbol("rss091"), Integer::New(4));
    enumObject->Set(String::NewSymbol("atom03"), Integer::New(5));

    return scope.Close(Undefined());
  }


  static v8::Handle<v8::Value> InitSyndicationErrorStatusEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("SyndicationErrorStatus"), enumObject);

    enumObject->Set(String::NewSymbol("unknown"), Integer::New(0));
    enumObject->Set(String::NewSymbol("missingRequiredElement"), Integer::New(1));
    enumObject->Set(String::NewSymbol("missingRequiredAttribute"), Integer::New(2));
    enumObject->Set(String::NewSymbol("invalidXml"), Integer::New(3));
    enumObject->Set(String::NewSymbol("unexpectedContent"), Integer::New(4));
    enumObject->Set(String::NewSymbol("unsupportedFormat"), Integer::New(5));

    return scope.Close(Undefined());
  }


  static v8::Handle<v8::Value> InitSyndicationTextTypeEnum(const Handle<Object> exports)
  {
    HandleScope scope;
    
    Handle<Object> enumObject = Object::New();
    exports->Set(String::NewSymbol("SyndicationTextType"), enumObject);

    enumObject->Set(String::NewSymbol("text"), Integer::New(0));
    enumObject->Set(String::NewSymbol("html"), Integer::New(1));
    enumObject->Set(String::NewSymbol("xhtml"), Integer::New(2));

    return scope.Close(Undefined());
  }



  
  static bool IsRetrievalProgressJsObject(Handle<Value> value)
  {
    if (!value->IsObject())
    {
      return false;
    }

    Handle<String> symbol;
    Handle<Object> obj = value.As<Object>();

    symbol = String::NewSymbol("bytesRetrieved");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsUint32())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("totalBytesToRetrieve");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsUint32())
      {
          return false;
      }
    }
    
    return true;
  }

  ::Windows::Web::Syndication::RetrievalProgress RetrievalProgressFromJsObject(Handle<Value> value)
  {
    HandleScope scope;
    ::Windows::Web::Syndication::RetrievalProgress returnValue;
    
    if (!value->IsObject())
    {
      ThrowException(Exception::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Handle<Object> obj = value.As<Object>();
    Handle<String> symbol;

    symbol = String::NewSymbol("bytesRetrieved");
    if (obj->Has(symbol))
    {
      returnValue.BytesRetrieved = static_cast<unsigned int>(obj->Get(symbol)->IntegerValue());
    }
    
    symbol = String::NewSymbol("totalBytesToRetrieve");
    if (obj->Has(symbol))
    {
      returnValue.TotalBytesToRetrieve = static_cast<unsigned int>(obj->Get(symbol)->IntegerValue());
    }
    
    return returnValue;
  }

  Handle<Value> RetrievalProgressToJsObject(::Windows::Web::Syndication::RetrievalProgress value)
  {
    HandleScope scope;

    Handle<Object> obj = Object::New();

    obj->Set(String::NewSymbol("bytesRetrieved"), Integer::New(value.BytesRetrieved));
    obj->Set(String::NewSymbol("totalBytesToRetrieve"), Integer::New(value.TotalBytesToRetrieve));
    
    return scope.Close(obj);
  }

  
  static bool IsTransferProgressJsObject(Handle<Value> value)
  {
    if (!value->IsObject())
    {
      return false;
    }

    Handle<String> symbol;
    Handle<Object> obj = value.As<Object>();

    symbol = String::NewSymbol("bytesSent");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsUint32())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("totalBytesToSend");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsUint32())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("bytesRetrieved");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsUint32())
      {
          return false;
      }
    }
    
    symbol = String::NewSymbol("totalBytesToRetrieve");
    if (obj->Has(symbol))
    {
      if (!obj->Get(symbol)->IsUint32())
      {
          return false;
      }
    }
    
    return true;
  }

  ::Windows::Web::Syndication::TransferProgress TransferProgressFromJsObject(Handle<Value> value)
  {
    HandleScope scope;
    ::Windows::Web::Syndication::TransferProgress returnValue;
    
    if (!value->IsObject())
    {
      ThrowException(Exception::TypeError(NodeRT::Utils::NewString(L"Unexpected type, expected an object")));
      return returnValue;
    }

    Handle<Object> obj = value.As<Object>();
    Handle<String> symbol;

    symbol = String::NewSymbol("bytesSent");
    if (obj->Has(symbol))
    {
      returnValue.BytesSent = static_cast<unsigned int>(obj->Get(symbol)->IntegerValue());
    }
    
    symbol = String::NewSymbol("totalBytesToSend");
    if (obj->Has(symbol))
    {
      returnValue.TotalBytesToSend = static_cast<unsigned int>(obj->Get(symbol)->IntegerValue());
    }
    
    symbol = String::NewSymbol("bytesRetrieved");
    if (obj->Has(symbol))
    {
      returnValue.BytesRetrieved = static_cast<unsigned int>(obj->Get(symbol)->IntegerValue());
    }
    
    symbol = String::NewSymbol("totalBytesToRetrieve");
    if (obj->Has(symbol))
    {
      returnValue.TotalBytesToRetrieve = static_cast<unsigned int>(obj->Get(symbol)->IntegerValue());
    }
    
    return returnValue;
  }

  Handle<Value> TransferProgressToJsObject(::Windows::Web::Syndication::TransferProgress value)
  {
    HandleScope scope;

    Handle<Object> obj = Object::New();

    obj->Set(String::NewSymbol("bytesSent"), Integer::New(value.BytesSent));
    obj->Set(String::NewSymbol("totalBytesToSend"), Integer::New(value.TotalBytesToSend));
    obj->Set(String::NewSymbol("bytesRetrieved"), Integer::New(value.BytesRetrieved));
    obj->Set(String::NewSymbol("totalBytesToRetrieve"), Integer::New(value.TotalBytesToRetrieve));
    
    return scope.Close(obj);
  }

  
  class SyndicationAttribute : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationAttribute"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("value"), ValueGetter, ValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("namespace"), NamespaceGetter, NamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("name"), NameGetter, NameSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationAttribute"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationAttribute(::Windows::Web::Syndication::SyndicationAttribute^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationAttribute^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationAttribute^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 3
        && args[0]->IsString()
        && args[1]->IsString()
        && args[2]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          Platform::String^ arg2 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[2])));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationAttribute(arg0,arg1,arg2);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationAttribute();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationAttribute *wrapperInstance = new SyndicationAttribute(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> ValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationAttribute *wrapper = SyndicationAttribute::Unwrap<SyndicationAttribute>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Value;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(info.This()))
      {
        return;
      }

      SyndicationAttribute *wrapper = SyndicationAttribute::Unwrap<SyndicationAttribute>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Value = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationAttribute *wrapper = SyndicationAttribute::Unwrap<SyndicationAttribute>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Namespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(info.This()))
      {
        return;
      }

      SyndicationAttribute *wrapper = SyndicationAttribute::Unwrap<SyndicationAttribute>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Namespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationAttribute *wrapper = SyndicationAttribute::Unwrap<SyndicationAttribute>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Name;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(info.This()))
      {
        return;
      }

      SyndicationAttribute *wrapper = SyndicationAttribute::Unwrap<SyndicationAttribute>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Name = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationAttribute^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationAttribute(::Windows::Web::Syndication::SyndicationAttribute^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationAttribute^ UnwrapSyndicationAttribute(Handle<Value> value);
    friend bool IsSyndicationAttributeWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationAttribute::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationAttribute(::Windows::Web::Syndication::SyndicationAttribute^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationAttribute::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationAttribute^ UnwrapSyndicationAttribute(Handle<Value> value)
  {
     return SyndicationAttribute::Unwrap<SyndicationAttribute>(value.As<Object>())->_instance;
  }

  void InitSyndicationAttribute(Handle<Object> exports)
  {
    SyndicationAttribute::Init(exports);
  }

  class ISyndicationNode : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("ISyndicationNode"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("ISyndicationNode"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ISyndicationNode(::Windows::Web::Syndication::ISyndicationNode^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::ISyndicationNode^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::ISyndicationNode^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      ISyndicationNode *wrapperInstance = new ISyndicationNode(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return;
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return;
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return;
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return;
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(info.This()))
      {
        return;
      }

      ISyndicationNode *wrapper = ISyndicationNode::Unwrap<ISyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::Web::Syndication::ISyndicationNode^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapISyndicationNode(::Windows::Web::Syndication::ISyndicationNode^ wintRtInstance);
    friend ::Windows::Web::Syndication::ISyndicationNode^ UnwrapISyndicationNode(Handle<Value> value);
    friend bool IsISyndicationNodeWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> ISyndicationNode::s_constructorTemplate;

  v8::Handle<v8::Value> WrapISyndicationNode(::Windows::Web::Syndication::ISyndicationNode^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(ISyndicationNode::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::ISyndicationNode^ UnwrapISyndicationNode(Handle<Value> value)
  {
     return ISyndicationNode::Unwrap<ISyndicationNode>(value.As<Object>())->_instance;
  }

  void InitISyndicationNode(Handle<Object> exports)
  {
    ISyndicationNode::Init(exports);
  }

  class SyndicationNode : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationNode"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationNode"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationNode(::Windows::Web::Syndication::SyndicationNode^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationNode^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationNode^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 3
        && args[0]->IsString()
        && args[1]->IsString()
        && args[2]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          Platform::String^ arg2 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[2])));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationNode(arg0,arg1,arg2);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationNode();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationNode *wrapperInstance = new SyndicationNode(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return;
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return;
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return;
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return;
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return;
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationNode^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationNode *wrapper = SyndicationNode::Unwrap<SyndicationNode>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationNode^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationNode(::Windows::Web::Syndication::SyndicationNode^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationNode^ UnwrapSyndicationNode(Handle<Value> value);
    friend bool IsSyndicationNodeWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationNode::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationNode(::Windows::Web::Syndication::SyndicationNode^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationNode::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationNode^ UnwrapSyndicationNode(Handle<Value> value)
  {
     return SyndicationNode::Unwrap<SyndicationNode>(value.As<Object>())->_instance;
  }

  void InitSyndicationNode(Handle<Object> exports)
  {
    SyndicationNode::Init(exports);
  }

  class SyndicationGenerator : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationGenerator"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("version"), VersionGetter, VersionSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("uri"), UriGetter, UriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("text"), TextGetter, TextSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationGenerator"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationGenerator(::Windows::Web::Syndication::SyndicationGenerator^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationGenerator^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationGenerator^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 1
        && args[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationGenerator(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationGenerator();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationGenerator *wrapperInstance = new SyndicationGenerator(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> VersionGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Version;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void VersionSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Version = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> UriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->Uri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void UriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Uri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TextGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Text;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TextSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Text = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return;
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationGenerator *wrapper = SyndicationGenerator::Unwrap<SyndicationGenerator>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationGenerator^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationGenerator(::Windows::Web::Syndication::SyndicationGenerator^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationGenerator^ UnwrapSyndicationGenerator(Handle<Value> value);
    friend bool IsSyndicationGeneratorWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationGenerator::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationGenerator(::Windows::Web::Syndication::SyndicationGenerator^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationGenerator::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationGenerator^ UnwrapSyndicationGenerator(Handle<Value> value)
  {
     return SyndicationGenerator::Unwrap<SyndicationGenerator>(value.As<Object>())->_instance;
  }

  void InitSyndicationGenerator(Handle<Object> exports)
  {
    SyndicationGenerator::Init(exports);
  }

  class ISyndicationText : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("ISyndicationText"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("text"), TextGetter, TextSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("type"), TypeGetter, TypeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("xml"), XmlGetter, XmlSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("ISyndicationText"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ISyndicationText(::Windows::Web::Syndication::ISyndicationText^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::ISyndicationText^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::ISyndicationText^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      ISyndicationText *wrapperInstance = new ISyndicationText(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  



    static Handle<Value> TextGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationText *wrapper = ISyndicationText::Unwrap<ISyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Text;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TextSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(info.This()))
      {
        return;
      }

      ISyndicationText *wrapper = ISyndicationText::Unwrap<ISyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Text = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationText *wrapper = ISyndicationText::Unwrap<ISyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Type;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TypeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(info.This()))
      {
        return;
      }

      ISyndicationText *wrapper = ISyndicationText::Unwrap<ISyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Type = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> XmlGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationText *wrapper = ISyndicationText::Unwrap<ISyndicationText>(info.This());

      try 
      {
        ::Windows::Data::Xml::Dom::XmlDocument^ result = wrapper->_instance->Xml;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void XmlSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Data::Xml::Dom::XmlDocument^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(info.This()))
      {
        return;
      }

      ISyndicationText *wrapper = ISyndicationText::Unwrap<ISyndicationText>(info.This());

      try 
      {
        
        ::Windows::Data::Xml::Dom::XmlDocument^ winRtValue = dynamic_cast<::Windows::Data::Xml::Dom::XmlDocument^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Xml = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::Web::Syndication::ISyndicationText^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapISyndicationText(::Windows::Web::Syndication::ISyndicationText^ wintRtInstance);
    friend ::Windows::Web::Syndication::ISyndicationText^ UnwrapISyndicationText(Handle<Value> value);
    friend bool IsISyndicationTextWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> ISyndicationText::s_constructorTemplate;

  v8::Handle<v8::Value> WrapISyndicationText(::Windows::Web::Syndication::ISyndicationText^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(ISyndicationText::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::ISyndicationText^ UnwrapISyndicationText(Handle<Value> value)
  {
     return ISyndicationText::Unwrap<ISyndicationText>(value.As<Object>())->_instance;
  }

  void InitISyndicationText(Handle<Object> exports)
  {
    ISyndicationText::Init(exports);
  }

  class SyndicationText : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationText"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("xml"), XmlGetter, XmlSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("type"), TypeGetter, TypeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("text"), TextGetter, TextSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationText"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationText(::Windows::Web::Syndication::SyndicationText^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationText^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationText^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 1
        && args[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationText(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 2
        && args[0]->IsString()
        && args[1]->IsInt32())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          ::Windows::Web::Syndication::SyndicationTextType arg1 = static_cast<::Windows::Web::Syndication::SyndicationTextType>(args[1]->Int32Value());
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationText(arg0,arg1);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationText();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationText *wrapperInstance = new SyndicationText(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> XmlGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        ::Windows::Data::Xml::Dom::XmlDocument^ result = wrapper->_instance->Xml;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void XmlSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Data::Xml::Dom::XmlDocument^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        ::Windows::Data::Xml::Dom::XmlDocument^ winRtValue = dynamic_cast<::Windows::Data::Xml::Dom::XmlDocument^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Xml = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Type;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TypeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Type = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TextGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Text;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TextSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Text = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return;
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationText^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationText *wrapper = SyndicationText::Unwrap<SyndicationText>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationText^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationText(::Windows::Web::Syndication::SyndicationText^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationText^ UnwrapSyndicationText(Handle<Value> value);
    friend bool IsSyndicationTextWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationText::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationText(::Windows::Web::Syndication::SyndicationText^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationText::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationText^ UnwrapSyndicationText(Handle<Value> value)
  {
     return SyndicationText::Unwrap<SyndicationText>(value.As<Object>())->_instance;
  }

  void InitSyndicationText(Handle<Object> exports)
  {
    SyndicationText::Init(exports);
  }

  class SyndicationContent : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationContent"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("xml"), XmlGetter, XmlSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("type"), TypeGetter, TypeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("text"), TextGetter, TextSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("sourceUri"), SourceUriGetter, SourceUriSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationContent"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationContent(::Windows::Web::Syndication::SyndicationContent^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationContent^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationContent^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 2
        && args[0]->IsString()
        && args[1]->IsInt32())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          ::Windows::Web::Syndication::SyndicationTextType arg1 = static_cast<::Windows::Web::Syndication::SyndicationTextType>(args[1]->Int32Value());
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationContent(arg0,arg1);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[0]))
      {
        try
        {
          ::Windows::Foundation::Uri^ arg0 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[0]));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationContent(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationContent();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationContent *wrapperInstance = new SyndicationContent(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> XmlGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        ::Windows::Data::Xml::Dom::XmlDocument^ result = wrapper->_instance->Xml;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void XmlSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Data::Xml::Dom::XmlDocument^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        ::Windows::Data::Xml::Dom::XmlDocument^ winRtValue = dynamic_cast<::Windows::Data::Xml::Dom::XmlDocument^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Xml = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Type;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TypeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Type = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TextGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Text;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TextSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Text = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> SourceUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->SourceUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void SourceUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(info.This()))
      {
        return;
      }

      SyndicationContent *wrapper = SyndicationContent::Unwrap<SyndicationContent>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->SourceUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationContent^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationContent(::Windows::Web::Syndication::SyndicationContent^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationContent^ UnwrapSyndicationContent(Handle<Value> value);
    friend bool IsSyndicationContentWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationContent::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationContent(::Windows::Web::Syndication::SyndicationContent^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationContent::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationContent^ UnwrapSyndicationContent(Handle<Value> value)
  {
     return SyndicationContent::Unwrap<SyndicationContent>(value.As<Object>())->_instance;
  }

  void InitSyndicationContent(Handle<Object> exports)
  {
    SyndicationContent::Init(exports);
  }

  class SyndicationLink : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationLink"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("uri"), UriGetter, UriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("title"), TitleGetter, TitleSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("resourceLanguage"), ResourceLanguageGetter, ResourceLanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("relationship"), RelationshipGetter, RelationshipSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("mediaType"), MediaTypeGetter, MediaTypeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("length"), LengthGetter, LengthSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationLink"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationLink(::Windows::Web::Syndication::SyndicationLink^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationLink^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationLink^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[0]))
      {
        try
        {
          ::Windows::Foundation::Uri^ arg0 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[0]));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationLink(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 5
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[0])
        && args[1]->IsString()
        && args[2]->IsString()
        && args[3]->IsString()
        && args[4]->IsUint32())
      {
        try
        {
          ::Windows::Foundation::Uri^ arg0 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[0]));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          Platform::String^ arg2 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[2])));
          Platform::String^ arg3 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[3])));
          unsigned int arg4 = static_cast<unsigned int>(args[4]->IntegerValue());
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationLink(arg0,arg1,arg2,arg3,arg4);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationLink();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationLink *wrapperInstance = new SyndicationLink(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> UriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->Uri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void UriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Uri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TitleGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Title;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TitleSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Title = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ResourceLanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ResourceLanguage;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ResourceLanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->ResourceLanguage = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> RelationshipGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Relationship;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void RelationshipSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Relationship = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> MediaTypeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->MediaType;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void MediaTypeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->MediaType = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LengthGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->Length;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LengthSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsUint32())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        unsigned int winRtValue = static_cast<unsigned int>(value->IntegerValue());

        wrapper->_instance->Length = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return;
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationLink *wrapper = SyndicationLink::Unwrap<SyndicationLink>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationLink^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationLink(::Windows::Web::Syndication::SyndicationLink^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationLink^ UnwrapSyndicationLink(Handle<Value> value);
    friend bool IsSyndicationLinkWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationLink::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationLink(::Windows::Web::Syndication::SyndicationLink^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationLink::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationLink^ UnwrapSyndicationLink(Handle<Value> value)
  {
     return SyndicationLink::Unwrap<SyndicationLink>(value.As<Object>())->_instance;
  }

  void InitSyndicationLink(Handle<Object> exports)
  {
    SyndicationLink::Init(exports);
  }

  class SyndicationPerson : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationPerson"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("uri"), UriGetter, UriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("name"), NameGetter, NameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("email"), EmailGetter, EmailSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationPerson"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationPerson(::Windows::Web::Syndication::SyndicationPerson^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationPerson^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationPerson^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 1
        && args[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationPerson(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 3
        && args[0]->IsString()
        && args[1]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[2]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          ::Windows::Foundation::Uri^ arg2 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[2]));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationPerson(arg0,arg1,arg2);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationPerson();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationPerson *wrapperInstance = new SyndicationPerson(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> UriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->Uri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void UriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Uri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Name;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Name = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> EmailGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Email;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void EmailSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Email = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return;
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationPerson *wrapper = SyndicationPerson::Unwrap<SyndicationPerson>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationPerson^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationPerson(::Windows::Web::Syndication::SyndicationPerson^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationPerson^ UnwrapSyndicationPerson(Handle<Value> value);
    friend bool IsSyndicationPersonWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationPerson::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationPerson(::Windows::Web::Syndication::SyndicationPerson^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationPerson::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationPerson^ UnwrapSyndicationPerson(Handle<Value> value)
  {
     return SyndicationPerson::Unwrap<SyndicationPerson>(value.As<Object>())->_instance;
  }

  void InitSyndicationPerson(Handle<Object> exports)
  {
    SyndicationPerson::Init(exports);
  }

  class SyndicationCategory : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationCategory"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("term"), TermGetter, TermSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("scheme"), SchemeGetter, SchemeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("label"), LabelGetter, LabelSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationCategory"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationCategory(::Windows::Web::Syndication::SyndicationCategory^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationCategory^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationCategory^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 1
        && args[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationCategory(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 3
        && args[0]->IsString()
        && args[1]->IsString()
        && args[2]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          Platform::String^ arg2 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[2])));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationCategory(arg0,arg1,arg2);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationCategory();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationCategory *wrapperInstance = new SyndicationCategory(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> TermGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Term;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TermSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Term = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> SchemeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Scheme;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void SchemeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Scheme = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LabelGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Label;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LabelSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Label = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return;
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationCategory *wrapper = SyndicationCategory::Unwrap<SyndicationCategory>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationCategory^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationCategory(::Windows::Web::Syndication::SyndicationCategory^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationCategory^ UnwrapSyndicationCategory(Handle<Value> value);
    friend bool IsSyndicationCategoryWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationCategory::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationCategory(::Windows::Web::Syndication::SyndicationCategory^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationCategory::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationCategory^ UnwrapSyndicationCategory(Handle<Value> value)
  {
     return SyndicationCategory::Unwrap<SyndicationCategory>(value.As<Object>())->_instance;
  }

  void InitSyndicationCategory(Handle<Object> exports)
  {
    SyndicationCategory::Init(exports);
  }

  class SyndicationFeed : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationFeed"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("load"), FunctionTemplate::New(Load)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("loadFromXml"), FunctionTemplate::New(LoadFromXml)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("title"), TitleGetter, TitleSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("subtitle"), SubtitleGetter, SubtitleSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("rights"), RightsGetter, RightsSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("generator"), GeneratorGetter, GeneratorSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("imageUri"), ImageUriGetter, ImageUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("id"), IdGetter, IdSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("lastUpdatedTime"), LastUpdatedTimeGetter, LastUpdatedTimeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("iconUri"), IconUriGetter, IconUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("firstUri"), FirstUriGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("items"), ItemsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("lastUri"), LastUriGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("links"), LinksGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nextUri"), NextUriGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("previousUri"), PreviousUriGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("authors"), AuthorsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("sourceFormat"), SourceFormatGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("categories"), CategoriesGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("contributors"), ContributorsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationFeed"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationFeed(::Windows::Web::Syndication::SyndicationFeed^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationFeed^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationFeed^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 3
        && args[0]->IsString()
        && args[1]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[2]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          ::Windows::Foundation::Uri^ arg2 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[2]));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationFeed(arg0,arg1,arg2);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationFeed();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationFeed *wrapperInstance = new SyndicationFeed(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> Load(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(args.This());

      if (args.Length() == 1
        && args[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          
          wrapper->_instance->Load(arg0);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> LoadFromXml(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(args.This());

      if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Data::Xml::Dom::XmlDocument^>(args[0]))
      {
        try
        {
          ::Windows::Data::Xml::Dom::XmlDocument^ arg0 = dynamic_cast<::Windows::Data::Xml::Dom::XmlDocument^>(NodeRT::Utils::GetObjectInstance(args[0]));
          
          wrapper->_instance->LoadFromXml(arg0);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> TitleGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Web::Syndication::ISyndicationText^ result = wrapper->_instance->Title;
        return scope.Close(WrapISyndicationText(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TitleSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::ISyndicationText^ winRtValue = dynamic_cast<::Windows::Web::Syndication::ISyndicationText^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Title = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> SubtitleGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Web::Syndication::ISyndicationText^ result = wrapper->_instance->Subtitle;
        return scope.Close(WrapISyndicationText(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void SubtitleSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::ISyndicationText^ winRtValue = dynamic_cast<::Windows::Web::Syndication::ISyndicationText^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Subtitle = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> RightsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Web::Syndication::ISyndicationText^ result = wrapper->_instance->Rights;
        return scope.Close(WrapISyndicationText(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void RightsSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::ISyndicationText^ winRtValue = dynamic_cast<::Windows::Web::Syndication::ISyndicationText^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Rights = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> GeneratorGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Web::Syndication::SyndicationGenerator^ result = wrapper->_instance->Generator;
        return scope.Close(WrapSyndicationGenerator(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void GeneratorSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationGenerator^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::SyndicationGenerator^ winRtValue = dynamic_cast<::Windows::Web::Syndication::SyndicationGenerator^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Generator = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ImageUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->ImageUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ImageUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ImageUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> IdGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Id;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void IdSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Id = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LastUpdatedTimeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::DateTime result = wrapper->_instance->LastUpdatedTime;
        return scope.Close(NodeRT::Utils::DateTimeToJS(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LastUpdatedTimeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsDate())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Foundation::DateTime winRtValue = NodeRT::Utils::DateTimeFromJSDate(value);

        wrapper->_instance->LastUpdatedTime = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> IconUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->IconUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void IconUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->IconUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> FirstUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->FirstUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ItemsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationItem^>^ result = wrapper->_instance->Items;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationItem^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationItem^ val) -> Handle<Value> {
              return WrapSyndicationItem(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationItem^ {
              return UnwrapSyndicationItem(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> LastUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->LastUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> LinksGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationLink^>^ result = wrapper->_instance->Links;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationLink^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationLink^ val) -> Handle<Value> {
              return WrapSyndicationLink(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationLink^ {
              return UnwrapSyndicationLink(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> NextUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->NextUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> PreviousUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->PreviousUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> AuthorsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationPerson^>^ result = wrapper->_instance->Authors;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationPerson^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationPerson^ val) -> Handle<Value> {
              return WrapSyndicationPerson(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationPerson^ {
              return UnwrapSyndicationPerson(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> SourceFormatGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Web::Syndication::SyndicationFormat result = wrapper->_instance->SourceFormat;
        return scope.Close(Integer::New(static_cast<int>(result)));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> CategoriesGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationCategory^>^ result = wrapper->_instance->Categories;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationCategory^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationCategory^ val) -> Handle<Value> {
              return WrapSyndicationCategory(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationCategory^ {
              return UnwrapSyndicationCategory(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ContributorsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationPerson^>^ result = wrapper->_instance->Contributors;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationPerson^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationPerson^ val) -> Handle<Value> {
              return WrapSyndicationPerson(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationPerson^ {
              return UnwrapSyndicationPerson(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return;
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationFeed *wrapper = SyndicationFeed::Unwrap<SyndicationFeed>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationFeed^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationFeed(::Windows::Web::Syndication::SyndicationFeed^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationFeed^ UnwrapSyndicationFeed(Handle<Value> value);
    friend bool IsSyndicationFeedWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationFeed::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationFeed(::Windows::Web::Syndication::SyndicationFeed^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationFeed::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationFeed^ UnwrapSyndicationFeed(Handle<Value> value)
  {
     return SyndicationFeed::Unwrap<SyndicationFeed>(value.As<Object>())->_instance;
  }

  void InitSyndicationFeed(Handle<Object> exports)
  {
    SyndicationFeed::Init(exports);
  }

  class SyndicationItem : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationItem"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("load"), FunctionTemplate::New(Load)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("loadFromXml"), FunctionTemplate::New(LoadFromXml)->GetFunction());
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("getXmlDocument"), FunctionTemplate::New(GetXmlDocument)->GetFunction());
      
                        
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("title"), TitleGetter, TitleSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("summary"), SummaryGetter, SummarySetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("source"), SourceGetter, SourceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("rights"), RightsGetter, RightsSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("publishedDate"), PublishedDateGetter, PublishedDateSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("lastUpdatedTime"), LastUpdatedTimeGetter, LastUpdatedTimeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("content"), ContentGetter, ContentSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("commentsUri"), CommentsUriGetter, CommentsUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("id"), IdGetter, IdSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("editMediaUri"), EditMediaUriGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("editUri"), EditUriGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("itemUri"), ItemUriGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("links"), LinksGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("authors"), AuthorsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("categories"), CategoriesGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("contributors"), ContributorsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("eTag"), ETagGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeNamespace"), NodeNamespaceGetter, NodeNamespaceSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeName"), NodeNameGetter, NodeNameSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("language"), LanguageGetter, LanguageSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("baseUri"), BaseUriGetter, BaseUriSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("nodeValue"), NodeValueGetter, NodeValueSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("elementExtensions"), ElementExtensionsGetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("attributeExtensions"), AttributeExtensionsGetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationItem"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationItem(::Windows::Web::Syndication::SyndicationItem^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationItem^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationItem^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 3
        && args[0]->IsString()
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(args[1])
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[2]))
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          ::Windows::Web::Syndication::SyndicationContent^ arg1 = UnwrapSyndicationContent(args[1]);
          ::Windows::Foundation::Uri^ arg2 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[2]));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationItem(arg0,arg1,arg2);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationItem();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationItem *wrapperInstance = new SyndicationItem(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  
    static Handle<Value> Load(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(args.This());

      if (args.Length() == 1
        && args[0]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          
          wrapper->_instance->Load(arg0);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> LoadFromXml(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(args.This());

      if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Data::Xml::Dom::XmlDocument^>(args[0]))
      {
        try
        {
          ::Windows::Data::Xml::Dom::XmlDocument^ arg0 = dynamic_cast<::Windows::Data::Xml::Dom::XmlDocument^>(NodeRT::Utils::GetObjectInstance(args[0]));
          
          wrapper->_instance->LoadFromXml(arg0);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }
    static Handle<Value> GetXmlDocument(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(args.This());

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          ::Windows::Web::Syndication::SyndicationFormat arg0 = static_cast<::Windows::Web::Syndication::SyndicationFormat>(args[0]->Int32Value());
          
          ::Windows::Data::Xml::Dom::XmlDocument^ result;
          result = wrapper->_instance->GetXmlDocument(arg0);
          return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Data.Xml.Dom", "XmlDocument", result));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> TitleGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Web::Syndication::ISyndicationText^ result = wrapper->_instance->Title;
        return scope.Close(WrapISyndicationText(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TitleSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::ISyndicationText^ winRtValue = dynamic_cast<::Windows::Web::Syndication::ISyndicationText^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Title = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> SummaryGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Web::Syndication::ISyndicationText^ result = wrapper->_instance->Summary;
        return scope.Close(WrapISyndicationText(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void SummarySetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::ISyndicationText^ winRtValue = dynamic_cast<::Windows::Web::Syndication::ISyndicationText^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Summary = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> SourceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Web::Syndication::SyndicationFeed^ result = wrapper->_instance->Source;
        return scope.Close(WrapSyndicationFeed(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void SourceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationFeed^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::SyndicationFeed^ winRtValue = dynamic_cast<::Windows::Web::Syndication::SyndicationFeed^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Source = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> RightsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Web::Syndication::ISyndicationText^ result = wrapper->_instance->Rights;
        return scope.Close(WrapISyndicationText(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void RightsSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationText^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::ISyndicationText^ winRtValue = dynamic_cast<::Windows::Web::Syndication::ISyndicationText^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Rights = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> PublishedDateGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::DateTime result = wrapper->_instance->PublishedDate;
        return scope.Close(NodeRT::Utils::DateTimeToJS(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void PublishedDateSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsDate())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Foundation::DateTime winRtValue = NodeRT::Utils::DateTimeFromJSDate(value);

        wrapper->_instance->PublishedDate = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LastUpdatedTimeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::DateTime result = wrapper->_instance->LastUpdatedTime;
        return scope.Close(NodeRT::Utils::DateTimeToJS(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LastUpdatedTimeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsDate())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Foundation::DateTime winRtValue = NodeRT::Utils::DateTimeFromJSDate(value);

        wrapper->_instance->LastUpdatedTime = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ContentGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Web::Syndication::SyndicationContent^ result = wrapper->_instance->Content;
        return scope.Close(WrapSyndicationContent(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ContentSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationContent^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Web::Syndication::SyndicationContent^ winRtValue = dynamic_cast<::Windows::Web::Syndication::SyndicationContent^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->Content = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> CommentsUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->CommentsUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void CommentsUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->CommentsUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> IdGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Id;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void IdSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Id = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> EditMediaUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->EditMediaUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> EditUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->EditUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ItemUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->ItemUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> LinksGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationLink^>^ result = wrapper->_instance->Links;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationLink^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationLink^ val) -> Handle<Value> {
              return WrapSyndicationLink(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationLink^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationLink^ {
              return UnwrapSyndicationLink(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> AuthorsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationPerson^>^ result = wrapper->_instance->Authors;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationPerson^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationPerson^ val) -> Handle<Value> {
              return WrapSyndicationPerson(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationPerson^ {
              return UnwrapSyndicationPerson(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> CategoriesGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationCategory^>^ result = wrapper->_instance->Categories;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationCategory^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationCategory^ val) -> Handle<Value> {
              return WrapSyndicationCategory(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationCategory^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationCategory^ {
              return UnwrapSyndicationCategory(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ContributorsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationPerson^>^ result = wrapper->_instance->Contributors;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationPerson^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationPerson^ val) -> Handle<Value> {
              return WrapSyndicationPerson(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationPerson^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationPerson^ {
              return UnwrapSyndicationPerson(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> ETagGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->ETag;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> NodeNamespaceGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeNamespace;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNamespaceSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeNamespace = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeNameGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeName;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeNameSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeName = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> LanguageGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->Language;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void LanguageSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->Language = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BaseUriGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Uri^ result = wrapper->_instance->BaseUri;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Foundation", "Uri", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BaseUriSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        ::Windows::Foundation::Uri^ winRtValue = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->BaseUri = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> NodeValueGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        Platform::String^ result = wrapper->_instance->NodeValue;
        return scope.Close(NodeRT::Utils::NewString(result->Data()));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void NodeValueSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsString())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return;
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        
        Platform::String^ winRtValue = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(value)));

        wrapper->_instance->NodeValue = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ElementExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::ISyndicationNode^>^ result = wrapper->_instance->ElementExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::ISyndicationNode^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::ISyndicationNode^ val) -> Handle<Value> {
              return WrapISyndicationNode(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationNode^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::ISyndicationNode^ {
              return UnwrapISyndicationNode(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static Handle<Value> AttributeExtensionsGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationItem^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationItem *wrapper = SyndicationItem::Unwrap<SyndicationItem>(info.This());

      try 
      {
        ::Windows::Foundation::Collections::IVector<::Windows::Web::Syndication::SyndicationAttribute^>^ result = wrapper->_instance->AttributeExtensions;
        return scope.Close(NodeRT::Collections::VectorWrapper<::Windows::Web::Syndication::SyndicationAttribute^>::CreateVectorWrapper(result, 
            [](::Windows::Web::Syndication::SyndicationAttribute^ val) -> Handle<Value> {
              return WrapSyndicationAttribute(val);
            },
            [](Handle<Value> value) -> bool {
              return NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationAttribute^>(value);
            },
            [](Handle<Value> value) -> ::Windows::Web::Syndication::SyndicationAttribute^ {
              return UnwrapSyndicationAttribute(value);
            }
          ));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationItem^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationItem(::Windows::Web::Syndication::SyndicationItem^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationItem^ UnwrapSyndicationItem(Handle<Value> value);
    friend bool IsSyndicationItemWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationItem::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationItem(::Windows::Web::Syndication::SyndicationItem^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationItem::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationItem^ UnwrapSyndicationItem(Handle<Value> value)
  {
     return SyndicationItem::Unwrap<SyndicationItem>(value.As<Object>())->_instance;
  }

  void InitSyndicationItem(Handle<Object> exports)
  {
    SyndicationItem::Init(exports);
  }

  class ISyndicationClient : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("ISyndicationClient"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
      Handle<Value> asyncSymbol = String::NewSymbol("__winRtAsync__");
      Handle<Function> func;
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("setRequestHeader"), FunctionTemplate::New(SetRequestHeader)->GetFunction());
      
            
      func = FunctionTemplate::New(RetrieveFeedAsync)->GetFunction();
      func->Set(asyncSymbol, True(), PropertyAttribute::DontEnum);
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("retrieveFeedAsync"), func);
      
                  
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("bypassCacheOnRetrieve"), BypassCacheOnRetrieveGetter, BypassCacheOnRetrieveSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("maxResponseBufferSize"), MaxResponseBufferSizeGetter, MaxResponseBufferSizeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("proxyCredential"), ProxyCredentialGetter, ProxyCredentialSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("serverCredential"), ServerCredentialGetter, ServerCredentialSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("timeout"), TimeoutGetter, TimeoutSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("ISyndicationClient"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    ISyndicationClient(::Windows::Web::Syndication::ISyndicationClient^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::ISyndicationClient^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::ISyndicationClient^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      ISyndicationClient *wrapperInstance = new ISyndicationClient(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


    static Handle<Value> RetrieveFeedAsync(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      if (args.Length() == 0 || !args[args.Length() -1]->IsFunction())
      {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
          return scope.Close(Undefined());
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(args.This());

      ::Windows::Foundation::IAsyncOperationWithProgress<::Windows::Web::Syndication::SyndicationFeed^, ::Windows::Web::Syndication::RetrievalProgress>^ op;
    

      if (args.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[0]))
      {
        try
        {
          ::Windows::Foundation::Uri^ arg0 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[0]));
          
          op = wrapper->_instance->RetrieveFeedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }
    
      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(args[args.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<::Windows::Web::Syndication::SyndicationFeed^> t) 
      {	
        try
        {
          auto result = t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [result](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            TryCatch tryCatch;
            Handle<Value> error; 
            Handle<Value> arg1 = WrapSyndicationFeed(result);
            if (tryCatch.HasCaught())
            {
              error = tryCatch.Exception()->ToObject();
            }
            else 
            {
              error = Undefined();
            }
            if (arg1.IsEmpty()) arg1 = Undefined();
            Handle<Value> args[] = {error, arg1};

            invokeCallback(_countof(args), args);
          });
        }
        catch (Platform::Exception^ exception)
        {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
             
            Handle<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);
        
            Handle<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }  		
      });

      return scope.Close(Undefined());
    }
  
    static Handle<Value> SetRequestHeader(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(args.This());

      if (args.Length() == 2
        && args[0]->IsString()
        && args[1]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          
          wrapper->_instance->SetRequestHeader(arg0, arg1);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> BypassCacheOnRetrieveGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        bool result = wrapper->_instance->BypassCacheOnRetrieve;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BypassCacheOnRetrieveSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return;
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->BypassCacheOnRetrieve = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> MaxResponseBufferSizeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->MaxResponseBufferSize;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void MaxResponseBufferSizeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsUint32())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return;
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        
        unsigned int winRtValue = static_cast<unsigned int>(value->IntegerValue());

        wrapper->_instance->MaxResponseBufferSize = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ProxyCredentialGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        ::Windows::Security::Credentials::PasswordCredential^ result = wrapper->_instance->ProxyCredential;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Security.Credentials", "PasswordCredential", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ProxyCredentialSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Security::Credentials::PasswordCredential^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return;
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        
        ::Windows::Security::Credentials::PasswordCredential^ winRtValue = dynamic_cast<::Windows::Security::Credentials::PasswordCredential^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ProxyCredential = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ServerCredentialGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        ::Windows::Security::Credentials::PasswordCredential^ result = wrapper->_instance->ServerCredential;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Security.Credentials", "PasswordCredential", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ServerCredentialSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Security::Credentials::PasswordCredential^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return;
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        
        ::Windows::Security::Credentials::PasswordCredential^ winRtValue = dynamic_cast<::Windows::Security::Credentials::PasswordCredential^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ServerCredential = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> TimeoutGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->Timeout;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TimeoutSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsUint32())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::ISyndicationClient^>(info.This()))
      {
        return;
      }

      ISyndicationClient *wrapper = ISyndicationClient::Unwrap<ISyndicationClient>(info.This());

      try 
      {
        
        unsigned int winRtValue = static_cast<unsigned int>(value->IntegerValue());

        wrapper->_instance->Timeout = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::Web::Syndication::ISyndicationClient^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapISyndicationClient(::Windows::Web::Syndication::ISyndicationClient^ wintRtInstance);
    friend ::Windows::Web::Syndication::ISyndicationClient^ UnwrapISyndicationClient(Handle<Value> value);
    friend bool IsISyndicationClientWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> ISyndicationClient::s_constructorTemplate;

  v8::Handle<v8::Value> WrapISyndicationClient(::Windows::Web::Syndication::ISyndicationClient^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(ISyndicationClient::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::ISyndicationClient^ UnwrapISyndicationClient(Handle<Value> value)
  {
     return ISyndicationClient::Unwrap<ISyndicationClient>(value.As<Object>())->_instance;
  }

  void InitISyndicationClient(Handle<Object> exports)
  {
    ISyndicationClient::Init(exports);
  }

  class SyndicationClient : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationClient"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
      Handle<Value> asyncSymbol = String::NewSymbol("__winRtAsync__");
      Handle<Function> func;
            
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("setRequestHeader"), FunctionTemplate::New(SetRequestHeader)->GetFunction());
      
            
      func = FunctionTemplate::New(RetrieveFeedAsync)->GetFunction();
      func->Set(asyncSymbol, True(), PropertyAttribute::DontEnum);
      s_constructorTemplate->PrototypeTemplate()->Set(String::NewSymbol("retrieveFeedAsync"), func);
      
                  
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("timeout"), TimeoutGetter, TimeoutSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("serverCredential"), ServerCredentialGetter, ServerCredentialSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("proxyCredential"), ProxyCredentialGetter, ProxyCredentialSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("maxResponseBufferSize"), MaxResponseBufferSizeGetter, MaxResponseBufferSizeSetter);
      s_constructorTemplate->PrototypeTemplate()->SetAccessor(String::NewSymbol("bypassCacheOnRetrieve"), BypassCacheOnRetrieveGetter, BypassCacheOnRetrieveSetter);
      
      Local<Function> constructor = s_constructorTemplate->GetFunction();


      exports->Set(String::NewSymbol("SyndicationClient"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationClient(::Windows::Web::Syndication::SyndicationClient^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationClient^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationClient^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 1
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Security::Credentials::PasswordCredential^>(args[0]))
      {
        try
        {
          ::Windows::Security::Credentials::PasswordCredential^ arg0 = dynamic_cast<::Windows::Security::Credentials::PasswordCredential^>(NodeRT::Utils::GetObjectInstance(args[0]));
          
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationClient(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else if (args.Length() == 0)
      {
        try
        {
          winRtInstance = ref new ::Windows::Web::Syndication::SyndicationClient();
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationClient *wrapperInstance = new SyndicationClient(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


    static Handle<Value> RetrieveFeedAsync(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      if (args.Length() == 0 || !args[args.Length() -1]->IsFunction())
      {
          ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: No callback was given")));
          return scope.Close(Undefined());
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(args.This());

      ::Windows::Foundation::IAsyncOperationWithProgress<::Windows::Web::Syndication::SyndicationFeed^, ::Windows::Web::Syndication::RetrievalProgress>^ op;
    

      if (args.Length() == 2
        && NodeRT::Utils::IsWinRtWrapperOf<::Windows::Foundation::Uri^>(args[0]))
      {
        try
        {
          ::Windows::Foundation::Uri^ arg0 = dynamic_cast<::Windows::Foundation::Uri^>(NodeRT::Utils::GetObjectInstance(args[0]));
          
          op = wrapper->_instance->RetrieveFeedAsync(arg0);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }
    
      auto opTask = create_task(op);
      uv_async_t* asyncToken = NodeUtils::Async::GetAsyncToken(args[args.Length() -1].As<Function>());

      opTask.then( [asyncToken] (task<::Windows::Web::Syndication::SyndicationFeed^> t) 
      {	
        try
        {
          auto result = t.get();
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [result](NodeUtils::InvokeCallbackDelegate invokeCallback) {


            TryCatch tryCatch;
            Handle<Value> error; 
            Handle<Value> arg1 = WrapSyndicationFeed(result);
            if (tryCatch.HasCaught())
            {
              error = tryCatch.Exception()->ToObject();
            }
            else 
            {
              error = Undefined();
            }
            if (arg1.IsEmpty()) arg1 = Undefined();
            Handle<Value> args[] = {error, arg1};

            invokeCallback(_countof(args), args);
          });
        }
        catch (Platform::Exception^ exception)
        {
          NodeUtils::Async::RunCallbackOnMain(asyncToken, [exception](NodeUtils::InvokeCallbackDelegate invokeCallback) {
             
            Handle<Value> error = NodeRT::Utils::WinRtExceptionToJsError(exception);
        
            Handle<Value> args[] = {error};
            invokeCallback(_countof(args), args);
          });
        }  		
      });

      return scope.Close(Undefined());
    }
  
    static Handle<Value> SetRequestHeader(const v8::Arguments& args)
    {
      HandleScope scope;

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(args.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(args.This());

      if (args.Length() == 2
        && args[0]->IsString()
        && args[1]->IsString())
      {
        try
        {
          Platform::String^ arg0 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[0])));
          Platform::String^ arg1 = ref new Platform::String(NodeRT::Utils::StringToWchar(v8::String::Value(args[1])));
          
          wrapper->_instance->SetRequestHeader(arg0, arg1);
          return scope.Close(Undefined());   
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



    static Handle<Value> TimeoutGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->Timeout;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void TimeoutSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsUint32())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return;
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        
        unsigned int winRtValue = static_cast<unsigned int>(value->IntegerValue());

        wrapper->_instance->Timeout = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ServerCredentialGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        ::Windows::Security::Credentials::PasswordCredential^ result = wrapper->_instance->ServerCredential;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Security.Credentials", "PasswordCredential", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ServerCredentialSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Security::Credentials::PasswordCredential^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return;
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        
        ::Windows::Security::Credentials::PasswordCredential^ winRtValue = dynamic_cast<::Windows::Security::Credentials::PasswordCredential^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ServerCredential = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> ProxyCredentialGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        ::Windows::Security::Credentials::PasswordCredential^ result = wrapper->_instance->ProxyCredential;
        return scope.Close(NodeRT::Utils::CreateExternalWinRTObject("Windows.Security.Credentials", "PasswordCredential", result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void ProxyCredentialSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Security::Credentials::PasswordCredential^>(value))
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return;
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        
        ::Windows::Security::Credentials::PasswordCredential^ winRtValue = dynamic_cast<::Windows::Security::Credentials::PasswordCredential^>(NodeRT::Utils::GetObjectInstance(value));

        wrapper->_instance->ProxyCredential = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> MaxResponseBufferSizeGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        unsigned int result = wrapper->_instance->MaxResponseBufferSize;
        return scope.Close(Integer::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void MaxResponseBufferSizeSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsUint32())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return;
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        
        unsigned int winRtValue = static_cast<unsigned int>(value->IntegerValue());

        wrapper->_instance->MaxResponseBufferSize = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    
    static Handle<Value> BypassCacheOnRetrieveGetter(Local<String> property, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return scope.Close(Undefined());
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        bool result = wrapper->_instance->BypassCacheOnRetrieve;
        return scope.Close(Boolean::New(result));
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
        return scope.Close(Undefined());
      }
    }
    
    static void BypassCacheOnRetrieveSetter(Local<String> property, Local<Value> value, const AccessorInfo &info)
    {
      HandleScope scope;
      
      if (!value->IsBoolean())
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Value to set is of unexpected type")));
        return;
      }

      if (!NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationClient^>(info.This()))
      {
        return;
      }

      SyndicationClient *wrapper = SyndicationClient::Unwrap<SyndicationClient>(info.This());

      try 
      {
        
        bool winRtValue = value->BooleanValue();

        wrapper->_instance->BypassCacheOnRetrieve = winRtValue;
      }
      catch (Platform::Exception ^exception)
      {
        NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
      }
    }
    


  private:
    ::Windows::Web::Syndication::SyndicationClient^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationClient(::Windows::Web::Syndication::SyndicationClient^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationClient^ UnwrapSyndicationClient(Handle<Value> value);
    friend bool IsSyndicationClientWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationClient::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationClient(::Windows::Web::Syndication::SyndicationClient^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationClient::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationClient^ UnwrapSyndicationClient(Handle<Value> value)
  {
     return SyndicationClient::Unwrap<SyndicationClient>(value.As<Object>())->_instance;
  }

  void InitSyndicationClient(Handle<Object> exports)
  {
    SyndicationClient::Init(exports);
  }

  class SyndicationError : public WrapperBase
  {
  public:    
    static v8::Handle<v8::Value> Init(const Handle<Object> exports)
    {
      HandleScope scope;
      
      s_constructorTemplate = Persistent<FunctionTemplate>::New(FunctionTemplate::New(New));
      s_constructorTemplate->SetClassName(String::NewSymbol("SyndicationError"));
      s_constructorTemplate->InstanceTemplate()->SetInternalFieldCount(1);
      
                              
      Local<Function> constructor = s_constructorTemplate->GetFunction();

      constructor->Set(String::NewSymbol("getStatus"), FunctionTemplate::New(GetStatus)->GetFunction());

      exports->Set(String::NewSymbol("SyndicationError"), constructor);
      return scope.Close(Undefined());
    }


    virtual ::Platform::Object^ GetObjectInstance() const override
    {
      return _instance;
    }

  private:
    
    SyndicationError(::Windows::Web::Syndication::SyndicationError^ instance)
    {
      _instance = instance;
    }
    
    
    static v8::Handle<v8::Value> New(const v8::Arguments& args)
    {
      HandleScope scope;

      // in case the constructor was called without the new operator
      if (!s_constructorTemplate->HasInstance(args.This()))
      {
        if (args.Length() > 0)
        {
          std::unique_ptr<Handle<Value> []> constructorArgs(new Handle<Value>[args.Length()]);

          Handle<Value> *argsPtr = constructorArgs.get();
          for (int i = 0; i < args.Length(); i++)
          {
            argsPtr[i] = args[i];
          }

          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), constructorArgs.get());
        }
        else
        {
          return s_constructorTemplate->GetFunction()->CallAsConstructor(args.Length(), nullptr);
        }
      }
      
      ::Windows::Web::Syndication::SyndicationError^ winRtInstance;


      if (args.Length() == 1 && OpaqueWrapper::IsOpaqueWrapper(args[0]) &&
        NodeRT::Utils::IsWinRtWrapperOf<::Windows::Web::Syndication::SyndicationError^>(args[0]))
      {
        try 
        {
          winRtInstance = (::Windows::Web::Syndication::SyndicationError^) NodeRT::Utils::GetObjectInstance(args[0]);
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Invalid arguments, no suitable constructor found")));
        return scope.Close(Undefined());
      }

      args.This()->SetHiddenValue(String::NewSymbol("__winRtInstance__"), True());

      SyndicationError *wrapperInstance = new SyndicationError(winRtInstance);
      wrapperInstance->Wrap(args.This());

      return args.This();
    }


  


    static Handle<Value> GetStatus(const v8::Arguments& args)
    {
      HandleScope scope;

      if (args.Length() == 1
        && args[0]->IsInt32())
      {
        try
        {
          int arg0 = static_cast<int>(args[0]->Int32Value());
          
          ::Windows::Web::Syndication::SyndicationErrorStatus result;
          result = ::Windows::Web::Syndication::SyndicationError::GetStatus(arg0);
          return scope.Close(Integer::New(static_cast<int>(result)));
        }
        catch (Platform::Exception ^exception)
        {
          NodeRT::Utils::ThrowWinRtExceptionInJs(exception);
          return scope.Close(Undefined());
        }
      }
      else 
      {
        ThrowException(Exception::Error(NodeRT::Utils::NewString(L"Bad arguments: no suitable overload found")));
        return scope.Close(Undefined());
      }

      return scope.Close(Undefined());
    }



  private:
    ::Windows::Web::Syndication::SyndicationError^ _instance;
    static Persistent<FunctionTemplate> s_constructorTemplate;

    friend v8::Handle<v8::Value> WrapSyndicationError(::Windows::Web::Syndication::SyndicationError^ wintRtInstance);
    friend ::Windows::Web::Syndication::SyndicationError^ UnwrapSyndicationError(Handle<Value> value);
    friend bool IsSyndicationErrorWrapper(Handle<Value> value);
  };
  Persistent<FunctionTemplate> SyndicationError::s_constructorTemplate;

  v8::Handle<v8::Value> WrapSyndicationError(::Windows::Web::Syndication::SyndicationError^ winRtInstance)
  {
    HandleScope scope;

    if (winRtInstance == nullptr)
    {
      return scope.Close(Undefined());
    }

    Handle<Object> opaqueWrapper = CreateOpaqueWrapper(winRtInstance);
    Handle<Value> args[] = {opaqueWrapper};
    return scope.Close(SyndicationError::s_constructorTemplate->GetFunction()->NewInstance(_countof(args), args));
  }

  ::Windows::Web::Syndication::SyndicationError^ UnwrapSyndicationError(Handle<Value> value)
  {
     return SyndicationError::Unwrap<SyndicationError>(value.As<Object>())->_instance;
  }

  void InitSyndicationError(Handle<Object> exports)
  {
    SyndicationError::Init(exports);
  }

} } } } 

void init(Handle<Object> exports)
{
  if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
  {
    ThrowException(v8::Exception::Error(NodeRT::Utils::NewString(L"error in CoInitializeEx()")));
    return;
  }
  
  NodeRT::Windows::Web::Syndication::InitSyndicationFormatEnum(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationErrorStatusEnum(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationTextTypeEnum(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationAttribute(exports);
  NodeRT::Windows::Web::Syndication::InitISyndicationNode(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationNode(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationGenerator(exports);
  NodeRT::Windows::Web::Syndication::InitISyndicationText(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationText(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationContent(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationLink(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationPerson(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationCategory(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationFeed(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationItem(exports);
  NodeRT::Windows::Web::Syndication::InitISyndicationClient(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationClient(exports);
  NodeRT::Windows::Web::Syndication::InitSyndicationError(exports);

  NodeRT::Utils::RegisterNameSpace("Windows.Web.Syndication", exports);
}


NODE_MODULE(binding, init)