/// <summary>
        /// Update the filter applied to the character list data grid view.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FilterUpdate()
        {
            string filter = "((ItemType = '" + FLGameData.GAMEDATA_AMMO + "')";

            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_ARMOR + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_CARGO + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_CLOAK + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_CM + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_GUNS + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_MINES + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_PROJECTILES + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_SCANNERS + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_SHIELDS + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_THRUSTERS + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_TRACTORS + "')";
            filter += " OR (ItemType = '" + FLGameData.GAMEDATA_TURRETS + "')";
            filter += ")";

            if (textBox1.Text.Length > 0)
            {
                string filterText = textBox1.Text;
                if (filter != null)
                {
                    filter += " AND ";
                }
                filter += "((IDSName LIKE '%" + FLUtility.EscapeLikeExpressionString(filterText) + "%')";
                filter += " OR (ItemNickName LIKE '%" + FLUtility.EscapeLikeExpressionString(filterText) + "%')";
                filter += " OR (ItemType LIKE '%" + FLUtility.EscapeLikeExpressionString(filterText) + "%'))";
            }
            hashListBindingSource.Filter = filter;
        }
        // <summary>
        /// Show details when row is selected
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            foreach (DataGridViewRow row in dataGridView1.SelectedRows)
            {
                richTextBoxInfo.Clear();
                richTextBoxInfo.AppendText("@@@INSERTED_RTF_CODE_HACK@@@");
                string rtf = "";

                if ((string)row.Cells[itemTypeDataGridViewTextBoxColumn.Index].Value == "ships")
                {
                    rtf += FLUtility.FLXmlToRtf((string)row.Cells[IDSInfo1.Index].Value);
                    rtf += "\\pard \\par ";
                    rtf += FLUtility.FLXmlToRtf((string)row.Cells[IDSInfo.Index].Value);
                }
                else
                {
                    string xml = (string)row.Cells[IDSInfo.Index].Value;
                    if (xml.Length == 0)
                    {
                        xml = "No information available";
                    }
                    rtf += FLUtility.FLXmlToRtf(xml);
                }
                richTextBoxInfo.Rtf = richTextBoxInfo.Rtf.Replace("@@@INSERTED_RTF_CODE_HACK@@@", rtf);
                break;
            }
        }
        /// <summary>
        /// Update the filter applied to the character list data grid view.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void FilterUpdate()
        {
            string filter = "((ItemType = '" + FLGameData.GAMEDATA_BASES + "')";

            filter += ")";

            if (textBox1.Text.Length > 0)
            {
                string filterText = textBox1.Text;
                if (filter != null)
                {
                    filter += " AND ";
                }
                filter += "((IDSName LIKE '%" + FLUtility.EscapeLikeExpressionString(filterText) + "%')";
                filter += " OR (ItemNickName LIKE '%" + FLUtility.EscapeLikeExpressionString(filterText) + "%')";
                filter += " OR (ItemType LIKE '%" + FLUtility.EscapeLikeExpressionString(filterText) + "%'))";
            }
            hashListBindingSource.Filter = filter;
        }
Esempio n. 4
0
 public string UniStr(int index)
 {
     return(FLUtility.DecodeUnicodeHex(Convert.ToString(values[index])));
 }