public void SetSignalChannelIndex(ISignalChannel channel, int newIndex) { if (!SignalChannels.Contains(channel)) { Brain.KB.ShowError("This channel is not registered in the Channel Manager!"); } }
// ------------ Signal Channels ------------ public void AddSignalChannel(ISignalChannel channel) { if (SignalChannels.Contains(channel)) return; SignalChannels.Add(channel); }
/// <summary> /// Adds a new delegate to be called by the event when it is invoked /// </summary> /// <param name="dele">a delegate to be called when the action is invoked</param> /// <param name="actionObject">the object that contains the delegate. Used to set the order in which the delegates are called</param> public void Add(Action <object> dele, ISignalChannel actionObject) { lock (lockObject) { Actions.Add(dele); SignalChannelObjects[dele] = actionObject; } }
/// <summary> /// Adds a new delegate to be called by the event when it is invoked /// </summary> /// <param name="dele">a delegate to be called when the action is invoked</param> /// <param name="actionObject">the object that contains the delegate. Used to set the order in which the delegates are called</param> public void Add(Action<object> dele, ISignalChannel actionObject) { lock (lockObject) { Actions.Add(dele); SignalChannelObjects[dele] = actionObject; } }
// ------------ Signal Channels ------------ public void AddSignalChannel(ISignalChannel channel) { if (SignalChannels.Contains(channel)) { return; } SignalChannels.Add(channel); }
public int GetSignalChannelIndex(ISignalChannel channel) { if (channel == null) { return(99999); } if (!SignalChannels.Contains(channel)) { return(99999); } else { return(SignalChannels.IndexOf(channel)); } }
public bool SetChannelName(ISignalChannel channel, string name) { if (channel.ChannelName == name) { return(true); } var channels = Brain.KB.Sources.GetSignalChannels(); bool contains = channels.Any(x => x.ChannelName == name); if (contains) { Brain.KB.ShowError("There is already a channel with the name " + name + ".\nNames must be unique, please select another one."); return(false); } else { channel.ChannelName = name; return(true); } }
public CallbackSignalListener(ISignalChannel <T> channel, Action <T> callback) { _channel = channel; _callback = callback; StartListening(); }
public void SetSignalChannelIndex(ISignalChannel channel, int newIndex) { if (!SignalChannels.Contains(channel)) Brain.KB.ShowError("This channel is not registered in the Channel Manager!"); }
public bool SetChannelName(ISignalChannel channel, string name) { if (channel.ChannelName == name) return true; var channels = Brain.KB.Sources.GetSignalChannels(); bool contains = channels.Any(x => x.ChannelName == name); if (contains) { Brain.KB.ShowError("There is already a channel with the name " + name + ".\nNames must be unique, please select another one."); return false; } else { channel.ChannelName = name; return true; } }
public int GetSignalChannelIndex(ISignalChannel channel) { if (channel == null) return 99999; if (!SignalChannels.Contains(channel)) return 99999; else return SignalChannels.IndexOf(channel); }
public Signal(ISignalChannel owner, string name, Func<double> dele) { Owner = owner; Name = name; SignalDelegate = dele; }
void OnEnable() { _delegate = new SignalChannel <T> (); }
public Signal(ISignalChannel owner, string name, Func <double> dele) { Owner = owner; Name = name; SignalDelegate = dele; }