IMB3.TEventEntry.HandleOnSubAndPub C# (CSharp) Method

HandleOnSubAndPub() private method

private HandleOnSubAndPub ( TConnectionPlatform aCommand ) : void
aCommand TConnectionPlatform
return void
        internal void HandleOnSubAndPub(TConnectionPlatform.TCommands aCommand) {
            if (FParent == null) {
                if (OnSubAndPub != null)
                    OnSubAndPub(this, aCommand);
            }
            switch (aCommand) {
                case TConnectionPlatform.TCommands.icSubscribe:
                    if (FParent != null && !IsPublished)
                        Publish();
                    FSubscribers = true;
                    break;
                case TConnectionPlatform.TCommands.icPublish:
                    if (FParent != null && !IsSubscribed)
                        Subscribe();
                    FPublishers = true;
                    break;
                case TConnectionPlatform.TCommands.icUnsubscribe:
                    if (FParent != null && IsPublished)
                        UnPublish();
                    FSubscribers = false;
                    break;
                case TConnectionPlatform.TCommands.icUnpublish:
                    if (FParent != null && IsSubscribed)
                        UnSubscribe();
                    FPublishers = false;
                    break;
            }
        }