コード例 #1
0
ファイル: PimGroup.cs プロジェクト: Mironiny/pimics-chatbot
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Code != null ? Code.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Description_2 != null ? Description_2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (System_Status != null ? System_Status.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LocalDescription != null ? LocalDescription.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LocalDescription2 != null ? LocalDescription2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Base_Unit != null ? Base_Unit.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Picture_Document_ID != null ? Picture_Document_ID.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Template_Code != null ? Template_Code.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Publication_Group != null ? Publication_Group.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Short_Text != null ? Short_Text.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Created_By != null ? Created_By.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Updated_By != null ? Updated_By.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Additional_Information_1 != null ? Additional_Information_1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Additional_Information_2 != null ? Additional_Information_2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Additional_Information_3 != null ? Additional_Information_3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Additional_Information_4 != null ? Additional_Information_4.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Additional_Information_5 != null ? Additional_Information_5.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ETag != null ? ETag.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #2
0
        private void btnEnumerate_Click(object sender, EventArgs e)
        {
            UInt32    devices_count;
            DL_STATUS status;
            string    status_msg;
            HND_AIS   hnd_device;
            UInt32    Device_Type, Device_ID, Device_FW_VER, Device_CommSpeed,
                      Device_isOpened, Device_Status, System_Status;
            string Device_Serial, Device_FTDI_Serial;

            // Shuld be a warning before close all opened devices
            gridView.Rows.Clear();
            try
            {
                devices_count = ais_readers.AIS_List_UpdateAndGetCount();
                Helper.AppendText(tbLog, "Listed devices succesfully enumerated. ", Color.Green);
                Helper.AppendText(tbLog, "Number of attached devices is: ", Color.Navy);
                Helper.AppendText(tbLog, "" + devices_count + "\n", Color.Black);
                Helper.SetStatusOk(statusLabel);

                if (isAnyDeviceAttached = (devices_count > 0))
                {
                    for (int i = 0; i < devices_count; i++)
                    {
                        try
                        {
                            status = ais_readers.AIS_List_GetInformation(
                                out hnd_device,         // assigned Handle
                                out Device_Serial,      // device serial number
                                out Device_Type,        // device type
                                out Device_ID,          // device identification number (master)
                                out Device_FW_VER,      // version of firmware
                                out Device_CommSpeed,   // communication speed
                                out Device_FTDI_Serial, // FTDI COM port identification
                                out Device_isOpened,    // is Device opened
                                out Device_Status,      // actual device status
                                out System_Status       // actual system status
                                );
                            if (status != DL_STATUS.DL_OK)
                            {
                                status_msg = ais_readers.status2str(status);
                                throw new Exception("AIS status: " + status_msg);
                            }
                            else
                            {
                                string[] new_row = new string[] { (i + 1).ToString(), hnd_device.ToString(), Device_Serial,
                                                                  Device_Type.ToString(), Device_ID.ToString(), Device_FW_VER.ToString(),
                                                                  Device_CommSpeed.ToString(), Device_FTDI_Serial, Device_isOpened.ToString(),
                                                                  Device_Status.ToString(), System_Status.ToString() };
                                gridView.Rows.Add(new_row);
                            }
                        }
                        catch (Exception exception)
                        {
                            Helper.AppendText(tbLog, "Warning: ", Color.Purple);
                            Helper.AppendText(tbLog, exception.Message + "\n", Color.Purple);
                            Helper.SetStatusWarning(statusLabel);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                Helper.AppendText(tbLog, exception.Message + "\n", Color.Red);
                Helper.SetStatusErr(statusLabel);
            }
        }