Exemplo n.º 1
0
        public void Start(Define tmp, ref ProgressBar prog, Dispatcher dp, string call)
        {
            //token = new CancellationTokenSource();
            theCall = call;
            //if (temp == null && prg == null && this.dp == null)
            //{
            //temp = (from k in d.Defines where tmp.Id == k.Id select k).ToList()[0];
            temp             = tmp;
            this.server      = temp.Server;
            this.server_name = temp.Server_Name;
            this.path        = temp.File_Path;
            if (temp.File_Size.HasValue)
            {
                this.size = temp.File_Size.Value;
            }
            if (temp.Last_Modified.HasValue)
            {
                this.lastModifiedDate = temp.Last_Modified.Value;
            }
            this.dp = dp;
            prg     = prog;
            //}


            //Dispatcher.CurrentDispatcher.BeginInvoke((Action)(() => { MainWindow.progressBars[def.Id].Visibility = Visibility.Hidden; }));
            d.SubmitChanges();

            try
            {
                invokeTask();// to initiate task1
                started = true;
                task1.Start();
            }
            catch (Exception g) { }
        }
Exemplo n.º 2
0
        public void TaskStart(Define tmp)
        {
            theCall          = "external";
            token            = new CancellationTokenSource();
            temp             = tmp;
            this.server      = temp.Server;
            this.server_name = temp.Server_Name;
            this.path        = temp.File_Path;
            if (temp.File_Size.HasValue)
            {
                this.size = temp.File_Size.Value;
            }
            if (temp.Last_Modified.HasValue)
            {
                this.lastModifiedDate = temp.Last_Modified.Value;
            }
            //}

            d.SubmitChanges();

            try
            {
                started = true;
                invokeTask();// to initiate task1

                //task1.Start();
            }
            catch (Exception g) { }
        }
Exemplo n.º 3
0
 partial void UpdateDefine(Define instance);
Exemplo n.º 4
0
 partial void DeleteDefine(Define instance);
Exemplo n.º 5
0
 partial void InsertDefine(Define instance);