コード例 #1
0
    private static SentryState _instance; //only declared once

    private SentryState()                 //set instance to itself
    {
        if (_instance != null)
        {
            return;
        }

        _instance = this;
    }
コード例 #2
0
        public void SignalEvent(string sentryAddOnName, string sentryName, SentryState state, FieldRights fieldRights)
        {
            var taskInfo = new SentryTaskInfo()
            {
                AssociateId     = SoContext.CurrentPrincipal.AssociateId,
                AssociateName   = SoContext.CurrentPrincipal.Associate,
                FieldRights     = fieldRights,
                Type            = RightsType.FieldRights,
                SentryName      = sentryName,
                SentryAddOnName = sentryAddOnName,
                State           = state
            };

            // This produces an item and puts it on the queue.
            // A background thread will dequeue the item and process it in SentryRightsDispatcher.ProcessTasks.
            GetDispatcher().Enqueue(taskInfo);
        }