A Temporary Topic
Inheritance: TempDestination, ITemporaryTopic
コード例 #1
0
ファイル: Destination.cs プロジェクト: ioxuy/meijing-ui
        /// <summary>
        /// Create a Destination
        /// </summary>
        /// <param name="type"></param>
        /// <param name="pyhsicalName"></param>
        /// <returns></returns>
        public static Destination CreateDestination(int type, String pyhsicalName)
        {
            Destination result = null;

            if (pyhsicalName == null)
            {
                return(null);
            }
            else if (type == TOPIC)
            {
                result = new Topic(pyhsicalName);
            }
            else if (type == TEMPORARY_TOPIC)
            {
                result = new TempTopic(pyhsicalName);
            }
            else if (type == QUEUE)
            {
                result = new Queue(pyhsicalName);
            }
            else
            {
                result = new TempQueue(pyhsicalName);
            }
            return(result);
        }
コード例 #2
0
ファイル: Destination.cs プロジェクト: ioxuy/meijing-ui
        /// <summary>
        /// </summary>
        /// <param name="destination"></param>
        /// <returns></returns>
        public static Destination Transform(IDestination destination)
        {
            Destination result = null;

            if (destination != null)
            {
                if (destination is Destination)
                {
                    result = (Destination)destination;
                }
                else
                {
                    if (destination is ITemporaryQueue)
                    {
                        result = new TempQueue(((IQueue)destination).QueueName);
                    }
                    else if (destination is ITemporaryTopic)
                    {
                        result = new TempTopic(((ITopic)destination).TopicName);
                    }
                    else if (destination is IQueue)
                    {
                        result = new Queue(((IQueue)destination).QueueName);
                    }
                    else if (destination is ITopic)
                    {
                        result = new Topic(((ITopic)destination).TopicName);
                    }
                }
            }
            return(result);
        }
コード例 #3
0
ファイル: TempTopic.cs プロジェクト: ioxuy/meijing-ui
        public override Object Clone()
        {
            // Since we are a derived class use the base's Clone()
            // to perform the shallow copy. Since it is shallow it
            // will include our derived class. Since we are derived,
            // this method is an override.
            TempTopic o = (TempTopic)base.Clone();

            // Now do the deep work required
            // If any new variables are added then this routine will
            // likely need updating

            return(o);
        }
コード例 #4
0
ファイル: Destination.cs プロジェクト: Redi0/meijing-ui
 /// <summary>
 /// Create a Destination
 /// </summary>
 /// <param name="type"></param>
 /// <param name="pyhsicalName"></param>
 /// <returns></returns>
 public static Destination CreateDestination(int type, String pyhsicalName)
 {
     Destination result = null;
     if(pyhsicalName == null)
     {
         return null;
     }
     else if(type == TOPIC)
     {
         result = new Topic(pyhsicalName);
     }
     else if(type == TEMPORARY_TOPIC)
     {
         result = new TempTopic(pyhsicalName);
     }
     else if(type == QUEUE)
     {
         result = new Queue(pyhsicalName);
     }
     else
     {
         result = new TempQueue(pyhsicalName);
     }
     return result;
 }
コード例 #5
0
ファイル: Destination.cs プロジェクト: Redi0/meijing-ui
 /// <summary>
 /// </summary>
 /// <param name="destination"></param>
 /// <returns></returns>
 public static Destination Transform(IDestination destination)
 {
     Destination result = null;
     if(destination != null)
     {
         if(destination is Destination)
         {
             result = (Destination) destination;
         }
         else
         {
             if(destination is ITemporaryQueue)
             {
                 result = new TempQueue(((IQueue) destination).QueueName);
             }
             else if(destination is ITemporaryTopic)
             {
                 result = new TempTopic(((ITopic) destination).TopicName);
             }
             else if(destination is IQueue)
             {
                 result = new Queue(((IQueue) destination).QueueName);
             }
             else if(destination is ITopic)
             {
                 result = new Topic(((ITopic) destination).TopicName);
             }
         }
     }
     return result;
 }