private void BWItemValueChanged(object tag, IItemFacade facade) { string value = facade.GetValue().ToString(); string itemid = facade.ItemId.ToString(); if (!bwItems.Contains(itemid)) { string payload = new JObject(new JProperty("value", value), new JProperty("type", "bw"), new JProperty("itemid", itemid), new JProperty("time", DateTime.Now.ToString())).ToString(); Dictionary <string, string> dictObj = config["subscriptions"].ToObject <Dictionary <string, string> >(); foreach (string pub in dictObj.Keys) { if (pub == "bw") { bwCommands.Publish(dictObj["bw"], config["primary-access-chain"].ToString(), payload); } } bwItems.Add(itemid); } else { bwItems.Remove(itemid); } }
public ItemManager(IItemFacade itemFacade, IDiskFacade diskFacade, IMagazineFacade magazineFacade, IBookFacade bookFacade) { this.itemFacade = itemFacade; this.diskFacade = diskFacade; this.magazineFacade = magazineFacade; this.bookFacade = bookFacade; }
public ItemManager(IItemFacade itemFacade, IDiskFacade diskFacade, IMagazineFacade magazineFacade, IBookFacade bookFacade) { this.itemFacade = itemFacade; this.diskFacade = diskFacade; this.magazineFacade = magazineFacade; this.bookFacade = bookFacade; }
private void KNXItemValueChanged(object tag, IItemFacade facade) { int value = Int32.Parse(facade.GetValue().ToString()); string itemid = facade.ItemId.ToString(); host.WriteLog(nxaXIO.PlugKit.Logging.LogLevel.Warning, itemid + " : " + value + " changed."); Publish(value, itemid); }
public ItemController(IItemFacade facade) { this._facade = facade; }
public GoodsCreatedEventHandler(IItemFacade itemFacade) { this.itemFacade = itemFacade; }
public override bool ItemValueChanged(object tag, IItemFacade itemFacade) { handler?.Invoke(tag, itemFacade); return(true); }