예제 #1
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (CancelEvent != null)
     {
         CancelEvent.Invoke();
     }
 }
예제 #2
0
 private void State_CancelEvent()
 {
     if (CancelEvent == null || CancelEvent.Invoke())
     {
         Dispose();
     }
 }
예제 #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();
 }
예제 #4
0
 /// <summary>
 /// cancels the popup
 /// </summary>
 public virtual void ExecuteCancel()
 {
     if (!Interactable)
     {
         return;
     }
     Interactable = false;
     CancelEvent?.Invoke();
     Destroy();
 }
예제 #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());
     }
 }
예제 #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;
        }
예제 #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;
        }
예제 #8
0
 public FFMpegArgumentProcessor CancellableThrough(out Action cancel, int timeout = 0)
 {
     cancel = () => CancelEvent?.Invoke(this, timeout);
     return(this);
 }
예제 #9
0
 private void CancelButton_Click(object sender, RoutedEventArgs e)
 {
     CancelEvent?.Invoke(this, new EventArgs());
 }
예제 #10
0
 public virtual void OnCancel()
 {
     Hide();
     CancelEvent?.Invoke();
 }
예제 #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();
 }
예제 #13
0
 private void CancelCommandExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     CancelEvent?.Invoke();
 }
예제 #14
0
 public FFMpegArgumentProcessor CancellableThrough(CancellationToken token, int timeout = 0)
 {
     token.Register(() => CancelEvent?.Invoke(this, timeout));
     return(this);
 }
예제 #15
0
 private void cancelButton_Click(object sender, EventArgs e)
 {
     CancelEvent?.Invoke();
     ResetControls();
 }
예제 #16
0
 public void RunCancel() => CancelEvent?.Invoke();
예제 #17
0
 private void BtnCancel_Click(object sender, EventArgs e)
 {
     CancelEvent?.Invoke(new TabTransferDataModel("Cancel"), null);
 }
예제 #18
0
 public void FireCancelEvent()
 {
     // we don't care about parameters since we're just closing the window on cancel
     CancelEvent?.Invoke(this, null);
 }
예제 #19
0
 public virtual void CancelClick()
 {
     CancelEvent?.Invoke();
 }
예제 #20
0
 void buttonCancel_Click(object sender, EventArgs e)
 {
     CancelEvent?.Invoke(this, new EventArgs());
     Close();
 }
예제 #21
0
 public void Cancel()
 {
     CancelEvent?.Invoke();
     Activate(false);
     turnBtn.gameObject.SetActive(true);
 }