Esempio n. 1
0
        internal string AgregarTipoArreglo(NodoTablaSimbolos.TipoDeDato tipo, string rango)
        {
            string nombreTipo;

            if (!listaTiposArreglos.Exists(m => m.Rango == rango && m.TipoDato == tipo))
            {
                NodoTipoArreglo t = new NodoTipoArreglo(tipo, rango);
                listaTiposArreglos.Add(t);
                nombreTipo = t.Nombre;
            }
            else
            {
                NodoTipoArreglo t = listaTiposArreglos.Find(m => m.Rango == rango && m.TipoDato == tipo);
                nombreTipo = t.Nombre;
            }

            return(nombreTipo);
        }
        public override bool Equals(object obj)
        {
            //
            // See the full list of guidelines at
            //   http://go.microsoft.com/fwlink/?LinkID=85237
            // and also the guidance for operator== at
            //   http://go.microsoft.com/fwlink/?LinkId=85238
            //

            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            // safe because of the GetType check
            NodoTipoArreglo nodo = (NodoTipoArreglo)obj;

            // use this pattern to compare reference members
            return(Rango == nodo.Rango && TipoDato.Equals(nodo.TipoDato));
        }