private void checkType() { if (txtEntry.Text.Length == 0 && txtValue.Text.Length == 0) { picType.Image = ListImageTBL.Images[5]; this._dteType = DTEType.Invalid; return; } try{ switch (txtEntry.Text.Length) { case 2: if (txtValue.Text.Length == 1) { picType.Image = ListImageTBL.Images[2]; this._dteType = DTEType.ASCII; } else { picType.Image = ListImageTBL.Images[0]; this._dteType = DTEType.DualTitleEncoding; } break; case 4: // >2 picType.Image = ListImageTBL.Images[1]; this._dteType = DTEType.MultipleTitleEncoding; break; } } catch (IndexOutOfRangeException) { switch (txtEntry.Text.Substring(0, 1)) { case @"/": picType.Image = ListImageTBL.Images[4]; this._dteType = DTEType.EndBlock; break; case @"*": picType.Image = ListImageTBL.Images[4]; this._dteType = DTEType.EndLine; break; //case @"\": } } catch (ArgumentOutOfRangeException) { //Du a une entre qui a 2 = de suite... EX: XX== picType.Image = ListImageTBL.Images[0]; this._dteType = DTEType.DualTitleEncoding; } }
/// <summary> /// Recherche un élément dans la TBL /// </summary> /// <param name="Entry">Entrée sous forme hexadécimal (XX)</param> /// <param name="Value">Valeur de l'entré</param> /// <param name="Type">Type de DTE</param> /// <returns>Retourne la position ou ce trouve cette élément dans le tableau</returns> public int Find(string Entry, string Value, DTEType Type) { DTE dte = new DTE(Entry, Value, Type); return(this._DTE.BinarySearch(dte)); }
/// <summary> /// Contructeur permetant d'ajouter une entrée, une valeur et une description /// </summary> /// <param name="Entry">Nom du DTE</param> /// <param name="Value">Valeur du DTE</param> /// <param name="Description">Description du DTE</param> /// <param name="Type">Type de DTE</param> public DTE(string entry, string value, DTEType type) { _Entry = entry; Value = value; Type = type; }
/// <summary> /// Contructeur permetant d'ajouter une entrée, une valeur et une description /// </summary> /// <param name="Entry">Nom du DTE</param> /// <param name="Value">Valeur du DTE</param> /// <param name="Description">Description du DTE</param> /// <param name="Type">Type de DTE</param> public DTE(string Entry, string Value, DTEType Type) { this._Entry = Entry.ToUpper(); this._Value = Value; this._Type = Type; }
/// <summary> /// Contructeur permetant d'ajouter une entrée et une valeur /// </summary> /// <param name="Entry">Nom du DTE</param> /// <param name="Value">Valeur du DTE</param> public DTE(string Entry, string Value) { this._Entry = Entry.ToUpper(); this._Value = Value; this._Type = DTEType.DualTitleEncoding; }
/// <summary> /// Constructeur principal /// </summary> public DTE() { this._Entry = ""; this._Type = DTEType.Invalid; this._Value = ""; }
/// <summary> /// Constructeur principal /// </summary> public DTE() { this._Entry = string.Empty; this.Type = DTEType.Invalid; this.Value = string.Empty; }
/// <summary> /// Recherche un élément dans la TBL /// </summary> /// <param name="Entry">Entrée sous forme hexadécimal (XX)</param> /// <param name="Value">Valeur de l'entré</param> /// <param name="Type">Type de DTE</param> /// <returns>Retourne la position ou ce trouve cette élément dans le tableau</returns> public int Find(string Entry, string Value, DTEType Type) => _DTEList.BinarySearch(new DTE(Entry, Value, Type));