Exemplo n.º 1
0
 internal void Remove(Context context, bool updateParentType)
 {
     if (types != null)
     {
         foreach (GType type in types)
         {
             type.Remove(context, false);
         }
         types.Clear();
         types = null;
     }
     if (ranges != null)
     {
         foreach (GRange range in ranges)
         {
             range.Remove(context, false);
         }
         ranges.Clear();
         ranges = null;
     }
     if (context != null && id != 0)
     {
         GmCommand cmd = context.Conn.CreateCommandById("deleteFromGisTypesWhereId");
         cmd.AddInt("Id", id);
         cmd.ExecuteNonQuery();
     }
     if (updateParentType)
     {
         ParentComposite.Remove(this);
     }
     else
     {
         lib.Unregister(this);
     }
 }
Exemplo n.º 2
0
        public void Move(GComposite comp)
        {
            if (comp is GType && ((GType)comp).GeomType != this.geomType)
            {
                throw new Exception("GeomType mismatch.");
            }
            int parentId0 = parentId;
            int priority0 = priority;

            ParentComposite.Remove(this);
            parent   = comp is GLib ? null : (GType)comp;
            parentId = parent != null ? parent.Id : 0;
            priority = ParentComposite.LastPriority;
            ParentComposite.Add(this);
            if (parentId != parentId0)
            {
                UpdateAttr((int)TypeField.ParentId);
            }
            if (priority != priority0)
            {
                UpdateAttr((int)TypeField.Priority);
            }
            lib.SetChanged();
        }