Exemplo n.º 1
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (CancelEvent != null)
     {
         CancelEvent.Invoke();
     }
 }
Exemplo n.º 2
0
 private void State_CancelEvent()
 {
     if (CancelEvent == null || CancelEvent.Invoke())
     {
         Dispose();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Executed when the Esc button is pressed and the Escape property is true
 /// </summary>
 public virtual void OnEscape()
 {
     ModalResult = ModalWindowResult.Cancel;
     if (MainWindow.ActiveWindow == this)
     {
         Close();
     }
     CancelEvent?.Invoke();
 }
Exemplo n.º 4
0
 /// <summary>
 /// cancels the popup
 /// </summary>
 public virtual void ExecuteCancel()
 {
     if (!Interactable)
     {
         return;
     }
     Interactable = false;
     CancelEvent?.Invoke();
     Destroy();
 }
Exemplo n.º 5
0
 private void GridWindow_OnMouseUp(object sender, MouseButtonEventArgs e)
 {
     if (okImageState == ImageState.Focus)
     {
         OkEvent?.Invoke(sender, new OkEventArgs());
     }
     else if (cancelImageState == ImageState.Focus)
     {
         CancelEvent?.Invoke(sender, new OkEventArgs());
     }
 }
Exemplo n.º 6
0
        private async void DownLoadExtraPic(DetailMovie dm)
        {
            List <string> urlList = dm.extraimageurl?.Split(';').Where(arg => arg.IsProperUrl()).ToList();
            bool          dlimageSuccess = false; string cookies = "";

            for (int i = 0; i < urlList.Count(); i++)
            {
                HttpStatusCode sc = HttpStatusCode.Forbidden;
                if (cts.IsCancellationRequested)
                {
                    CancelEvent?.Invoke(this, EventArgs.Empty); break;
                }
                string filepath = "";
                filepath = BasePicPath + "ExtraPic\\" + dm.id + "\\" + Path.GetFileName(new Uri(urlList[i]).LocalPath);
                if (!File.Exists(filepath))
                {
                    (dlimageSuccess, cookies) = await Task.Run(() => { return(MyNet.DownLoadImage(urlList[i], ImageType.ExtraImage, dm.id, Cookie: cookies, callback: (statuscode) => { sc = (HttpStatusCode)statuscode; })); });

                    if (dlimageSuccess)
                    {
                        ExtraImageDownLoadCompleted?.Invoke(this, new MessageCallBackEventArgs(filepath));
                        if (urlList[i].IndexOf("dmm") > 0)
                        {
                            Thread.Sleep(Delay.MEDIUM);
                        }
                        else
                        {
                            Thread.Sleep(Delay.SHORT_3);
                        }
                    }
                    else
                    {
                        Logger.LogN($" {Jvedio.Language.Resources.Preview} {i + 1} {Jvedio.Language.Resources.Message_Fail}:{urlList[i]}, {Jvedio.Language.Resources.Reason} : {sc.ToStatusMessage()}");
                        MessageCallBack?.Invoke(this, new MessageCallBackEventArgs($" {Jvedio.Language.Resources.Preview} {i + 1} {Jvedio.Language.Resources.Message_Fail},{Jvedio.Language.Resources.Reason} :{sc.ToStatusMessage()} ,{Jvedio.Language.Resources.Message_ViewLog}"));
                    }
                }
                lock (lockobject) Value += 1;
                InfoUpdate?.Invoke(this, new DetailMovieEventArgs()
                {
                    DetailMovie = dm, value = Value, maximum = Maximum
                });
            }
            lock (lockobject) Value = Maximum;
            InfoUpdate?.Invoke(this, new DetailMovieEventArgs()
            {
                DetailMovie = dm, value = Value, maximum = Maximum
            });
            IsDownLoading = false;
        }
Exemplo n.º 7
0
        private async void DownLoadExtraPic(DetailMovie dm)
        {
            List <string> urlList = new List <string>();

            foreach (var item in dm.extraimageurl?.Split(';'))
            {
                if (!string.IsNullOrEmpty(item))
                {
                    urlList.Add(item);
                }
            }
            bool dlimageSuccess = false; string cookies = "";

            for (int i = 0; i < urlList.Count(); i++)
            {
                if (cts.IsCancellationRequested)
                {
                    CancelEvent?.Invoke(this, EventArgs.Empty); break;
                }
                string filepath = "";
                if (urlList[i].Length > 0)
                {
                    filepath = StaticVariable.BasePicPath + "ExtraPic\\" + dm.id + "\\" + Path.GetFileName(new Uri(urlList[i]).LocalPath);
                    if (!File.Exists(filepath))
                    {
                        (dlimageSuccess, cookies) = await Task.Run(() => { return(Net.DownLoadImage(urlList[i], ImageType.ExtraImage, dm.id, Cookie: cookies)); });

                        if (dlimageSuccess)
                        {
                            Thread.Sleep(1500);
                        }
                    }
                }
                lock (lockobject) Value += 1;
                InfoUpdate?.Invoke(this, new DetailMovieEventArgs()
                {
                    DetailMovie = dm, value = Value, maximum = Maximum
                });
            }
            lock (lockobject) Value = Maximum;
            InfoUpdate?.Invoke(this, new DetailMovieEventArgs()
            {
                DetailMovie = dm, value = Value, maximum = Maximum
            });
            IsDownLoading = false;
        }
Exemplo n.º 8
0
 public FFMpegArgumentProcessor CancellableThrough(out Action cancel, int timeout = 0)
 {
     cancel = () => CancelEvent?.Invoke(this, timeout);
     return(this);
 }
Exemplo n.º 9
0
 private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     CancelEvent?.Invoke(this, new EventArgs());
 }
Exemplo n.º 10
0
 public virtual void OnCancel()
 {
     Hide();
     CancelEvent?.Invoke();
 }
Exemplo n.º 11
0
 public FFMpegArgumentProcessor CancellableThrough(out Action cancel)
 {
     cancel = () => CancelEvent?.Invoke(this, EventArgs.Empty);
     return(this);
 }
 private void BackClicked(object o, EventArgs e)
 {
     CancelEvent?.Invoke();
 }
Exemplo n.º 13
0
 private void CancelCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     CancelEvent?.Invoke();
 }
Exemplo n.º 14
0
 public FFMpegArgumentProcessor CancellableThrough(CancellationToken token, int timeout = 0)
 {
     token.Register(() => CancelEvent?.Invoke(this, timeout));
     return(this);
 }
Exemplo n.º 15
0
 private void cancelButton_Click(object sender, EventArgs e)
 {
     CancelEvent?.Invoke();
     ResetControls();
 }
Exemplo n.º 16
0
 public void RunCancel() => CancelEvent?.Invoke();
Exemplo n.º 17
0
 private void BtnCancel_Click(object sender, EventArgs e)
 {
     CancelEvent?.Invoke(new TabTransferDataModel("Cancel"), null);
 }
Exemplo n.º 18
0
 public void FireCancelEvent()
 {
     // we don't care about parameters since we're just closing the window on cancel
     CancelEvent?.Invoke(this, null);
 }
Exemplo n.º 19
0
 public virtual void CancelClick()
 {
     CancelEvent?.Invoke();
 }
Exemplo n.º 20
0
 void buttonCancel_Click(object sender, EventArgs e)
 {
     CancelEvent?.Invoke(this, new EventArgs());
     Close();
 }
Exemplo n.º 21
0
 public void Cancel()
 {
     CancelEvent?.Invoke();
     Activate(false);
     turnBtn.gameObject.SetActive(true);
 }