Exemplo n.º 1
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (CancelEvent != null)
     {
         CancelEvent.Invoke();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// The constructor.
 /// </summary>
 /// <param name="param">Specifies the creation parameters.</param>
 /// <param name="log">Specifies the output log.</param>
 /// <param name="evtCancel">Specfies the cancel event used to cancel the process.</param>
 public VOCDataLoader(VOCDataParameters param, Log log, CancelEvent evtCancel)
 {
     m_param     = param;
     m_log       = log;
     m_evtCancel = evtCancel;
     m_evtCancel.Reset();
 }
Exemplo n.º 3
0
        protected override async Task DoAction()
        {
            Label = DownloadingLabel;
            try
            {
                if (CancelEvent.WaitOne(0))
                {
                    return;
                }

                Downloader downloader = new Downloader(CancelEvent);
                downloader.DownloadProgress += OnDownloadProgress;

                HttpFileInfo fileInfo = _latestTranslationInfo.Value;
                Maximum = fileInfo.ContentLength;

                await downloader.Download(fileInfo.Url, PatcherService.ArchiveFileName);

                if (fileInfo.LastModified != null)
                {
                    File.SetLastWriteTime(PatcherService.ArchiveFileName, fileInfo.LastModified.Value);
                }

                SubLabel = null;
            }
            finally
            {
                Label = DownloadLabel;
            }
        }
Exemplo n.º 4
0
        public void HandleCancelJobs(CancelEvent <IEnumerable <Job> > evt)
        {
            IEnumerable <Job> jobs = evt.Object;

            if (jobs == null || !jobs.Any())
            {
                CancelCurrentJob();
                evt.ReturnValue = true;
            }
            else
            {
                foreach (Job job in jobs)
                {
                    if (job == ViewModel.CurrentJob.Model)
                    {
                        CancelCurrentJob();
                    }
                    else
                    {
                        job.State = JobState.Cancelled;
                    }
                }
                evt.ReturnValue = true;
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// The constructor.
 /// </summary>
 /// <param name="fmt">Specifies the WaveFormat.</param>
 /// <param name="rgrgSamples">Specifies the WAV file frequency samples.</param>
 /// <param name="log">Specifies the output log.</param>
 /// <param name="evtCancel">Specifies the event used to cancel processes.</param>
 public WAVProcessor(WaveFormat fmt, List <double[]> rgrgSamples, Log log, CancelEvent evtCancel)
 {
     m_fmt         = fmt;
     m_rgrgSamples = rgrgSamples;
     m_log         = log;
     m_evtCancel   = evtCancel;
 }
Exemplo n.º 6
0
        private async Task<string> DownloadLatestPatcher()
        {
            Label = DownloadingLabel;
            try
            {
                if (CancelEvent.WaitOne(0))
                    return null;

                Downloader downloader = new Downloader(CancelEvent);
                downloader.DownloadProgress += OnDownloadProgress;

                HttpFileInfo latest = await GetLatestPatcherUrl(downloader);
                if (latest == null)
                    throw new Exception("Не удалось найти свежую версию программы установки. Проверьте файл конфигурации.");

                Maximum = latest.ContentLength;

                string filePath = Path.GetTempFileName();
                await downloader.Download(latest.Url, filePath);
                return filePath;
            }
            finally
            {
                Label = InstallLabel;
            }
        }
Exemplo n.º 7
0
 private string ComputeHash(CancelEvent eventEntry)
 {
     return(GetSha256Hash(SHA256.Create(), (eventEntry.TokenGet + eventEntry.AmountGet +
                                            eventEntry.TokenGive + eventEntry.AmountGive +
                                            eventEntry.Expires + eventEntry.Nonce +
                                            eventEntry.User).ToLowerInvariant()));
 }
        public void TestAlexNetCiFar()
        {
            CancelEvent   evtCancel = new CancelEvent();
            SettingsCaffe settings  = new SettingsCaffe();

            settings.ImageDbLoadMethod          = IMAGEDB_LOAD_METHOD.LOAD_ON_DEMAND;
            settings.EnableRandomInputSelection = true;
            settings.GpuIds = getGpuIds();

            Trace.WriteLine("Running TestAlexNetCiFar on GPU " + settings.GpuIds);

            ProjectEx          p    = getProject();
            MyCaffeControl <T> ctrl = new MyCaffeControl <T>(settings, m_log, evtCancel);

            try
            {
                ctrl.Load(Phase.TRAIN, p);
                ctrl.OnTrainingIteration += ctrl_OnTrainingIteration;
                ctrl.Train();
            }
            catch (Exception excpt)
            {
                throw excpt;
            }
            finally
            {
                ctrl.Dispose();
            }
        }
Exemplo n.º 9
0
        public TestLSTMSimpleLayer(Log log, CancelEvent evtCancel, string strParams)
        {
            m_log       = log;
            m_evtCancel = evtCancel;
            m_strParams = strParams;

            if (m_strParams != null)
            {
                string[] rgstr = m_strParams.Split();
                if (rgstr.Length > 4 && rgstr[4].Trim(',') != "T")
                {
                    m_bDisableDouble = true;
                }

                if (rgstr.Length > 5 && rgstr[5].Trim(',') != "T")
                {
                    m_bDisableFloat = true;
                }

                if (rgstr.Length > 6 && rgstr[6].Trim(',') != "S")
                {
                    m_bShortModel = false;
                }
            }
        }
Exemplo n.º 10
0
        public void TestCreateTrainingModel()
        {
            ModelBuilder builder = create();

            NetParameter net_param = builder.CreateModel();
            RawProto     proto     = net_param.ToProto("root");
            string       strNet    = proto.ToString();

            RawProto     proto2     = RawProto.Parse(strNet);
            NetParameter net_param2 = NetParameter.FromProto(proto2);

            m_log.CHECK(net_param2.Compare(net_param), "The two net parameters should be the same!");

            // verify creating the model.
            SolverParameter solver      = builder.CreateSolver();
            RawProto        protoSolver = solver.ToProto("root");
            string          strSolver   = protoSolver.ToString();

            SettingsCaffe      settings  = new SettingsCaffe();
            CancelEvent        evtCancel = new CancelEvent();
            MyCaffeControl <T> mycaffe   = new MyCaffeControl <T>(settings, m_log, evtCancel);

            save(strNet, strSolver, false);

            //            mycaffe.LoadLite(Phase.TRAIN, strSolver, strNet, null);
            mycaffe.Dispose();
        }
Exemplo n.º 11
0
 private void State_CancelEvent()
 {
     if (CancelEvent == null || CancelEvent.Invoke())
     {
         Dispose();
     }
 }
Exemplo n.º 12
0
        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="cuda">Specifies the instance of CudaDnn to use.</param>
        /// <param name="log">Specifies the output log.</param>
        /// <param name="evtCancel">Specifies the cancel event used to abort processing.</param>
        /// <param name="strModelType">Specifies the model type: 'vgg19', 'vgg16'</param>
        /// <param name="strModel">Specifies the network model to use.</param>
        /// <param name="rgWeights">Optionally, specifies the weights to use (or <i>null</i> to ignore).</param>
        /// <param name="bCaffeModel">Specifies whether or not the weights are in the caffe (<i>true</i>) or mycaffe (<i>false</i>) format.</param>
        /// <param name="solverType">Optionally, specifies the solver type to use (default = LBFGS).</param>
        /// <param name="dfLearningRate">Optionally, specifies the solver learning rate (default = 1.0).</param>
        public NeuralStyleTransfer(CudaDnn <T> cuda, Log log, CancelEvent evtCancel, string strModelType, string strModel, byte[] rgWeights, bool bCaffeModel, SolverParameter.SolverType solverType = SolverParameter.SolverType.LBFGS, double dfLearningRate = 1.0)
        {
            m_cuda           = cuda;
            m_log            = log;
            m_evtCancel      = evtCancel;
            m_rgWeights      = rgWeights;
            m_solverType     = solverType;
            m_dfLearningRate = dfLearningRate;

            if (m_evtCancel != null)
            {
                m_evtCancel.Reset();
            }

            RawProto proto = RawProto.Parse(strModel);

            m_param = NetParameter.FromProto(proto);

            add_input_layer(m_param);
            m_rgstrUsedLayers = load_layers(strModelType);
            prune(m_param, m_rgstrUsedLayers);
            add_gram_layers(m_param);

            m_transformationParam             = new TransformationParameter();
            m_transformationParam.color_order = (bCaffeModel) ? TransformationParameter.COLOR_ORDER.BGR : TransformationParameter.COLOR_ORDER.RGB;
            m_transformationParam.scale       = 1.0;
            m_transformationParam.mean_value  = m_rgMeanValues;

            m_persist = new PersistCaffe <T>(m_log, false);
        }
Exemplo n.º 13
0
 /// <summary>
 /// The RmsPropSolver constructor.
 /// </summary>
 /// <param name="cuda">Specifies the instance of CudaDnn to use.</param>
 /// <param name="log">Specifies the Log for output.</param>
 /// <param name="p">Specifies teh SolverParameter.</param>
 /// <param name="evtCancel">Specifies a CancelEvent used to cancel the current operation (e.g. training, testing) for which the Solver is performing.</param>
 /// <param name="evtForceSnapshot">Specifies an automatic reset event that causes the Solver to perform a Snapshot when set.</param>
 /// <param name="evtForceTest">Specifies an automatic reset event that causes teh Solver to run a testing cycle when set.</param>
 /// <param name="imgDb">Specifies the CaffeImageDatabase.</param>
 /// <param name="persist">Specifies the peristence used for loading and saving weights.</param>
 /// <param name="nSolverCount">Specifies the number of Solvers participating in a multi-GPU session.</param>
 /// <param name="nSolverRank">Specifies the rank of this Solver in a multi-GPU session.</param>
 public RmsPropSolver(CudaDnn <T> cuda, Log log, SolverParameter p, CancelEvent evtCancel, AutoResetEvent evtForceSnapshot, AutoResetEvent evtForceTest, IXImageDatabase imgDb, IXPersist <T> persist, int nSolverCount = 1, int nSolverRank = 0)
     : base(cuda, log, p, evtCancel, evtForceSnapshot, evtForceTest, imgDb, persist, nSolverCount, nSolverRank)
 {
     m_log.CHECK_EQ(0, m_param.momentum, "Momentum cannot be used with RmsProp.");
     m_log.CHECK_GE(m_param.rms_decay, 0, "rms_decay should lie between 0 and 1.");
     m_log.CHECK_LT(m_param.rms_decay, 1, "rms_decay should lie between 0 and 1.");
 }
Exemplo n.º 14
0
        private Dictionary<string, string> ReadStrings(DirectoryInfo translationDir)
        {
            String[] strings = Directory.GetFiles(Path.Combine(translationDir.FullName, "Strings"), "*.strings", SearchOption.AllDirectories);

            Dictionary<string, string> result = new Dictionary<string, string>(16000);
            Maximum = strings.Length;

            for (int i = 0; i < strings.Length; i++)
            {
                if (CancelEvent.IsSet())
                    return result;

                using (FileStream input = File.OpenRead(strings[i]))
                {
                    string name;
                    ZtrTextReader unpacker = new ZtrTextReader(input, StringsZtrFormatter.Instance);
                    ZtrFileEntry[] entries = unpacker.Read(out name);

                    foreach (ZtrFileEntry entry in entries)
                    {
                        string key = entry.Key;
                        string value = entry.Value;
                        result[key] = value;
                    }
                }
            }

            return result;
        }
Exemplo n.º 15
0
 /// <summary>
 /// The LBFGSSolver constructor.
 /// </summary>
 /// <param name="cuda">Specifies the instance of CudaDnn to use.</param>
 /// <param name="log">Specifies the Log for output.</param>
 /// <param name="p">Specifies teh SolverParameter.</param>
 /// <param name="evtCancel">Specifies a CancelEvent used to cancel the current operation (e.g. training, testing) for which the Solver is performing.</param>
 /// <param name="evtForceSnapshot">Specifies an automatic reset event that causes the Solver to perform a Snapshot when set.</param>
 /// <param name="evtForceTest">Specifies an automatic reset event that causes teh Solver to run a testing cycle when set.</param>
 /// <param name="imgDb">Specifies the CaffeImageDatabase.</param>
 /// <param name="persist">Specifies the peristence used for loading and saving weights.</param>
 /// <param name="nSolverCount">Specifies the number of Solvers participating in a multi-GPU session.</param>
 /// <param name="nSolverRank">Specifies the rank of this Solver in a multi-GPU session.</param>
 public LBFGSSolver(CudaDnn <T> cuda, Log log, SolverParameter p, CancelEvent evtCancel, AutoResetEvent evtForceSnapshot, AutoResetEvent evtForceTest, IXImageDatabase imgDb, IXPersist <T> persist, int nSolverCount = 1, int nSolverRank = 0)
     : base(cuda, log, p, evtCancel, evtForceSnapshot, evtForceTest, imgDb, persist, nSolverCount, nSolverRank)
 {
     m_tZero     = (T)Convert.ChangeType(0, typeof(T));
     m_tOne      = (T)Convert.ChangeType(1, typeof(T));
     m_tMinusOne = (T)Convert.ChangeType(-1, typeof(T));
     PreSolve();
 }
Exemplo n.º 16
0
        public async Task <ApiResult> Cancel(CancelEvent request)
        {
            request.CompanyUid = await _currentCompanyProvider.GetCompanyUid();

            request.UserUid = _currentUserProvider.GetUserUid();

            return(await _mediator.Send(request));
        }
Exemplo n.º 17
0
 /// <summary>
 /// The LBFGSSolver constructor.
 /// </summary>
 /// <param name="cuda">Specifies the instance of CudaDnn to use.</param>
 /// <param name="log">Specifies the Log for output.</param>
 /// <param name="p">Specifies teh SolverParameter.</param>
 /// <param name="evtCancel">Specifies a CancelEvent used to cancel the current operation (e.g. training, testing) for which the Solver is performing.</param>
 /// <param name="evtForceSnapshot">Specifies an automatic reset event that causes the Solver to perform a Snapshot when set.</param>
 /// <param name="evtForceTest">Specifies an automatic reset event that causes teh Solver to run a testing cycle when set.</param>
 /// <param name="imgDb">Specifies the MyCaffeImageDatabase.</param>
 /// <param name="persist">Specifies the peristence used for loading and saving weights.</param>
 /// <param name="nSolverCount">Specifies the number of Solvers participating in a multi-GPU session.</param>
 /// <param name="nSolverRank">Specifies the rank of this Solver in a multi-GPU session.</param>
 /// <param name="shareNet">Optionally, specifies the net to share when creating the training network (default = null, meaning no share net is used).</param>
 /// <param name="getws">Optionally, specifies the handler for getting the workspace.</param>
 /// <param name="setws">Optionally, specifies the handler for setting the workspace.</param>
 public LBFGSSolver(CudaDnn <T> cuda, Log log, SolverParameter p, CancelEvent evtCancel, AutoResetEvent evtForceSnapshot, AutoResetEvent evtForceTest, IXImageDatabaseBase imgDb, IXPersist <T> persist, int nSolverCount = 1, int nSolverRank = 0, Net <T> shareNet = null, onGetWorkspace getws = null, onSetWorkspace setws = null)
     : base(cuda, log, p, evtCancel, evtForceSnapshot, evtForceTest, imgDb, persist, nSolverCount, nSolverRank, shareNet, getws, setws)
 {
     m_tZero     = (T)Convert.ChangeType(0, typeof(T));
     m_tOne      = (T)Convert.ChangeType(1, typeof(T));
     m_tMinusOne = (T)Convert.ChangeType(-1, typeof(T));
     PreSolve();
 }
Exemplo n.º 18
0
 void OnCancelEvent(CancelEvent e)
 {
     if (!Enabled)
     {
         Trace.Script("Disabled!", this);
         return;
     }
     this.Cancel();
 }
Exemplo n.º 19
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.º 20
0
 void OnCancelEvent(CancelEvent e)
 {
     if (!Enabled)
     {
         StratusDebug.Log("Disabled!", this);
         return;
     }
     this.Cancel();
 }
Exemplo n.º 21
0
 /// <summary>
 /// The constructor.
 /// </summary>
 /// <param name="nIdx">Specifies the index of the thread.</param>
 /// <param name="mycaffe">Specifies the MyCaffeControl used.</param>
 /// <param name="log">Specifies the output log to use.</param>
 /// <param name="evtCancel">Specifies the cancel event.</param>
 /// <param name="bReset">Specifies to reset the environment.</param>
 /// <param name="nAction">Specifies the action to run.  If less than zero this parameter is ignored.</param>
 /// <param name="bAllowUi">Optionally, specifies whether or not to allow the user interface.</param>
 public GetDataArgs(int nIdx, Component mycaffe, Log log, CancelEvent evtCancel, bool bReset, int nAction = -1, bool bAllowUi = true)
 {
     m_nIndex    = nIdx;
     m_nAction   = nAction;
     m_caffe     = mycaffe;
     m_log       = log;
     m_evtCancel = evtCancel;
     m_bReset    = bReset;
 }
Exemplo n.º 22
0
 /// <summary>
 /// cancels the popup
 /// </summary>
 public virtual void ExecuteCancel()
 {
     if (!Interactable)
     {
         return;
     }
     Interactable = false;
     CancelEvent?.Invoke();
     Destroy();
 }
Exemplo n.º 23
0
 /// <summary>
 /// The ActionStateArgs constructor.
 /// </summary>
 /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
 /// <param name="log">Specifies the Log for output.</param>
 /// <param name="evtCancel">Specifies the CancelEvent that when Set signals to DoWork that it should terminate.</param>
 /// <param name="nDeviceID">Optionally, specifies the DeviceID.</param>
 /// <param name="arg">Optionally, specifies an argument defined by the caller.</param>
 /// <param name="nInitialDelay">Optionally, specifies an initial delay for the thread in ms. (default = 0).</param>
 public ActionStateArgs(CudaDnn <T> cuda, Log log, CancelEvent evtCancel, int nDeviceID = 0, object arg = null, int nInitialDelay = 0)
     : base()
 {
     m_log           = log;
     m_cuda          = cuda;
     m_evtCancel     = evtCancel;
     m_nDeviceID     = nDeviceID;
     m_arg           = arg;
     m_nInitialDelay = nInitialDelay;
 }
Exemplo n.º 24
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());
     }
 }
        /// <summary>
        /// The constructor.
        /// </summary>
        /// <param name="param">Specifies the creation parameters.</param>
        /// <param name="log">Specifies the output log used to show status updates.</param>
        /// <param name="evtCancel">Specifies the cancel event used to abort the creation process.</param>
        public MnistDataLoader(MnistDataParameters param, Log log, CancelEvent evtCancel)
        {
            m_extractor             = new MnistDataLoaderLite(Path.GetDirectoryName(param.TrainImagesFile));
            m_extractor.OnProgress += m_extractor_OnProgress;
            m_extractor.OnError    += m_extractor_OnError;

            m_param     = param;
            m_log       = log;
            m_evtCancel = evtCancel;
            m_evtCancel.Reset();
        }
