Exemplo n.º 1
0
 private void registerTDrawingSurface(IJSValueConverterService converter)
 {
     converter.RegisterProxyConverter <TDrawingSurface>(
         (binding, obj, node) =>
     {
         binding.SetFunction(nameof(obj.CreateSpritBatch), obj.CreateSpritBatch);
     });
 }
Exemplo n.º 2
0
 private void registerTTexture(IJSValueConverterService converter)
 {
     converter.RegisterProxyConverter <TTexture>(
         (binding, obj, node) =>
     {
         binding.SetFunction <SizeF>(nameof(obj.GetSize), () => obj.GetSize);
     });
 }
Exemplo n.º 3
0
 private static void registerProxy(IJSValueConverterService converter)
 {
     converter.RegisterProxyConverter <HostingProxy>(
         (binding, obj, node) =>
     {
         binding.SetFunction <string, string, Task <string> >("Dispatch", obj.Dispatch);
     }
         );
     converter.RegisterTask <HostingProxy>();
     converter.RegisterTask <string>();
 }
Exemplo n.º 4
0
        private static void InjectDictionaryConverter(IJSValueConverterService service)
        {
            service.RegisterArrayConverter <string>();

            service.RegisterProxyConverter <IDictionary <string, string> >(
                (binding, dict, node) =>
            {
                DictionaryWrapper wrapper = new DictionaryWrapper(dict);
                binding.SetFunction <IEnumerable <string> >("GetKeys", wrapper.GetKeys);
                binding.SetMethod <string, string>("SetItem", wrapper.SetItem);
                binding.SetFunction <string, string>("GetItem", wrapper.GetItem);
                binding.SetFunction <string, bool>("ContainsKey", wrapper.ContainsKey);
            }

                );
        }
Exemplo n.º 5
0
 private void registerTSprintBatch(IJSValueConverterService converter)
 {
     converter.RegisterProxyConverter <TSpritBatch>(
         (binding, obj, node) =>
     {
         binding.SetMethod <PointF, string, Font, string, int>(nameof(obj.DrawText), obj.DrawText);
         binding.SetMethod <IEnumerable <PointF>, string, int>(nameof(obj.DrawLines), obj.DrawLines);
         binding.SetMethod <PointF, SizeF, string, int, bool>(nameof(obj.DrawEclipse), obj.DrawEclipse);
         binding.SetMethod <PointF, SizeF, TTexture, float>(nameof(obj.DrawImage), obj.DrawImage);
         binding.SetMethod <string, RectangleF>(nameof(obj.Fill), obj.Fill);
         binding.SetMethod <RectangleF, string, int, bool>(nameof(obj.DrawRectangle), obj.DrawRectangle);
         binding.SetMethod <PointF, PointF, PointF, string, int, bool>(nameof(obj.DrawTriangle), obj.DrawTriangle);
         binding.SetMethod <PointF>(nameof(obj.Translate), obj.Translate);
         binding.SetMethod <PointF>(nameof(obj.Scale), obj.Scale);
         binding.SetMethod <float>(nameof(obj.Rotate), obj.Rotate);
         binding.SetFunction <int>(nameof(obj.PushMatrix), obj.PushMatrix);
         binding.SetFunction <int>(nameof(obj.PopMatrix), obj.PopMatrix);
         binding.SetMethod(nameof(obj.ResetMatrix), obj.ResetMatrix);
         binding.SetMethod <BlendModeEnum, Effect>(nameof(obj.Begin), obj.Begin);
         binding.SetMethod(nameof(obj.End), obj.End);
     }
         );
 }