Exemplo n.º 1
0
        public static int getInt(IntIdentifier identifier)
        {
            switch (_theme)
            {
            case Theme.Dark:
                if (_int_ThemeDark.ContainsKey(identifier))
                {
                    return(_int_ThemeDark[identifier]);
                }
                break;

            case Theme.Light:
                if (_int_ThemeLight.ContainsKey(identifier))
                {
                    return(_int_ThemeLight[identifier]);
                }
                break;

            case Theme.Contrast:
                if (_int_ThemeContrast.ContainsKey(identifier))
                {
                    return(_int_ThemeContrast[identifier]);
                }
                break;
            }

            if (_int_ThemeDark.ContainsKey(identifier))
            {
                return(_int_ThemeDark[identifier]);
            }

            return(1);
        }
 public static bool TryParse(string value, out PersonID entityID)
 {
     if (IntIdentifier.TryParse(value, out var id))
     {
         entityID = new PersonID(id);
         return(true);
     }
     else
     {
         entityID = new PersonID();
         return(false);
     }
 }
Exemplo n.º 3
0
        public IntLeftRightChain(int[] arr)
        {
            IIdentifier rootIdentifier = new IntIdentifier(0);

            RootLink = new IntLink(arr[0], rootIdentifier);

            //Add to Chain
            for (int index = 1; index < arr.Length; index++)
            {
                int         value = arr[index];
                ILink <int> link  = RootLink;

                do
                {
                    if (value < link.GetValue())
                    {
                        ILink <int> linked = link.GetLeftLink();

                        if (linked == null)
                        {
                            IIdentifier identifier = new IntIdentifier(index);
                            ILink <int> leftLink   = new IntLink(value, identifier);

                            link.AddLeftLink(leftLink);
                            break;
                        }

                        link = linked;
                    }
                    else
                    {
                        ILink <int> linked = link.GetRightLink();

                        if (linked == null)
                        {
                            IIdentifier identifier = new IntIdentifier(index);
                            ILink <int> rightLink  = new IntLink(value, identifier);

                            link.AddRightLink(rightLink);
                            break;
                        }

                        link = linked;
                    }
                }while (true);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Maps the IDataReader values to a Categories object
        /// </summary>
        /// <param name="reader">The IDataReader to map</param>
        protected override void MapObject(IDataReader reader)
        {
            int ordinal;

            ordinal = reader.GetOrdinal("CategoryID");
            if (!reader.IsDBNull(ordinal))
            {
                _CategoryID = ((System.Int32)(reader.GetValue(ordinal)));
            }

            ordinal = reader.GetOrdinal("CategoryName");
            if (!reader.IsDBNull(ordinal))
            {
                _CategoryName = ((System.String)(reader.GetValue(ordinal)));
            }

            ordinal      = reader.GetOrdinal("Description");
            _Description = (!reader.IsDBNull(ordinal))?(System.String?)((System.String)(reader.GetValue(ordinal))) : null;

            ordinal  = reader.GetOrdinal("Picture");
            _Picture = (!reader.IsDBNull(ordinal))?(System.Byte[]?)((System.Byte[])(reader.GetValue(ordinal))) : null;

            _ID = new IntIdentifier($pkCallingArgumets);
        }
 public PersonID(IntIdentifier id) : base(id.ID)
 { /* No additional construction required. */
 }
Exemplo n.º 6
0
 public static int get(this IntIdentifier identifier)
 {
     return(PropertyManager.getInt(identifier));
 }
Exemplo n.º 7
0
 protected bool Equals(IntIdentifier other)
 {
     return(Id == other.Id);
 }
Exemplo n.º 8
0
 protected bool Equals(IntIdentifier other)
 {
     return Id == other.Id;
 }