示例#1
0
 public bool removeAttribute(EdgeAttribute s)
 {
     if (m_Attributes.Contains(s))
     {
         m_Attributes.Remove(s);
         return(true);
     }
     return(false);
 }
示例#2
0
        //public String toString()
        //{
        //    return String.Format("{0:D2}", 1.43629);
        //    //return String.Format("It is %.2f from %s, (%.2f, %.2f) to %s, (%.2f, %.2f).", getDistance(), m_PointA, m_PointA.X, m_PointA.X, m_PointB, m_PointB.X, m_PointB.Y);
        //}

        // Description:
        // Add strings to label an edge as stairs, an elevator, hallway, etc.
        public bool addAttribute(EdgeAttribute s)
        {
            if (!m_Attributes.Contains(s))
            {
                m_Attributes.Add(s);
                return(true);
            }
            return(false);
        }
 public void UpdateNodeAttribute(EdgeAttribute udata)
 {
     using (SystemMapEntities db = new SystemMapEntities())
     {
         edge_attributes urec = db.edge_attributes
                                .Where(ea => ea.attributeid == udata.id)
                                .SingleOrDefault();
         if (urec != null)
         {
             urec.name       = udata.name;
             urec.descr      = udata.description;
             urec.attrtypeid = udata.type.typeId;
             db.SaveChanges();
         }
     }
 }
        public EdgeAttribute AddEdgeAttribute(EdgeAttribute eatt)
        {
            EdgeAttribute retval = null;

            using (SystemMapEntities db = new SystemMapEntities())
            {
                edge_attributes erec = new edge_attributes
                {
                    name       = eatt.name,
                    descr      = eatt.description,
                    attrtypeid = eatt.type.typeId
                };
                db.edge_attributes.Add(erec);
                db.SaveChanges();
                retval = new EdgeAttribute
                {
                    id          = erec.attributeid,
                    name        = erec.name,
                    description = erec.descr
                };
                retval.type = new TypeService().GetAttributeType(erec.attrtypeid);
            }
            return(retval);
        }
示例#5
0
 // Description:
 // Return the whether an edge has a particular attribute
 public bool getAttribute(EdgeAttribute att)
 {
     return(m_Attributes.Contains(att));
 }