Exemple #1
0
        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);
        }
Exemple #2
0
        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;
            }
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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;
            }
        }
Exemple #5
0
        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);
        }