Exemple #1
0
        private string StringFromKind(TitlePropertyKind k)
        {
            switch (k)
            {
            case TitlePropertyKind.StringProperty: return("S");

            case TitlePropertyKind.IntegerProperty: return("I");

            case TitlePropertyKind.DecimalProperty: return("D");

            default: throw new ApplicationException("Invalid property kind: " + k.ToString());
            }
        }
Exemple #2
0
        public TitlePropertyAccessor(string name, TitlePropertyKind kind)
        {
            m_name = name;

            using (var db = DB.GetDatabase())
            {
                var prop = db.Query <Property>().Where(p => p.PropertyName == name).FirstOrDefault();
                if (prop == null)
                {
                    throw new ApplicationException("Property was not found: " + name);
                }
                m_id   = prop.Id;
                m_kind = KindFromString(prop.PropertyKind);
            }
        }