eDosStation/eDosStationApp/Generated Files/XamlTypeInfo.g.cpp
2019-02-01 17:35:18 +01:00

203 lines
6.8 KiB
C++

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
#include "pch.h"
#include "XamlTypeInfo.g.h"
#include "App.xaml.h"
#include "DirectXPage.xaml.h"
#include "XamlBindingInfo.g.hpp"
#include "App.g.hpp"
#include "DirectXPage.g.hpp"
template<typename T>
::Platform::Object^ ActivateType()
{
return ref new T;
}
template<typename TInstance, typename TItem>
void CollectionAdd(::Platform::Object^ instance, ::Platform::Object^ item)
{
safe_cast<TInstance^>(instance)->Append((TItem)item);
}
template<typename TInstance, typename TKey, typename TItem>
void DictionaryAdd(::Platform::Object^ instance, ::Platform::Object^ key, ::Platform::Object^ item)
{
safe_cast<TInstance^>(instance)->Insert((TKey)key, (TItem)item);
}
template<typename T>
::Platform::Object^ FromStringConverter(::XamlTypeInfo::InfoProvider::XamlUserType^ userType, ::Platform::String^ input)
{
return ref new ::Platform::Box<T>((T)userType->CreateEnumUIntFromString(input));
}
enum TypeInfo_Flags
{
TypeInfo_Flags_None = 0x00,
TypeInfo_Flags_IsLocalType = 0x01,
TypeInfo_Flags_IsSystemType = 0x02,
TypeInfo_Flags_IsReturnTypeStub = 0x04,
TypeInfo_Flags_IsBindable = 0x08,
TypeInfo_Flags_IsMarkupExtension = 0x10,
};
struct TypeInfo
{
PCWSTR typeName;
PCWSTR contentPropertyName;
::Platform::Object^ (*activator)();
void (*collectionAdd)(::Platform::Object^, ::Platform::Object^);
void (*dictionaryAdd)(::Platform::Object^, ::Platform::Object^, ::Platform::Object^);
::Platform::Object^ (*fromStringConverter)(::XamlTypeInfo::InfoProvider::XamlUserType^, ::Platform::String^);
int baseTypeIndex;
int firstMemberIndex;
int firstEnumValueIndex;
int createFromStringIndex;
::Windows::UI::Xaml::Interop::TypeKind kindofType;
unsigned int flags;
};
const TypeInfo TypeInfos[] =
{
// 0
L"eDosStationApp.DirectXPage", L"",
&ActivateType<::eDosStationApp::DirectXPage>, nullptr, nullptr, nullptr,
1, // Windows.UI.Xaml.Controls.Page
0, 0, -1, ::Windows::UI::Xaml::Interop::TypeKind::Custom,
TypeInfo_Flags_IsLocalType | TypeInfo_Flags_None,
// 1
L"Windows.UI.Xaml.Controls.Page", L"",
nullptr, nullptr, nullptr, nullptr,
-1,
0, 0, -1, ::Windows::UI::Xaml::Interop::TypeKind::Metadata,
TypeInfo_Flags_IsSystemType | TypeInfo_Flags_None,
// 2
L"Windows.UI.Xaml.Controls.UserControl", L"",
nullptr, nullptr, nullptr, nullptr,
-1,
0, 0, -1, ::Windows::UI::Xaml::Interop::TypeKind::Metadata,
TypeInfo_Flags_IsSystemType | TypeInfo_Flags_None,
// Last type here is for padding
L"", L"",
nullptr, nullptr, nullptr, nullptr,
-1,
0, 0, -1, ::Windows::UI::Xaml::Interop::TypeKind::Custom,
TypeInfo_Flags_None,
};
const UINT TypeInfoLookup[] = {
0, // 0
0, // 1
0, // 2
0, // 3
0, // 4
0, // 5
0, // 6
0, // 7
0, // 8
0, // 9
0, // 10
0, // 11
0, // 12
0, // 13
0, // 14
0, // 15
0, // 16
0, // 17
0, // 18
0, // 19
0, // 20
0, // 21
0, // 22
0, // 23
0, // 24
0, // 25
0, // 26
1, // 27
1, // 28
1, // 29
2, // 30
2, // 31
2, // 32
2, // 33
2, // 34
2, // 35
2, // 36
3, // 37
};
const TypeInfo* GetTypeInfo(::Platform::String^ typeName)
{
auto typeNameLength = typeName->Length();
if (typeNameLength < _countof(TypeInfoLookup) - 1)
{
for (UINT i = TypeInfoLookup[typeNameLength]; i < TypeInfoLookup[typeNameLength+1]; i++)
{
if (typeName == ::Platform::StringReference(TypeInfos[i].typeName))
{
return &TypeInfos[i];
}
}
}
return nullptr;
}
::Platform::Collections::Vector<::Windows::UI::Xaml::Markup::IXamlMetadataProvider^>^ ::XamlTypeInfo::InfoProvider::XamlTypeInfoProvider::OtherProviders::get()
{
if(_otherProviders == nullptr)
{
auto otherProviders = ref new ::Platform::Collections::Vector<::Windows::UI::Xaml::Markup::IXamlMetadataProvider^>();
_otherProviders = otherProviders;
}
return _otherProviders;
}
::Windows::UI::Xaml::Markup::IXamlType^ ::XamlTypeInfo::InfoProvider::XamlTypeInfoProvider::CreateXamlType(::Platform::String^ typeName)
{
const TypeInfo* pTypeInfo = GetTypeInfo(typeName);
const TypeInfo* pNextTypeInfo = pTypeInfo + 1;
if (pTypeInfo == nullptr || pNextTypeInfo == nullptr)
{
return nullptr;
}
else if (pTypeInfo->flags & TypeInfo_Flags_IsSystemType)
{
return ref new ::XamlTypeInfo::InfoProvider::XamlSystemBaseType(typeName);
}
else
{
::XamlTypeInfo::InfoProvider::XamlUserType^ userType = ref new ::XamlTypeInfo::InfoProvider::XamlUserType(
this,
::Platform::StringReference(pTypeInfo->typeName),
this->GetXamlTypeByName(::Platform::StringReference(pTypeInfo->baseTypeIndex >= 0 ? TypeInfos[pTypeInfo->baseTypeIndex].typeName : L"")));
userType->KindOfType = pTypeInfo->kindofType;
userType->Activator = pTypeInfo->activator;
userType->CollectionAdd = pTypeInfo->collectionAdd;
userType->DictionaryAdd = pTypeInfo->dictionaryAdd;
userType->FromStringConverter = pTypeInfo->fromStringConverter;
userType->ContentPropertyName = ::Platform::StringReference(pTypeInfo->contentPropertyName);
userType->IsLocalType = pTypeInfo->flags & TypeInfo_Flags_IsLocalType;
userType->IsReturnTypeStub = pTypeInfo->flags & TypeInfo_Flags_IsReturnTypeStub;
userType->IsBindable = pTypeInfo->flags & TypeInfo_Flags_IsBindable;
userType->IsMarkupExtension = pTypeInfo->flags & TypeInfo_Flags_IsMarkupExtension;
userType->CreateFromStringMethod = nullptr;
return userType;
}
}
::Windows::UI::Xaml::Markup::IXamlMember^ ::XamlTypeInfo::InfoProvider::XamlTypeInfoProvider::CreateXamlMember(::Platform::String^ longMemberName)
{
::XamlTypeInfo::InfoProvider::XamlMember^ xamlMember = nullptr;
// No Local Properties
(void)longMemberName; // Unused parameter
return xamlMember;
}