#include "GuiInstanceCompiledWorkflow.h"
#include "../Controls/GuiApplication.h"
namespace
{
namespace
{
using
namespace
stream
;
using
namespace
workflow
::
runtime
;
using
namespace
controls
;
using
namespace
reflection
;
using
namespace
reflection
::
description
;
GuiInstanceCompiledWorkflow
::
GuiInstanceCompiledWorkflow
()
{
}
GuiInstanceCompiledWorkflow
::
~
GuiInstanceCompiledWorkflow
()
{
();
}
bool
GuiInstanceCompiledWorkflow
::
(
bool
,
workflow
::
runtime
::
&
)
{
if
(
)
{
::
(*
.
(),
);
if
(!
)
{
return
false
;
}
nullptr
;
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
nullptr
;
#endif
}
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
if
(
&& !
)
{
new
(
);
<
void
()>(
,
L"<initialize>"
)();
}
#else
if (initializeContext)
{
if (assembly->typeImpl)
{
if (auto tm = GetGlobalTypeManager())
{
tm->AddTypeLoader(assembly->typeImpl);
}
}
}
#endif
return
true
;
}
void
GuiInstanceCompiledWorkflow
::
()
{
();
nullptr
;
}
void
GuiInstanceCompiledWorkflow
::
()
{
#ifdef VCZH_DESCRIPTABLEOBJECT_WITH_METADATA
nullptr
;
#else
if (assembly && assembly->typeImpl)
{
if (auto tm = GetGlobalTypeManager())
{
tm->RemoveTypeLoader(assembly->typeImpl);
}
}
#endif
}
class
GuiResourceCompiledWorkflowTypeResolver
:
public
,
public
,
private
IGuiResourceTypeResolver_Initialize
,
private
IGuiResourceTypeResolver_DirectLoadStream
{
public
:
()
override
{
return
L"Workflow"
;
}
bool
()
override
{
return
false
;
}
bool
()
override
{
return
true
;
}
()
override
{
return
1
;
}
void
(
<
>
,
GuiResourceInitializeContext
&
,
::
&
)
override
{
if
(
auto
=
().
<
GuiInstanceCompiledWorkflow
>())
{
switch
(
.
)
{
case
0
:
if
(
compiled
==
GuiInstanceCompiledWorkflow
::
)
{
if
(
.
==
::
)
{
;
if
(!
compiled
(
true
,
loadErrors
))
{
FOREACH(WString, loadError, loadErrors.duplicatedTypes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
loadErrors
.
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
loadError
);)
{
.
({ {
},
L"Failed to add an existing type: "
+
loadError
});
}
FOREACH(WString, loadError, loadErrors.unresolvedTypes)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
loadErrors
.
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
loadError
);)
{
.
({ {
},
L"Unable to resolve type: "
+
loadError
});
}
FOREACH(WString, loadError, loadErrors.unresolvedMembers)
if
(
bool
=
true
)
for
(
const
::
vl
::
collections
::
<
>&
= ::
vl
::
collections
::
(
loadErrors
.
);
__scope_variable_flag__
;
__scope_variable_flag__
=
false
)
for
(
;
__foreach_iterator__
.
(
loadError
);)
{
.
({ {
},
L"Unable to resolve member: "
+
loadError
});
}
}
}
}
break
;
}
}
}
IGuiResourceTypeResolver_Initialize
*
()
override
{
return
this
;
}
IGuiResourceTypeResolver_DirectLoadStream
*
()
override
{
return
this
;
}
void
(
<
>
,
<
>
,
stream
::
&
)
override
{
if
(
auto
=
.
<
GuiInstanceCompiledWorkflow
>())
{
internal
::
(
);
= (
)
obj
;
writer
type
;
if
(
obj
==
GuiInstanceCompiledWorkflow
::
)
{
stream
::
;
obj
(
memoryStream
);
writer
(
stream
::
&)
memoryStream
;
}
}
}
<
>
ResolveResourcePrecompiled
(
<
>
,
stream
::
&
,
::
&
)
override
{
internal
::
(
);
;
reader
type
;
auto
=
<
GuiInstanceCompiledWorkflow
>();
obj
= (
GuiInstanceCompiledWorkflow
::
)
type
;
if
(
obj
==
GuiInstanceCompiledWorkflow
::
)
{
auto
=
<
stream
::
>();
reader
(
stream
::
&)*
memoryStream
.
();
obj
memoryStream
;
}
return
obj
;
}
};
class
GuiRuntimeTypeResolversPlugin
:
public
,
public
{
public
:
GUI_PLUGIN_NAME(GacUI_Compiler_WorkflowTypeResolvers)
vl
::
()
override
{
return
L"GacUI_Compiler_WorkflowTypeResolvers"
; }
void
(
vl
::
collections
::
<
>&
)
override
{
GUI_PLUGIN_DEPEND(GacUI_Res_ResourceResolver);
.
(
L"GacUI_Res_ResourceResolver"
);
}
void
()
override
{
IGuiResourceResolverManager
*
=
GetResourceResolverManager
();
manager
->
(
new
GuiResourceCompiledWorkflowTypeResolver
);
}
void
()
override
{
}
};
GUI_REGISTER_PLUGIN(GuiRuntimeTypeResolversPlugin)
class
GuiRegisterPluginClass_GuiRuntimeTypeResolversPlugin
{
public
:
GuiRegisterPluginClass_GuiRuntimeTypeResolversPlugin
() {
vl
::
presentation
::
controls
::
()->
(
new
GuiRuntimeTypeResolversPlugin
); } }
instance_GuiRegisterPluginClass_GuiRuntimeTypeResolversPlugin
;
}
}