예제 #1
0
        public Messages GetAppMessages()
        {
            if (AppMessages == null)
            {
                AppMessages = new Messages();
            }

            return AppMessages;
        }
예제 #2
0
        public Messages(Messages obj)
            : this()
        {
            foreach (Message msg in obj.Msgs)
            {
                this.AddMessage(msg);
            }

            foreach (String ns in obj.ChildNodes.Keys)
            {
                this.AddChildMessages(ns, obj.ChildNodes[ns]);
            }
        }
예제 #3
0
        /**
         * Add child Messages node to current node
         *
         * @param String ns
         * @param Messages msg
         *
         * @return bool
         */
        public bool AddChildMessages(String ns, Messages obj)
        {
            ChildNodes[ns] = new Messages(obj);

            return true;
        }
예제 #4
0
        /**
         * Add message to node by path
         *
         * @param String path
         * @param const Message msg
         *
         * @return bool
         */
        public bool AddMessage(String path, Message msg)
        {
            if (String.IsNullOrEmpty(path)) return AddMessage(msg);

            List<String> p_path = ParsePath(path);

            if (!ChildNodes.ContainsKey(p_path[0]))
            {
                ChildNodes[p_path[0]] = new Messages();
            }

            return ChildNodes[p_path[0]].AddMessage(p_path[1], msg);
        }