Ejemplo n.º 1
0
        public void DeleteActiveFeature()
        {
            FeatureLabel temp = activeFeature;

            ResetActiveFeature();
            features.Remove(temp);
        }
Ejemplo n.º 2
0
        public FeatureLabel CreateLabel()
        {
            FeatureLabel label = new FeatureLabel();

            label.id = this.prefix + counter.ToString();

            return(label);
        }
Ejemplo n.º 3
0
        public void AddLabel(FeatureLabel label)
        {
            if (false == IsLabelInList(label.id))
            {
                features.Add(label);
            }

            counter++;
        }
Ejemplo n.º 4
0
 public bool FindActiveFeature(int x, int y)
 {
     for (int i = 0; i < features.Count; i++)
     {
         if (true == features[i].Contains(x, y))
         {
             activeFeature = features[i];
             return(true);
         }
     }
     return(false);
 }
Ejemplo n.º 5
0
        public void LoadFromString(string input)
        {
            try
            {
                using (StringReader sr = new StringReader(input))
                {
                    XmlTextReader xtr = new XmlTextReader(sr);

                    this.features.Clear();

                    do
                    {
                        xtr.Read();

                        if (xtr.NodeType == XmlNodeType.None)
                        {
                            return;
                        }
                    }while (!(xtr.NodeType == XmlNodeType.Element && xtr.Name == "Feature"));


                    while ((xtr.NodeType == XmlNodeType.Element && xtr.Name == "Feature"))
                    {
                        FeatureLabel label = new FeatureLabel();

                        label.id   = xtr.GetAttribute("ID");
                        label.name = xtr.GetAttribute("Name");
                        label.type = label.ReadType(xtr.GetAttribute("Type"));
                        label.pos  = label.ReadPoint(xtr.GetAttribute("Pos"));

                        this.features.Add(label);

                        while (!(xtr.NodeType == XmlNodeType.EndElement && xtr.Name == "Feature") &&
                               !(xtr.NodeType == XmlNodeType.EndElement && xtr.Name == "features"))
                        {
                            xtr.Read();
                        }

                        if (xtr.NodeType != XmlNodeType.None)
                        {
                            xtr.Read();
                        }
                    }
                }
            }
            catch (System.Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 6
0
 public void ResetActiveFeature()
 {
     activeFeature = null;
 }