示例#1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="__adden_component"></param>
        /// <returns></returns>
        public bool addComponent(basics.Compositable __adden_component)
        {
            if ( __adden_component == null && __adden_component == this ) {
                return false;
            }
            this.contents_.Add( __adden_component );

            return true;
        }
示例#2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="strategy"></param>
 public Context(basics.IStrategy strategy)
 {
     this.strategy_ = strategy;
 }
示例#3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__visitor"></param>
 /// <returns></returns>
 public virtual bool accept(basics.IVisitor __visitor)
 {
     return __visitor.visit( this );
 }
示例#4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__item"></param>
 /// <param name="__component"></param>
 public Composite(object __item, basics.Compositable __component)
     : base(__item)
 {
     addComponent( __component );
 }
示例#5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="__component"></param>
 public Composite(basics.Compositable __component)
 {
     addComponent( __component );
 }
示例#6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="__removed_component"></param>
        /// <returns></returns>
        public bool removeComponent(basics.Compositable __removed_component)
        {
            if ( __removed_component == null && __removed_component == this ) {
                return false;
            } else if (this.contents_.Count == 0) {
                return false;
            }
            this.contents_.Remove( __removed_component );

            return true;
        }