Exemplo n.º 1
0
        /// <summary>
        /// Gets the destination Id for the specified source.
        /// </summary>
        /// <param name="source">The source should be handled by the destination.</param>
        /// <returns>The Id if the destination is found; otherwise, null.</returns>
        public string GetDestinationId(string source)
        {
            ValidationUtils.ArgumentNotNullOrEmpty(source, "source");
            string destinationId = GetDestinationBySource(source);

            if (destinationId != null)
            {
                return(destinationId);
            }
            //Search for a RemotingService
            Destination defaultDestination = null;

            foreach (DictionaryEntry entry in _services)
            {
                IService serviceTmp = entry.Value as IService;
                if (serviceTmp.IsSupportedMessageType("flex.messaging.messages.RemotingMessage"))
                {
                    Destination[] destinations = serviceTmp.GetDestinations();
                    foreach (Destination destination in destinations)
                    {
                        if (destination.Source == source)
                        {
                            return(destination.Id);
                        }
                        if (destination.Source == "*")
                        {
                            defaultDestination = destination;
                        }
                    }
                }
            }
            if (defaultDestination != null)
            {
                return(defaultDestination.Id);
            }
            return(null);
        }
Exemplo n.º 2
0
        public string GetDestinationId(string source)
        {
            ValidationUtils.ArgumentNotNullOrEmpty(source, "source");
            string destinationBySource = this.GetDestinationBySource(source);

            if (destinationBySource != null)
            {
                return(destinationBySource);
            }
            Destination destination = null;

            foreach (DictionaryEntry entry in this._services)
            {
                IService service = entry.Value as IService;
                if (service.IsSupportedMessageType("flex.messaging.messages.RemotingMessage"))
                {
                    Destination[] destinations = service.GetDestinations();
                    foreach (Destination destination2 in destinations)
                    {
                        if (destination2.Source == source)
                        {
                            return(destination2.Id);
                        }
                        if (destination2.Source == "*")
                        {
                            destination = destination2;
                        }
                    }
                }
            }
            if (destination != null)
            {
                return(destination.Id);
            }
            return(null);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JConstructor"/> class with the specified name.
        /// </summary>
        /// <param name="name">The constructor name.</param>
        public JConstructor(string name)
        {
            ValidationUtils.ArgumentNotNullOrEmpty(name, "name");

            _name = name;
        }
Exemplo n.º 4
0
        public JProperty(string name)
        {
            ValidationUtils.ArgumentNotNullOrEmpty(name, "name");

            _name = name;
        }
Exemplo n.º 5
0
        public string GetValue(string key)
        {
            ValidationUtils.ArgumentNotNullOrEmpty(key, nameof(key));

            return(ConfigurationManager.AppSettings[key]);
        }