internal void ResolveFormatNames()
 {
     if (this.resolvedFormatNames == null)
     {
         this.resolvedFormatNames = new Hashtable(GetComparer());
         IEnumerator enumerator = this.PermissionEntries.GetEnumerator();
         while (enumerator.MoveNext())
         {
             MessageQueuePermissionEntry current = (MessageQueuePermissionEntry)enumerator.Current;
             if (current.Path != null)
             {
                 if (current.Path == "*")
                 {
                     this.resolvedFormatNames.Add("*", current.PermissionAccess);
                 }
                 else
                 {
                     try
                     {
                         MessageQueue queue = new MessageQueue(current.Path);
                         this.resolvedFormatNames.Add(queue.FormatName, current.PermissionAccess);
                     }
                     catch
                     {
                     }
                 }
             }
             else
             {
                 try
                 {
                     MessageQueueCriteria criteria = new MessageQueueCriteria();
                     if (current.MachineName != null)
                     {
                         criteria.MachineName = current.MachineName;
                     }
                     if (current.Category != null)
                     {
                         criteria.Category = new Guid(current.Category);
                     }
                     if (current.Label != null)
                     {
                         criteria.Label = current.Label;
                     }
                     IEnumerator messageQueueEnumerator = MessageQueue.GetMessageQueueEnumerator(criteria, false);
                     while (messageQueueEnumerator.MoveNext())
                     {
                         MessageQueue queue2 = (MessageQueue)messageQueueEnumerator.Current;
                         this.resolvedFormatNames.Add(queue2.FormatName, current.PermissionAccess);
                     }
                     continue;
                 }
                 catch
                 {
                     continue;
                 }
             }
         }
     }
 }
Beispiel #2
0
 protected override void BeginProcessing()
 {
     criteria = new MessageQueueCriteria();
     if (Category != null)
     {
         criteria.Category = Category.Value;
     }
     if (CreatedAfter != null)
     {
         criteria.CreatedAfter = CreatedAfter.Value;
     }
     if (CreatedBefore != null)
     {
         criteria.CreatedBefore = CreatedBefore.Value;
     }
     if (!String.IsNullOrEmpty(Label))
     {
         criteria.Label = Label;
     }
     if (!String.IsNullOrEmpty(MachineName))
     {
         criteria.MachineName = MachineName;
     }
     if (ModifiedAfter != null)
     {
         criteria.ModifiedAfter = ModifiedAfter.Value;
     }
     if (ModifiedBefore != null)
     {
         criteria.ModifiedBefore = ModifiedBefore.Value;
     }
 }
        private static ArrayList filteredQueueList(MessageQueueCriteria criteria)
        {
            ArrayList list = new ArrayList();

            foreach (MessageQueue queue in currentQueueList)
            {
                if (criteria.Match(queue.Id, queue.CreateTime, queue.Label, queue.MachineName, queue.LastModifyTime))
                {
                    list.Add(queue);
                }
            }
            return(list);
        }
Beispiel #4
0
		public static MessageQueueEnumerator GetMessageQueueEnumerator (MessageQueueCriteria criteria)
		{
			throw new NotImplementedException ();
		}
