/// <summary> /// Sets the broker active. /// </summary> /// <param name="broker">Broker.</param> public static void SetBrokerActive(June.IMessageBroker broker) { //if(_MESSAGE_COLOR.ContainsKey(broker)) { _MESSAGE_COLOR[broker] = ACTIVE_CONTENT_COLOUR; //} LogPublish(broker.UriPath); }
/// <summary> /// Gets the broker colour. /// </summary> /// <returns>The broker colour.</returns> /// <param name="broker">Broker.</param> private static GUIStyle GetBrokerColour(June.IMessageBroker broker) { if (_MESSAGE_COLOR.ContainsKey(broker)) { //return _MESSAGE_COLOR[broker]; return(GetLableStyle(_MESSAGE_COLOR[broker])); } return(GetLableStyle(NORMAL_CONTENT_COLOUR)); }
/// <summary> /// Renders the I message broker. /// </summary> /// <param name="broker">Broker.</param> private void RenderIMessageBroker(June.IMessageBroker broker) { //Render Subscribers foreach (var kv in broker._SUBSCRIBERS) { EditorGUILayout.BeginHorizontal(EditorStyles.largeLabel); { GUIStyle style = MessageBrokerWindow.GetBrokerColour(kv.Value); //GUI.contentColor = MessageBrokerWindow.GetBrokerColour(kv.Value); EditorGUILayout.LabelField( string.Format("/{0} :: Callbacks:{1} ParamCallbacks:{2} Events:{3}", kv.Key, kv.Value._CALLBACKS.Count, ((June.MessageBrokerFragment)kv.Value)._QUERY_CALLBACK.Count, CountOfEventsSubscribingToMessage(kv.Value.UriPath)), style); } EditorGUILayout.EndHorizontal(); if (((June.MessageBrokerFragment)kv.Value)._QUERY_CALLBACK.Count > 0) { EditorGUI.indentLevel += 1; foreach (var query in ((June.MessageBrokerFragment)kv.Value)._QUERY_CALLBACK) { GUIStyle style = GetQueryCallbackColor(query); EditorGUILayout.LabelField( string.Format("{0}{1}", June.MessageBroker.QUERY_START, string.Join(June.MessageBroker.QUERY_APPEND.ToString(), Array.ConvertAll(query.Key, qp => string.Format("{0}{1}{2}", qp.Key, June.MessageBroker.QUERY_KEY_VALUE_SEPARATOR, qp.Value.ToString())))), style); } EditorGUI.indentLevel -= 1; } if (kv.Value._SUBSCRIBERS.Count > 0) { EditorGUI.indentLevel += 1; RenderIMessageBroker(kv.Value); EditorGUI.indentLevel -= 1; } } }
/// <summary> /// Initializes a new instance of the <see cref="June.MessageBrokerFragment"/> class. /// </summary> /// <param name="parent">Parent.</param> /// <param name="uriFragment">URI fragment.</param> public IMessageBroker(IMessageBroker parent, string uriFragment) { this.Parent = parent; this.UriFragment = uriFragment; }