Пример #1
0
        //------------------------------------------------------------
        // MethWithInst.Convert
        //
        /// <summary>
        /// If mpwi is MethWithInst, convert it to MethWithInst and return it.
        /// Otherwise, create a MethWithInst instance by mpwi and return it.
        /// </summary>
        /// <param name="mpwi"></param>
        /// <returns></returns>
        //------------------------------------------------------------
        static internal MethWithInst Convert(MethPropWithInst mpwi)
        {
            MethWithInst mwi = mpwi as MethWithInst;

            if (mwi != null)
            {
                return(mwi);
            }
            return(new MethWithInst(mpwi));
        }
Пример #2
0
 //------------------------------------------------------------
 // MethPropWithInst.Set (2)
 //
 /// <summary></summary>
 /// <param name="mpwi"></param>
 //------------------------------------------------------------
 internal void Set(MethPropWithInst mpwi)
 {
     if (mpwi != null)
     {
         this.Set(mpwi.MethPropSym, mpwi.AggTypeSym, mpwi.TypeArguments);
     }
     else
     {
         this.Set(null, null, null);
     }
 }
Пример #3
0
 //------------------------------------------------------------
 // MethWithInst Constructor (3)
 //
 /// <summary></summary>
 /// <param name="mpwi"></param>
 //------------------------------------------------------------
 internal MethWithInst(MethPropWithInst mpwi)
 {
     if (mpwi != null && mpwi.Sym != null)
     {
         Set(mpwi.Sym as METHSYM, mpwi.AggTypeSym, mpwi.TypeArguments);
     }
     else
     {
         Set(null, null, null);
     }
 }
Пример #4
0
        //------------------------------------------------------------
        // MethPropWithInst.Equals
        //
        /// <summary>
        /// Override.
        /// Return true if all fields are equal.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        //------------------------------------------------------------
        public override bool Equals(object obj)
        {
            MethPropWithInst mpwi = obj as MethPropWithInst;

            if (mpwi != null)
            {
                return(
                    this.Sym == mpwi.Sym &&
                    this.AggTypeSym == mpwi.AggTypeSym &&
                    this.TypeArguments == mpwi.TypeArguments
                    );
            }
            return(false);
        }