Exemplo n.º 26
0
        /// <summary>
        /// The DataLayer constructor.
        /// </summary>
        /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
        /// <param name="log">Specifies the Log for output.</param>
        /// <param name="p">Specifies the LayerParameter with the batchdata_param.</param>
        /// <param name="db">Specifies the external database to use.</param>
        /// <param name="evtCancel">Specifies the CancelEvent used to cancel any pre-fetching operations.</param>
        /// <param name="fnSet">Specifies the delegate used to set the input data.</param>
        public BatchDataLayer(CudaDnn <T> cuda, Log log, LayerParameter p, IXImageDatabase db, CancelEvent evtCancel, TransferInput.fnSetInputData fnSet)
            : base(cuda, log, p, db)
        {
            log.CHECK(p.type == LayerParameter.LayerType.BATCHDATA, "The layer type should be BATCHDATA.");

            m_type                   = LayerParameter.LayerType.BATCHDATA;
            m_evtCancel              = evtCancel;
            m_fnSetInput             = fnSet;
            m_batch                  = new layers.Batch <T>(m_cuda, m_log);
            m_internalThread         = new common.InternalThread <T>();
            m_internalThread.DoWork += m_internalThread_DoWork;
        }
Exemplo n.º 27
0
        /// <summary>
        /// The ModelDataLayer constructor.
        /// </summary>
        /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
        /// <param name="log">Specifies the Log for output.</param>
        /// <param name="p">
        /// Provides ModelDataParameter model_data_param with options:
        ///  - source.  The data source(s) where the source is the data input table who's RawImageResults table contains the data for training.
        ///
        ///  - batch_size.  The batch size (currently only 1 supported).
        ///
        ///  - time_steps.  The maximum number of time steps.
        ///
        ///  - input_dim.  The input dimension of the encoder input.
        ///
        ///  - sample_size.  The number of samples to load for training.
        ///
        ///  - shuffle.  Whether or not to shuffle the data.
        /// </param>
        /// <param name="db">Specifies the external database to use.</param>
        /// <param name="evtCancel">Specifies the CancelEvent used to cancel any pre-fetching operations.</param>
        public ModelDataLayer(CudaDnn <T> cuda, Log log, LayerParameter p, IXImageDatabaseBase db, CancelEvent evtCancel)
            : base(cuda, log, p)
        {
            m_db = db as IXImageDatabase2;
            if (m_db == null)
            {
                throw new Exception("The ModelDataLayer requires the ImageDatabase V2 or higher.");
            }

            m_evtCancel = evtCancel;
            m_type      = LayerParameter.LayerType.MODEL_DATA;
        }
Exemplo n.º 28
0
        private DirectoryInfo ExtractZipToTempFolder(string zipPath)
        {
            using (ZipArchive zipFile = ZipFile.OpenRead(zipPath))
            {
                if (CancelEvent.IsSet())
                    return null;

                DirectoryInfo dir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString()));
                zipFile.ExtractToDirectory(dir.FullName);

                return dir;
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// The RecurrentLayer constructor.
        /// </summary>
        /// <param name="cuda">Specifies the CudaDnn connection to Cuda.</param>
        /// <param name="log">Specifies the Log for output.</param>
        /// <param name="p">Specifies the LayerParameter of type LSTM or RNN.
        /// </param>
        /// <param name="evtCancel">Specifies the CancelEvent used to cancel training operations.</param>
        public RecurrentLayer(CudaDnn <T> cuda, Log log, LayerParameter p, CancelEvent evtCancel)
            : base(cuda, log, p)
        {
            m_evtCancel = evtCancel;

            if (p.type == LayerParameter.LayerType.LSTM)
            {
                m_rnnMode = RNN_MODE.LSTM;
            }
            else
            {
                m_rnnMode = RNN_MODE.RNN_RELU;
            }
        }
Exemplo n.º 30
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;
        }