Exemple #1
0
        public async void loadFileFast()
        {
            ResetBinaryInfo();

            if (await LBDJsInterop.HasFile("fileUpload"))
            {
                await CounterHelper.CmdAddCounter(new TSCounter()
                {
                    Source = navigationManager.Uri, Action = "ClickButtonFast"
                });


                _BinaryInfo.progressInfo = "started";
                log.Add("started");
                BWHTimeAnalyzer.Reset("Fast mode");
                BWHTimeAnalyzer.Add("reading in js", MethodBase.GetCurrentMethod());

                _BinaryInfo.progressInfo = "js is loading file...";
                log.Add("js is loading file...");
                StateHasChanged();

                await LBDJsInterop.ReadFile(_BinaryInfo.variableName, "fileUpload");
            }
            else
            {
                await LBDJsInterop.Alert("Please select file");
            }
        }
 public void RegisterJsEvents()
 {
     foreach (var item in listDragTarget)
     {
         LBDJsInterop.HandleDrop(jsRuntime, item.ElementID, item.ID, DotNetObjectReference.Create(this));
     }
 }
Exemple #3
0
        public async void loadFileRegular()
        {
            log.Clear();

            if (await LBDJsInterop.HasFile("fileUpload"))
            {
                await CounterHelper.CmdAddCounter(new TSCounter()
                {
                    Source = navigationManager.Uri, Action = "ClickButtonRegular"
                });


                BWHTimeAnalyzer.Reset("Regular mode");

                log.Add("started");
                log.Add("js is loading file...");
                StateHasChanged();

                BWHTimeAnalyzer.Add("set data", MethodBase.GetCurrentMethod());

                string a = await LBDJsInterop.GetFile(_BinaryInfo.variableName, "fileUpload");

                log.Add(a);

                log.Add(".net loaded " + a.Length + " bytes");
                log.Add("done");

                BWHTimeAnalyzer.LogAll();
                StateHasChanged();
            }
            else
            {
                await LBDJsInterop.Alert("Please select file");
            }
        }
 public async void WwCalculateJS()
 {
     if (!string.IsNullOrEmpty(Ww_Message))
     {
         int arg = 0;
         if (int.TryParse(Ww_Message, out arg))
         {
             bwwJsInterop.Alert((await LBDJsInterop.CalcFib(jsRuntime, arg)).ToString());
             Ww_Message = string.Empty;
             StateHasChanged();
         }
         else
         {
             bwwJsInterop.Alert("Please input valid integer");
         }
     }
     else
     {
         bwwJsInterop.Alert("Please input message");
     }
 }
        //protected override void OnInitialized()
        //{

        //    base.OnInitialized();
        //}


        public async void JsSendMessage()
        {
            if (!string.IsNullOrEmpty(JsMessage))
            {
                await CounterHelper.CmdAddCounter(new TSCounter()
                {
                    Source = navigationManager.Uri, Action = "ClickButtonRegular"
                });


                ExpandData();

                log.Add(JsMessage);


                BlazorTimeAnalyzer.Reset();
                BlazorTimeAnalyzer.Add("set data", MethodBase.GetCurrentMethod());
                await LBDJsInterop.SetData("myTmpVar1", JsMessage);

                BlazorTimeAnalyzer.Add("process data", MethodBase.GetCurrentMethod());
                LBDJsInterop.ProcessData("myTmpVar1");


                BlazorTimeAnalyzer.Add("get data", MethodBase.GetCurrentMethod());
                log.Add(await LBDJsInterop.GetData("myTmpVar1"));

                BlazorTimeAnalyzer.LogAll();


                JsMessage = string.Empty;
            }
            else
            {
                await LBDJsInterop.Alert("Please input message");
            }


            StateHasChanged();
        }
Exemple #6
0
 public void Stop(KeyNote key)
 {
     key.IsPressed = false;
     LBDJsInterop.PianoStop(key.letter);
 }
Exemple #7
0
 public void Play(KeyNote key)
 {
     key.IsPressed = true;
     LBDJsInterop.PianoPlay(key.letter, Volume, key.freq);
 }
Exemple #8
0
 public void CmdBeep()
 {
     LBDJsInterop.Beep(CurrVolume, CurrFrequency, CurrDuration);
 }
        public async void GenerateNew()
        {
            Ww_Message = await LBDJsInterop.GenerateNewUser(jsRuntime);

            StateHasChanged();
        }
 public void Stop()
 {
     LBDJsInterop.PianoStop();
     ReleaseKeys();
 }
 public void Play(KeyNote key)
 {
     ReleaseKeys();
     key.IsPressed = true;
     LBDJsInterop.PianoPlay(Volume, key.freq);
 }
 public void OnMouseDown(MouseEventArgs e, MyDraggable item)
 {
     LBDJsInterop.HandleDrag(jsRuntime, item.ElementID, item.ID, DotNetObjectReference.Create(this));
 }