예제 #1
0
 public void MountDevice()
 {
     try
     {
         char[,] chrArray = new char[26, 33];
         for (int i = 0; i < 26; i++)
         {
             for (int j = 0; j < 33; j++)
             {
                 chrArray[i, j] = '\0';
             }
         }
         if (!CiteDLL.XX_GetDevSerial(chrArray))
         {
             this.Callback(this, new CmdCiteEventArgs(DEV_ACTIONS.NO_ACTION));
         }
         else
         {
             StringBuilder stringBuilder = new StringBuilder();
             for (int k = 0; k < 26; k++)
             {
                 char[] chrArray1 = new char[33];
                 for (int l = 0; l < 33 && chrArray[k, l] != 0; l++)
                 {
                     chrArray1[l] = chrArray[k, l];
                 }
                 if (chrArray1[0] != 0)
                 {
                     stringBuilder.Append(new string(chrArray1));
                 }
             }
             this.CamSerial = stringBuilder.ToString().Substring(0, stringBuilder.ToString().IndexOf('\0'));
             if (this.CamSerial.Length > 0)
             {
                 int num  = 0;
                 int num1 = 0;
                 if (CiteDLL.XX_GetDeviceBattery(this.CamSerial, out num, out num1))
                 {
                     this.BatteryPercent = num;
                     this.BatteryToFull  = num1;
                 }
                 int num2 = 0;
                 int num3 = 0;
                 if (CiteDLL.XX_GetDeriveCap(this.CamSerial, out num2, out num3))
                 {
                     this.TotalDiskSpace = num2;
                     this.FreeDiskSpace  = num3;
                 }
                 if (this.SyncCameraTime)
                 {
                     int dateFormat = this.GetDateFormat();
                     CiteDLL.XX_SetTime(this.CamSerial, dateFormat);
                 }
                 this.IsConnected = true;
                 this.Callback(this, new CmdCiteEventArgs(DEV_ACTIONS.IS_CITE));
             }
         }
     }
     catch (Exception exception)
     {
         this.ErrorMsg = exception.Message;
     }
 }