Esempio n. 1
0
        public BItem(string pId, BAuth pAuth, BItemType pItemType)
        {
            Id         = pId;
            Properties = new Dictionary <string, PropertyDefnBase>();
            Auth       = pAuth;
            DefineProperties(new List <PropertyDefnBase>()
            {
                new PropertyDefn <BItemType>("_Type")
                {
                    getter = () => { return(ItemType); }
                },
                new PropertyDefn <string>("_Id")
                {
                    getter = () => { return(Id); }
                },
                new PropertyDefn <string>("_OwnerId")
                {
                    getter = () => { return(OwnerId); }
                },
                new PropertyDefn <BItemState>("_State")
                {
                    getter = () => { return(State); }
                },
                new PropertyDefn <string>("_Layer")
                {
                    getter = () => { return(Layer); }
                },
            });
            BItem.AddItem(this);

            // TODO: Check if BItemsDeleted timer is running
        }
Esempio n. 2
0
        public static BItem GetItem(string pId)
        {
            BItem ret = null;

            lock (BItems) {
                BItems.TryGetValue(pId, out ret);
            }
            return(ret);
        }
Esempio n. 3
0
 public static void AddItem(BItem pItem)
 {
     lock (BItems) {
         BItems.Add(pItem.Id, pItem);
     }
 }