当前位置: 首页>>代码示例>>C#>>正文


C# IComparable.GetHashCode方法代码示例

本文整理汇总了C#中IComparable.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# IComparable.GetHashCode方法的具体用法?C# IComparable.GetHashCode怎么用?C# IComparable.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IComparable的用法示例。


在下文中一共展示了IComparable.GetHashCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteWorkflowQueue

        public void DeleteWorkflowQueue(IComparable queueName)
        {
            if (queueName == null)
                throw new ArgumentNullException("queueName");

            lock (SyncRoot)
            {
                // when we are deleting the queue from activity
                // message delivery should not happen.
                if (this.rootQueuingService != null && !IsTransactionalQueue(queueName))
                {
                    this.rootQueuingService.DeleteWorkflowQueue(queueName);
                    return;
                }

                EventQueueState queueState = GetEventQueueState(queueName);

                Queue queue = queueState.Messages;
                Queue pendingQueue = this.pendingQueueState.Messages;

                while (queue.Count != 0)
                {
                    pendingQueue.Enqueue(queue.Dequeue());
                }

                WorkflowTrace.Runtime.TraceInformation("Queuing Service: Deleting Queue with ID {0} for {1}", queueName.GetHashCode(), queueName);
                this.persistedQueueStates.Remove(queueName);
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:29,代码来源:WorkflowQueuingService.cs

示例2: NewQueue

        private void NewQueue(IComparable queueID, bool enabled, bool transactional)
        {
            WorkflowTrace.Runtime.TraceInformation("Queuing Service: Creating new Queue with ID {0} for {1}", queueID.GetHashCode(), queueID);

            if (this.persistedQueueStates.ContainsKey(queueID))
            {
                object[] args =
                    new object[] { System.Messaging.MessageQueueErrorCode.QueueExists, queueID };
                string message =
                    string.Format(CultureInfo.CurrentCulture, ExecutionStringManager.EventQueueException, args);

                throw new QueueException(message, MessageQueueErrorCode.QueueExists);
            }

            EventQueueState queueState = new EventQueueState();
            queueState.Enabled = enabled;
            queueState.queueName = queueID;
            queueState.Transactional = transactional;
            this.persistedQueueStates.Add(queueID, queueState);
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:20,代码来源:WorkflowQueuingService.cs

示例3: SafeEnqueueEvent

 internal bool SafeEnqueueEvent(IComparable queueName, object item)
 {
     if (queueName == null)
     {
         throw new ArgumentNullException("queueName");
     }
     lock (this.SyncRoot)
     {
         if ((this.rootQueuingService != null) && !this.IsTransactionalQueue(queueName))
         {
             return this.rootQueuingService.SafeEnqueueEvent(queueName, item);
         }
         EventQueueState queue = this.GetQueue(queueName);
         if (!queue.Enabled)
         {
             throw new QueueException(string.Format(CultureInfo.CurrentCulture, ExecutionStringManager.QueueNotEnabled, new object[] { queueName }), MessageQueueErrorCode.QueueNotAvailable);
         }
         queue.Messages.Enqueue(item);
         WorkflowTrace.Runtime.TraceInformation("Queuing Service: Enqueue item Queue ID {0} for {1}", new object[] { queueName.GetHashCode(), queueName });
         for (int i = 0; (this.messageArrivalEventHandlers != null) && (i < this.messageArrivalEventHandlers.Count); i++)
         {
             this.messageArrivalEventHandlers[i].OnItemSafeEnqueued(queueName, item);
         }
         this.NotifySynchronousSubscribers(queueName, queue, item);
         return this.QueueAsynchronousEvent(queueName, queue);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:WorkflowQueuingService.cs

示例4: SafeEnqueueEvent

        internal bool SafeEnqueueEvent(IComparable queueName, Object item)
        {
            if (queueName == null)
                throw new ArgumentNullException("queueName");

            lock (SyncRoot)
            {
                if (this.rootQueuingService != null && !IsTransactionalQueue(queueName))
                {
                    return this.rootQueuingService.SafeEnqueueEvent(queueName, item);
                }

                EventQueueState qState = GetQueue(queueName);
                if (!qState.Enabled)
                {
                    throw new QueueException(String.Format(CultureInfo.CurrentCulture, ExecutionStringManager.QueueNotEnabled, queueName), MessageQueueErrorCode.QueueNotAvailable);
                }

                // note enqueue allowed irrespective of dirty flag since it is delivered through
                qState.Messages.Enqueue(item);

                WorkflowTrace.Runtime.TraceInformation("Queuing Service: Enqueue item Queue ID {0} for {1}", queueName.GetHashCode(), queueName);

                // notify message arrived subscribers
                for (int i = 0; messageArrivalEventHandlers != null && i < messageArrivalEventHandlers.Count; ++i)
                {
                    this.messageArrivalEventHandlers[i].OnItemSafeEnqueued(queueName, item);
                }

                NotifySynchronousSubscribers(queueName, qState, item);
                return QueueAsynchronousEvent(queueName, qState);
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:33,代码来源:WorkflowQueuingService.cs

示例5: DeleteWorkflowQueue

 public void DeleteWorkflowQueue(IComparable queueName)
 {
     if (queueName == null)
     {
         throw new ArgumentNullException("queueName");
     }
     lock (this.SyncRoot)
     {
         if ((this.rootQueuingService != null) && !this.IsTransactionalQueue(queueName))
         {
             this.rootQueuingService.DeleteWorkflowQueue(queueName);
         }
         else
         {
             Queue messages = this.GetEventQueueState(queueName).Messages;
             Queue queue2 = this.pendingQueueState.Messages;
             while (messages.Count != 0)
             {
                 queue2.Enqueue(messages.Dequeue());
             }
             WorkflowTrace.Runtime.TraceInformation("Queuing Service: Deleting Queue with ID {0} for {1}", new object[] { queueName.GetHashCode(), queueName });
             this.persistedQueueStates.Remove(queueName);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:WorkflowQueuingService.cs


注:本文中的IComparable.GetHashCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。