public ClientManager(ClientWrapper client) { _client = client; _client.DataReceived += ClientDataReceived; Dispatcher = new MessagesDispatcher <ClientManager>(this); }
public static BindableMember <MethodInfo>[] FindBindableMethods(MessagesDispatcher targetScript, Type targetType) { return(FindAvailableViewModelTypes(targetScript) .SelectMany(type => GetPublicMethods(type) .Select(m => new BindableMember <MethodInfo>(m, type)) ) .Where(m => m.Member.GetParameters().Length == 1) .Where(m => m.Member.GetParameters()[0].ParameterType.Equals(targetType)) .Where(m => m.Member.GetCustomAttributes(typeof(BindingAttribute), false).Any() && !m.MemberName.StartsWith("get_")) // Exclude property getters, since we aren't doing anything with the return value of the bound method anyway. .ToArray()); }
private void OnEnable() { targetScript = (MessagesDispatcher)target; }