Example #1
0
        /// <summary>
        /// Handles the MoveComplete event of the underlying Recordset, triggering the control's  MoveComplete event.
        /// </summary>
        /// <param name="eventSender">The object which rises the event.</param>
        /// <param name="e">The arguments of the event.</param>
        void Recordset_MoveComplete(object eventSender, MoveCompleteEventArgs e)
        {
            EventStatusEnum status = e.Status;

            OnMoveComplete(e.Reason, ref status, e.Errors);
            e.Status = status;
        }
Example #2
0
 private void cfind_MoveComplete(object sender, MoveCompleteEventArgs e)
 {
     for (var i = 0; i < e.Datasets.Count; i++)
     {
         Console.Out.WriteLine("begin ds save");
         DicomDataSet ds = e.Datasets[i];
         ds.Save(workPath + "\\" + i + ".dcm",
                 DicomDataSetSaveFlags.None);
         Console.Out.WriteLine("end save");
     }
     //获取完成!
     if (queue.Count <= 0)
     {
         DoCreateDicomDirectory();
         //this.Cursor = Cursors.Default;
         MessageBox.Show("下载完成!");
     }
     if (th == null || (th != null && !th.IsAlive))
     {
         th = new Thread(() =>
         {
             Console.Out.WriteLine("th start!");
             cfind.workThread.Join();
             if (queue.Count > 0)
             {
                 Console.Out.WriteLine("send move!");
                 SendMoveSeries();
             }
         });
     }
     th.Start();
 }
Example #3
0
 /// <summary>
 /// OnMoveComplete event is called after the current position in the ADORecordsetHelper changes.
 /// </summary>
 /// <param name="reason">The reason of the change.</param>
 /// <param name="status">A EventStatusEnum value that indicates the state of the ADORecordsetHelper in the moment that the event rose.</param>
 /// <param name="errors">Array containing all the errors occurred during the field change.</param>
 protected void OnMoveComplete(EventReasonEnum reason, ref EventStatusEnum status, string[] errors)
 {
     if (MoveComplete != null)
     {
         MoveCompleteEventArgs args = new MoveCompleteEventArgs(reason, errors, status);
         MoveComplete(this, args);
         status = args.Status;
     }
 }
Example #4
0
 /// <summary>
 /// Delegate to perform the Move operation after a Move event is executed in the data source. Normally, it executes
 /// the Bind method for Bindings property to syncronize the bindings with the data source.
 /// </summary>
 /// <param name="sender">Record set being moved</param>
 /// <param name="e">Move event args</param>
 public void Recordset_MoveComplete(Object sender, MoveCompleteEventArgs e)
 {
     //TODO: how to get View containing this ADODC
     foreach (IViewModel v in ViewManager.LoadedViews)
     {
         var dataBindingsPi = v.GetType().GetProperty("DataBindings");
         if (dataBindingsPi != null)
         {
             var dataBindings = dataBindingsPi.GetValue(v, null);
             var bindMi       = dataBindings.GetType().GetMethod("Bind");
             bindMi.Invoke(dataBindings, new[] { v, sender });
         }
     }
 }
Example #5
0
      private void cfind_MoveComplete(object sender, MoveCompleteEventArgs e)
      {
         if(InvokeRequired)
         {
            Invoke(new MoveCompleteEventHandler(cfind_MoveComplete), sender, e);
         }
         else
         {
            ImageList.BeginUpdate();
            foreach(DicomDataSet ds in e.Datasets)
            {
               DicomElement element;

               try
               {
                  element = ds.FindFirstElement(null, DemoDicomTags.PixelData, true);
                  if(element == null)
                     continue;

                  for(int i = 0; i < ds.GetImageCount(element); i++)
                  {
                     RasterImage image;
                     DicomImageInformation info = ds.GetImageInformation(element, i);

                     image = ds.GetImage(element, i, 0, info.IsGray ? RasterByteOrder.Gray : RasterByteOrder.Rgb, 
                                         DicomGetImageFlags.AutoApplyModalityLut |
                                         DicomGetImageFlags.AutoApplyVoiLut      | 
                                         DicomGetImageFlags.AllowRangeExpansion);
                     if(image != null)
                     {
                        RasterImageListItem item = new RasterImageListItem();

                        item.Text = "";
                        item.Image = image;
                        ImageList.Items.Insert(ImageList.Items.Count, item);
                     }
                  }
               }
               catch(DicomException de)
               {
                  StatusEventArgs eventArg = new StatusEventArgs();

                  eventArg._Error = de.Code;
                  eventArg._Type = StatusType.Error;
                  cfind_Status(this, eventArg);
               }
            }
            if(ImageList.Items.Count > 0)
            {
               ImageList.Items[0].Selected = true;
               SetImage(ImageList.SelectedItems[0]);
            }
            ImageList.EndUpdate();
         }

      }
Example #6
0
        private void cfind_MoveComplete(object sender, MoveCompleteEventArgs e)
        {
           

        }