private void PlaybackUnsubscribe(Scenarios.Action a) { SubInfo subInfo = (SubInfo)a.scenarioInfo; if (Safir.Dob.Typesystem.Operations.IsOfType(subInfo.typeId, Safir.Dob.Entity.ClassTypeId)) { ExplorerPanel.Instance.UnsubscribeEntity(subInfo); } else { ExplorerPanel.Instance.UnsubscribeMessage(subInfo); } }
void OnRemoveSub_click(object sender, EventArgs e) { foreach (ListViewItem li in sublistView.SelectedItems) { this.sublistView.Items.Remove(li); } SubInfo[] tmp = new SubInfo[sublistView.Items.Count]; int i = 0; foreach (MyListViewItem l in sublistView.Items) { tmp[i++] = new SubInfo(l.typeId, new EntityIdSerializeable(l.entityId), new ChannelIdSerializable(l.channelId), l.upd, l.includeSubClasses, l.restartSubscription); } Settings.Sate.Subscribe = tmp; Settings.Save(); }
public void AddSubscription(SubInfo si) { SubInfo[] tmp = new SubInfo[Subscribe.Length + 1]; for (int i = 0; i < Subscribe.Length; i++) { if (Subscribe[i].typeId == si.typeId && Subscribe[i].channelIdSer.ChannelId() == si.channelIdSer.ChannelId()) { if (si.upd) { Subscribe[i].upd = true; } return; } tmp[i] = Subscribe[i]; } tmp[tmp.Length - 1] = si; Subscribe = tmp; }