Ejemplo n.º 1
0
        public static void InvokeChangeQueue(PositionChange[] changes)
        {
            if (changes.Length <= 0)
            {
                return;
            }

            var packet = String.Empty;

            for (int i = 0; i < changes.Length; i++)
            {
                if (changes[i].UniqueID == String.Empty)
                {
                    continue;
                }

                packet += changes[i].ToString();
                if (i < changes.Length - 1)
                {
                    packet += "|";
                }
            }

            //Console.WriteLine($"Sending packet: {packet}");
            MonoRuntime.InvokeUnmarshalled <string, object>("changeFlushPacket", packet);
        }
Ejemplo n.º 2
0
        public static void AllocateArray(int length, string a)
        {
            byte[] b = new byte[length];

            monoWebAssemblyJSRuntime.InvokeUnmarshalled <byte[], bool>("BwsJsFunctions.GetBinaryData", b);

            HandleMessageBinary(b, a);
        }
Ejemplo n.º 3
0
        public static Size MeasureText(
            string text,
            string fontFamily,
            double size,
            double widthConstraint = 0)
        {
            var req = new JSTextMeasureRequest
            {
                font            = $"{size}px {fontFamily}",
                text            = text,
                widthConstraint = (float)widthConstraint
            };

            _rt.InvokeUnmarshalled <JSTextMeasureRequest, object>(
                "XFUtilities.measureText",
                req);

            return(new Size(req.retWidth, req.retHeight));
        }
Ejemplo n.º 4
0
 public static bool UpdateRowContentBatch(string[] updatepkg)
 {
     return(monoWebAssemblyJSRuntime.InvokeUnmarshalled <string, bool>(
                "BVirtualGridCJsFunctions.UpdateRowContentBatch",
                JsonSerializer.Serialize(updatepkg)));
 }
Ejemplo n.º 5
0
 public TRes InvokeUnmarshalled <T1, T2, TRes>(string identifier, T1 arg1, T2 arg2)
 {
     return(current.InvokeUnmarshalled <T1, T2, TRes>(identifier, arg1, arg2));
 }
Ejemplo n.º 6
0
 public static void DownloadFile(this MonoWebAssemblyJSRuntime js, string fileName, byte[] Data) =>
 js.InvokeUnmarshalled <string, byte[], object>("DownloadBlob", fileName, Data);
 public static void SetStringData(string variableName, string data)
 {
     mono.InvokeUnmarshalled <string, string, bool>(
         "FastInterop.SetStringData", variableName, data);
 }
Ejemplo n.º 8
0
 public void DrawPixels(int[] pixels)
 {
     _js.InvokeUnmarshalled <ValueTuple <string, int[]>, object>("drawPixels", ValueTuple.Create("drawPixels", pixels));
 }