Exemplo n.º 1
0
 private TileItem CreateTileItem(TIS.Model.Internal.Document.DocNode node)
 {
     try
     {
         TileItem ti = new TileItem();
         ti.BackgroundImageAlignment = TileItemContentAlignment.MiddleCenter;
         ti.BackgroundImageScaleMode = TileItemImageScaleMode.ZoomInside;
         if (node.Document == null)
             ti.IsLarge = true;
         if (node.ImageIndex >= 0 && node.ImageIndex < iclExtraLarge.Images.Count)
             ti.BackgroundImage = iclExtraLarge.Images[node.ImageIndex];
         else
             if (node.Document != null)
             {
                 RegistryKey oHKCR = null;
                 RegistryKey oProgID = null;
                 RegistryKey oOpenCmd = null;
                 string StrProgID = null;
                 string StrExe = null;
                 try
                 {
                     oHKCR = Registry.ClassesRoot;
                     oProgID = oHKCR.OpenSubKey(node.Document.Name.Substring(node.Document.Name.LastIndexOf('.')));
                     StrProgID = oProgID.GetValue(null).ToString();
                     oProgID.Close();
                     oOpenCmd = oHKCR.OpenSubKey(StrProgID + @"\shell\open\command");
                     StrExe = oOpenCmd.GetValue(null).ToString();
                     oOpenCmd.Close();
                     int TempPos = StrExe.IndexOf(" %1");
                     if (TempPos > 0)
                     {
                         StrExe = StrExe.Substring(0, TempPos);
                     }
                     TempPos = StrExe.IndexOf("\"");
                     if (TempPos >= 0)
                     {
                         StrExe = StrExe.Substring(TempPos + 1, StrExe.IndexOf("\"", TempPos + 1) - 1);
                     }
                     ti.BackgroundImage = Icon.ExtractAssociatedIcon(StrExe).ToBitmap();
                 }
                 catch (Exception e) { }
             }
         ti.Text = node.Name;
         ti.Tag = node;
         return ti;
     }
     catch (Exception exception1)
     {
         Exception innerException = exception1;
         throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 2
0
 public FuelDeliveryDetail(PROF_IT.Common.Enumerations.TypeForm typeForm, TIS.DL.Internal.FuelDelivery.FuelDeliveryObject fuel)
 {
     try
     {
         InitializeComponent();
         _fuelDelivery = fuel;
         _typeForm = typeForm;
         if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
         {
             throw new NotImplementedException();
         }
         else
         {
             InitializePropertyForm();
         }
         FindAll();
         SetPermissions();
     }
     catch (System.Exception exception1)
     {
         System.Exception innerException = exception1;
         throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
     }
 }
Exemplo n.º 3
0
        public BoardComputer(PROF_IT.Common.Enumerations.TypeForm typeForm, TIS.Model.Internal.BoardComputer boardComputer)
        {
            try
            {
                InitializeComponent();
                Uow = new UnitOfWork();

                _typeForm = typeForm;
                if (_typeForm == PROF_IT.Common.Enumerations.TypeForm.NewForm)
                {
                    throw new NotImplementedException();
                }
                else
                {
                    _boardComputer = new XPQuery<TIS.Model.Internal.BoardComputer>(Uow).Where(q => q.Id == boardComputer.Id).FirstOrDefault();
                    Initialize();
                }
            }
            catch (System.Exception exception1)
            {
                System.Exception innerException = exception1;
                throw new System.Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
        }
Exemplo n.º 4
0
 private void CameraCtrl_DeviceLost(object sender, TIS.Imaging.ICImagingControl.DeviceLostEventArgs e)
 {
     BeginInvoke(new DeviceLostDelegate(ref DeviceLost));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Show assigned image buffer.
 /// </summary>
 /// <param name="buffer"></param>
 private void ShowImageBuffer(TIS.Imaging.ImageBuffer buffer)
 {
     CameraCtrl.DisplayImageBuffer(buffer);
     buffer.Unlock();
 }
Exemplo n.º 6
0
        private void CameraCtrl_ImageAvailable(object sender, TIS.Imaging.ICImagingControl.ImageAvailableEventArgs e)
        {
            try
            {
                CameraCtrl.OverlayBitmap.DrawText(Color.Red, 10, 10, _pGPSCtrl.RMCData.LocalTime);
                CameraCtrl.OverlayBitmap.DrawText(Color.Red, 150, 10, "Lat:" + _pGPSCtrl.RMCData.Latitude + " Log:" + _pGPSCtrl.RMCData.Longitude);
                CameraCtrl.OverlayBitmap.DrawText(Color.Red, 550, 10, "Speed:" + _pGPSCtrl.RMCData.Speed.ToString());

                TIS.Imaging.ImageBuffer ImgBuffer;
                ImgBuffer = CameraCtrl.ImageActiveBuffer;
                ImgBuffer.Lock();

                // Display the processed image in the IC Imaging Control window.
                this.BeginInvoke(new ShowBufferDelegate(ShowImageBuffer), ImgBuffer);

                if (_bIsSave == true)
                {
                    string strFileName = String.Format("image_{0}_{1}.bmp", (_nSaveCount++), DateTime.Now.ToString("yyyyMMddHHmmssfff"));
                    ImgBuffer.SaveAsBitmap(strFileName);
                }

            }
            catch (Exception ex)
            {
                // An exception that occurs here cannot be handled elsewhere.
                // Therefore, if you are using the ImageAvailable event, watch the debug
                // output window of your Visual Studio because the message (see below)
                // will appear there.
                System.Diagnostics.Debug.WriteLine(ex.Message);
            }
        }