Esempio n. 1
0
        public CopyProgressInfo(long totalFileSize, long totalBytesTransferred, long streamSize, long streamBytesTransferred, uint streamNumber, CopyEvent copyEvent)
        {
            this.TotalFileSize = totalFileSize;

            this.TotalBytesTransferred  = totalBytesTransferred;
            this.StreamSize             = streamSize;
            this.StreamBytesTransferred = streamBytesTransferred;
            this.StreamNumber           = streamNumber;
            this.CopyEvent = copyEvent;
        }
        public void showCopyEvent(List <DataRow> listDr)
        {
            int removeIndex = Int32.Parse(iSubjectEventScheduler.cmbSubjectList.SelectedIndex.ToString());

            if (removeIndex != -1)
            {
                DataTable copyDt = subjectList.Copy();
                copyDt.Rows.RemoveAt(removeIndex);
                CopyEvent cE = new CopyEvent(copyDt);
                cE.ShowDialog();
                int selctedId = 0;
                if (cE.DialogResult == DialogResult.OK)
                {
                    selctedId = cE.selectedId;
                    try
                    {
                        foreach (DataRow drStudies in listDr)
                        {
                            int studyDetailsId = Int32.Parse(drStudies["study_details_id"].ToString());


                            string studyDetailsDescription    = drStudies["Description"].ToString();
                            string studyDetailsSchedDate      = drStudies["Scheduled Date"].ToString();
                            string strBuildDate               = buildDate(DateTime.Parse(studyDetailsSchedDate));
                            int    studyDetailsDaysAccomplish =
                                Int32.Parse(drStudies["No of Days To Accomplish"].ToString());
                            int studyDetailsNoSessions = Int32.Parse(drStudies["No of Sessions Per Day"].ToString());
                            int type =
                                Int32.Parse(drStudies["_type"].ToString());

                            DataTable dtNewScheduledStudy = model.AddEventToSubject(selctedId,
                                                                                    strBuildDate, studyDetailsDescription, type, studyDetailsDaysAccomplish, studyDetailsNoSessions);

                            if (dtNewScheduledStudy.Rows.Count > 0)
                            {
                                int newScheduledId = Int32.Parse(dtNewScheduledStudy.Rows[0]["study_details_id"].ToString());

                                DataTable dtProgress = model.GettStudyProgress(studyDetailsId);
                                foreach (DataRow dr in dtProgress.Rows)
                                {
                                    string scheduleTime = dr["Scheduled Time"].ToString();
                                    model.InsertStudyProgress(newScheduledId, scheduleTime);
                                }
                            }
                        }

                        MessageBox.Show("Success");
                    }

                    catch (Exception e)
                    {
                    }
                }
            }
        }
Esempio n. 3
0
        static CopyCallbackResult CopyCallbackProc(long totalFileSize, long totalBytesTransferred, long streamSize, long streamBytesTransferred, uint streamNumber, CopyEvent callbackReason, IntPtr sourceFileHandle, IntPtr destinationFileHandle, IntPtr pData)
        {
            IProgress <CopyProgressInfo> progress = null;

            if (pData != IntPtr.Zero)
            {
                progress = (IProgress <CopyProgressInfo>)GCHandle.FromIntPtr(pData).Target;
                progress.Report(new CopyProgressInfo(totalFileSize, totalBytesTransferred, streamSize, streamBytesTransferred, streamNumber, callbackReason));
            }
            return(CopyCallbackResult.Continue);
        }
Esempio n. 4
0
 /// <summary>
 /// Closes the window and raises the file copy event
 /// </summary>
 public override void OnEnter()
 {
     Close();
     CopyEvent?.Invoke(this, source, Destination.Value, Move);
 }
Esempio n. 5
0
 private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CopyEvent.Invoke(sender, e);
 }
Esempio n. 6
0
 private void CopyMN_Click(object sender, EventArgs e)
 {
     CopyEvent.Invoke(sender, e);
 }
Esempio n. 7
0
 public void CopyTL_Click(object sender, EventArgs e)
 {
     CopyEvent.Invoke(sender, e);
 }