Beispiel #5
0
		private static ArrayList filteredQueueList (MessageQueueCriteria criteria)
		{
			throw new NotImplementedException ();
		}
        internal void ResolveFormatNames()
        {
            if (this.resolvedFormatNames == null)
            {
                this.resolvedFormatNames = new Hashtable(GetComparer());
                IEnumerator enumerator = this.PermissionEntries.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    MessageQueuePermissionEntry entry = (MessageQueuePermissionEntry)enumerator.Current;
                    if (entry.Path != null)
                    {
                        if (entry.Path == Any)
                            this.resolvedFormatNames.Add(Any, entry.PermissionAccess);
                        else
                        {
                            try
                            {
                                MessageQueue queue = new MessageQueue(entry.Path);
                                this.resolvedFormatNames.Add(queue.FormatName, entry.PermissionAccess);
                            }
                            catch
                            {
                                //if the format name cannot be resolved, it won't be added to the list
                                //permissions won't be granted.
                            }
                        }
                    }
                    else
                    {
                        try
                        {
                            MessageQueueCriteria criteria = new MessageQueueCriteria();
                            if (entry.MachineName != null)
                                criteria.MachineName = entry.MachineName;

                            if (entry.Category != null)
                                criteria.Category = new Guid(entry.Category);

                            if (entry.Label != null)
                                criteria.Label = entry.Label;

                            IEnumerator messageQueues = MessageQueue.GetMessageQueueEnumerator(criteria, false);
                            while (messageQueues.MoveNext())
                            {
                                MessageQueue queue = (MessageQueue)messageQueues.Current;
                                this.resolvedFormatNames.Add(queue.FormatName, entry.PermissionAccess);
                            }
                        }
                        catch
                        {
                            //if the criteria cannot be resolved, nothing will be added to the list
                            //permissions won't be granted.
                        }
                    }
                }
            }
        }
 internal MessageQueueEnumerator(MessageQueueCriteria criteria, bool checkSecurity)
 {
     this.locatorHandle = System.Messaging.Interop.LocatorHandle.InvalidHandle;
     this.criteria      = criteria;
     this.checkSecurity = checkSecurity;
 }
 /// <include file='doc\MessageQueueEnumerator.uex' path='docs/doc[@for="MessageQueueEnumerator.MessageQueueEnumerator1"]/*' />
 /// <internalonly/>
 internal MessageQueueEnumerator(MessageQueueCriteria criteria, bool checkSecurity)
 {
     this.criteria = criteria;
     this.checkSecurity = checkSecurity;
 }
 /// <include file='doc\MessageQueueEnumerator.uex' path='docs/doc[@for="MessageQueueEnumerator.MessageQueueEnumerator"]/*' />
 /// <internalonly/>
 internal MessageQueueEnumerator(MessageQueueCriteria criteria)
 {
     this.criteria = criteria;
     this.checkSecurity = true;
 }
 public static MessageQueueEnumerator GetMessageQueueEnumerator(MessageQueueCriteria criteria)
 {
     throw new NotImplementedException();
 }
        internal void ResolveFormatNames()
        {
            if (this.resolvedFormatNames == null)
            {
                this.resolvedFormatNames = new Hashtable(new CaseInsensitiveHashCodeProvider(CultureInfo.InvariantCulture), new CaseInsensitiveComparer(CultureInfo.InvariantCulture));
                IEnumerator enumerator = this.PermissionEntries.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    MessageQueuePermissionEntry entry = (MessageQueuePermissionEntry)enumerator.Current;
                    if (entry.Path != null)
                    {
                        if (entry.Path == Any)
                        {
                            this.resolvedFormatNames.Add(Any, entry.PermissionAccess);
                        }
                        else
                        {
                            try {
                                MessageQueue queue = new MessageQueue(entry.Path);
                                this.resolvedFormatNames.Add(queue.FormatName, entry.PermissionAccess);
                            }
                            catch (Exception) {
                                //if the format name cannot be resolved, it won't be added to the list
                                //permissions won't be granted.
                            }
                        }
                    }
                    else
                    {
                        try {
                            MessageQueueCriteria criteria = new MessageQueueCriteria();
                            if (entry.MachineName != null)
                            {
                                criteria.MachineName = entry.MachineName;
                            }

                            if (entry.Category != null)
                            {
                                criteria.Category = new Guid(entry.Category);
                            }

                            if (entry.Label != null)
                            {
                                criteria.Label = entry.Label;
                            }

                            IEnumerator messageQueues = MessageQueue.GetMessageQueueEnumerator(criteria, false);
                            while (messageQueues.MoveNext())
                            {
                                MessageQueue queue = (MessageQueue)messageQueues.Current;
                                this.resolvedFormatNames.Add(queue.FormatName, entry.PermissionAccess);
                            }
                        }
                        catch (Exception) {
                            //if the criteria cannot be resolved, nothing will be added to the list
                            //permissions won't be granted.
                        }
                    }
                }
            }
        }
 /// <include file='doc\MessageQueueEnumerator.uex' path='docs/doc[@for="MessageQueueEnumerator.MessageQueueEnumerator1"]/*' />
 ///    <internalonly/>
 internal MessageQueueEnumerator(MessageQueueCriteria criteria, bool checkSecurity)
 {
     this.criteria      = criteria;
     this.checkSecurity = checkSecurity;
 }
 /// <include file='doc\MessageQueueEnumerator.uex' path='docs/doc[@for="MessageQueueEnumerator.MessageQueueEnumerator"]/*' />
 ///    <internalonly/>
 internal MessageQueueEnumerator(MessageQueueCriteria criteria)
 {
     this.criteria      = criteria;
     this.checkSecurity = true;
 }
 public static MessageQueue[] GetPublicQueues(MessageQueueCriteria criteria)
 {
     throw new NotImplementedException();
 }
 public static MessageQueueEnumerator GetMessageQueueEnumerator(MessageQueueCriteria criteria)
 {
     return(new MessageQueueEnumerator(filteredQueueList(criteria)));
 }
 internal MessageQueueEnumerator(MessageQueueCriteria criteria, bool checkSecurity)
 {
     this.locatorHandle = System.Messaging.Interop.LocatorHandle.InvalidHandle;
     this.criteria = criteria;
     this.checkSecurity = checkSecurity;
 }
Beispiel #17
0
		public static MessageQueue[] GetPublicQueues (MessageQueueCriteria criteria)
		{
			throw new NotImplementedException ();
		}
		public static MessageQueueEnumerator GetMessageQueueEnumerator (MessageQueueCriteria criteria)
		{
			return new MessageQueueEnumerator (filteredQueueList (criteria));
		}
		private static ArrayList filteredQueueList (MessageQueueCriteria criteria)
		{
			ArrayList list = new ArrayList ();
			foreach (MessageQueue queue in currentQueueList)
				if (criteria.Match (queue.Id, queue.CreateTime, queue.Label, queue.MachineName, queue.LastModifyTime))
					list.Add (queue);
			return list;
		}
 private static ArrayList filteredQueueList(MessageQueueCriteria criteria)
 {
     throw new NotImplementedException();
 }