Ejemplo n.º 1
0
        public static bool AreThereDirtyListeners(object sender)
        {
            if (OnDirtyConfigurationsEventHandler == null)
            {
                return(false);
            }
            var eventArguments = new StreamDeckDirtyReportArgs();

            OnDirtyConfigurationsEventHandler?.Invoke(sender, eventArguments);
            foreach (var @delegate in OnDirtyConfigurationsEventHandler.GetInvocationList())
            {
                @delegate.DynamicInvoke(sender, eventArguments);

                if (eventArguments.Cancel)
                {
                    return(true); //There are dirty listeners out there
                }
            }

            return(false);
        }
Ejemplo n.º 2
0
        /*
         *          _____ _                                _           _
         *         / ____| |                              | |         | |
         *        | (___ | |_ _ __ ___  __ _ _ __ ___   __| | ___  ___| | __
         *         \___ \| __| '__/ _ \/ _` | '_ ` _ \ / _` |/ _ \/ __| |/ /
         *         ____) | |_| | |  __/ (_| | | | | | | (_| |  __/ (__|   <
         *        |_____/ \__|_|  \___|\__,_|_| |_| |_|\__,_|\___|\___|_|\_\
         */
        public static string GetInformation()
        {
            var stringBuilder = new StringBuilder(200);

            stringBuilder.Append("\nOnDirtyConfigurationsEventHandler :").Append(OnDirtyConfigurationsEventHandler != null ? OnDirtyConfigurationsEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");
            stringBuilder.Append("OnDirtyNotificationEventHandler :").Append(OnDirtyNotificationEventHandler != null ? OnDirtyNotificationEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");
            stringBuilder.Append("OnStreamDeckShowNewLayerEventHandler :").Append(OnStreamDeckShowNewLayerEventHandler != null ? OnStreamDeckShowNewLayerEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");
            stringBuilder.Append("OnStreamDeckSelectedButtonChangedEventHandler :").Append(OnStreamDeckSelectedButtonChangedEventHandler != null ? OnStreamDeckSelectedButtonChangedEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");
            stringBuilder.Append("OnStreamDeckClearSettingsEventHandler :").Append(OnStreamDeckClearSettingsEventHandler != null ? OnStreamDeckClearSettingsEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");
            stringBuilder.Append("OnStreamDeckSyncConfigurationEventHandler :").Append(OnStreamDeckSyncConfigurationEventHandler != null ? OnStreamDeckSyncConfigurationEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");
            stringBuilder.Append("OnStreamDeckConfigurationChangeEventHandler :").Append(OnStreamDeckConfigurationChangeEventHandler != null ? OnStreamDeckConfigurationChangeEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");
            stringBuilder.Append("OnStreamDeckHideDecodersEventHandler :").Append(OnStreamDeckHideDecodersEventHandler != null ? OnStreamDeckHideDecodersEventHandler.GetInvocationList().Length.ToString() : "0").Append("\n");

            return(stringBuilder.ToString());
        }
Ejemplo n.º 3
0
 public static bool OnDirtyConfigurationsEventHandlerEventSubscribed()
 {
     return(OnDirtyConfigurationsEventHandler != null && OnDirtyConfigurationsEventHandler.GetInvocationList().Length > 0);
 }