public DsMatch Usage(String Pad, String Mac) { DsMatch Matched = DsMatch.None; switch (m_Match) { case DsMatch.Mac: if (Mac == m_Mac) { Matched = DsMatch.Mac; } break; case DsMatch.Pad: if (Pad == m_Pad) { Matched = DsMatch.Pad; } break; case DsMatch.Global: if (m_Default) { Matched = DsMatch.Global; } break; } return(Matched); }
public Profile(Boolean Default, String Name, String Type, String Qualifier) { m_Name = Name; m_Type = Type; m_Default = Default; m_Match = (DsMatch)Enum.Parse(typeof(DsMatch), Type, true); switch (m_Match) { case DsMatch.Pad: m_Pad = Qualifier; break; case DsMatch.Mac: m_Mac = Qualifier; break; } }
protected Profile Find(String Mac, Int32 PadId) { Profile Found = m_Empty; String Pad = ((DsPadId)PadId).ToString(); DsMatch Current = DsMatch.None, Target = DsMatch.None; foreach (Profile Item in m_Mapper.Values) { Target = Item.Usage(Pad, Mac); if (Target > Current) { Found = Item; Current = Target; } } return(Found); }
public Profile(bool setDefault, string name, string type, string qualifier) : this(name) { Type = type; IsDefault = setDefault; _match = (DsMatch)Enum.Parse(typeof(DsMatch), type, true); switch (_match) { case DsMatch.Pad: _pad = qualifier; break; case DsMatch.Mac: _mac = qualifier; break; } }
private Profile Find(string Mac, int PadId) { var Found = m_Empty; var Pad = ((DsPadId)PadId).ToString(); DsMatch Current = DsMatch.None, Target = DsMatch.None; foreach (var Item in m_Mapper.Values) { Target = Item.Usage(Pad, Mac); if (Target > Current) { Found = Item; Current = Target; } } return(Found); }