/// <summary> /// Checks if two formats are compatible, according to the host API copy format compatibility rules. /// </summary> /// <param name="lhsFormat">First comparand</param> /// <param name="rhsFormat">Second comparand</param> /// <param name="caps">Host GPU capabilities</param> /// <returns>True if the formats are compatible, false otherwise</returns> public static bool FormatCompatible(TextureInfo lhs, TextureInfo rhs, Capabilities caps) { FormatInfo lhsFormat = lhs.FormatInfo; FormatInfo rhsFormat = rhs.FormatInfo; if (lhsFormat.Format.IsDepthOrStencil() || rhsFormat.Format.IsDepthOrStencil()) { return(lhsFormat.Format == rhsFormat.Format); } if (IsFormatHostIncompatible(lhs, caps) || IsFormatHostIncompatible(rhs, caps)) { return(lhsFormat.Format == rhsFormat.Format); } if (lhsFormat.IsCompressed && rhsFormat.IsCompressed) { FormatClass lhsClass = GetFormatClass(lhsFormat.Format); FormatClass rhsClass = GetFormatClass(rhsFormat.Format); return(lhsClass == rhsClass); } else { return(lhsFormat.BytesPerPixel == rhsFormat.BytesPerPixel); } }
private void btnReadXBF_Click(object sender, EventArgs e) { xbfInfoLib.FormatClass xbf = new FormatClass(); string filePath = currDir + "/" + edtFileName.Text; string strRet = xbf.getFileInfo(filePath); MessageBox.Show(strRet); }
private void button2_Click(object sender, EventArgs e) { ushort ID = FormatClass.ReadStartAdr(DevIDEdit.Text); ushort StartAddress = FormatClass.ReadStartAdr(AddressEdit.Text); ushort Length = Convert.ToUInt16(Convert.ToInt32(LenghtEdit.Text)); byte VisID = (byte)Convert.ToInt32(VisIDEdit.Text); InMBmaster.ReadHoldingRegister(ID, StartAddress, Length, VisID); }
/// <summary> /// Checks if two formats are compatible, according to the host API copy format compatibility rules. /// </summary> /// <param name="lhs">First comparand</param> /// <param name="rhs">Second comparand</param> /// <returns>True if the formats are compatible, false otherwise</returns> public static bool FormatCompatible(FormatInfo lhs, FormatInfo rhs) { if (lhs.Format.IsDepthOrStencil() || rhs.Format.IsDepthOrStencil()) { return(lhs.Format == rhs.Format); } if (lhs.Format.IsAstc() || rhs.Format.IsAstc()) { return(lhs.Format == rhs.Format); } if (lhs.IsCompressed && rhs.IsCompressed) { FormatClass lhsClass = GetFormatClass(lhs.Format); FormatClass rhsClass = GetFormatClass(rhs.Format); return(lhsClass == rhsClass); } else { return(lhs.BytesPerPixel == rhs.BytesPerPixel); } }
private void btnWriteXBF_Click(object sender, EventArgs e) { Boolean flagSQL = false; Boolean flagMSSQL = false; Boolean flagSecu = false; string sectionName = ini.readIniFileVal("config", "type"); string strSrv = ini.readIniFileVal(sectionName, "Server"); if (!Equals(strSrv, "")) { flagSQL = true; } if (flagSQL) { if (Equals(sectionName, "MSSQL")) { flagMSSQL = true; } if (flagMSSQL) { strConn = "dbType=0;" + "Password="******"Pwd") + ";" + "Persist Security Info=True;" + "User ID=" + ini.readIniFileVal(sectionName, "User") + ";" + "Initial Catalog=" + ini.readIniFileVal(sectionName, "DB") + ";" + "Data Source=" + ini.readIniFileVal(sectionName, "Server"); } else { strConn = "dbType=2;" + "Data Source=" + ini.readIniFileVal(sectionName, "Server") + ";" + "User Id=" + ini.readIniFileVal(sectionName, "User") + ";" + "Password="******"Pwd") + ";" + "Database=" + ini.readIniFileVal(sectionName, "DB") + ";" + "Convert Zero Datetime=True"; } } else // MS Access { string strPWD = ini.readIniFileVal(sectionName, "Pwd"); if (!Equals(strPWD, "")) { flagSecu = true; } if (flagSecu) { strConn = "dbType=1;" + "Data Source=" + ini.readIniFileVal(sectionName, "DB") + ";" + "Persist Security Info=False;" + "Jet OLEDB:Database Password="******"Pwd"); } else { strConn = "dbType=1;" + "Data Source=" + ini.readIniFileVal(sectionName, "DB") + ";" + "Persist Security Info=True"; } } MessageBox.Show(strConn); xbfInfoLib.FormatClass¡¡xbf = new FormatClass(); xbf.setFileInfo(strConn); }
private void bgFormat_DoWork(object sender, DoWorkEventArgs e) { FormatClass.FormatDrive(formatDriveLetter, volumeLabel, fileSystem, quickFormat, clusterSize, compression); }