Exemplo n.º 1
0
        public BaseGeneralLayer NewLayer(int pid)
        {
            BaseGeneralLayer layer = NewObject <BaseGeneralLayer>();

            layer.Name = "新建分类";
            layer.PId  = pid;
            layer.save();
            return(layer);
        }
Exemplo n.º 2
0
 private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Node.Tag.GetType() == typeof(BaseGeneralLayer))
     {
         BaseGeneralLayer layer = (BaseGeneralLayer)e.Node.Tag;
         if (e.Label != null)
         {
             layer.Name = e.Label;
         }
         layer      = (BaseGeneralLayer)InvokeController("AlterLayer", layer);
         e.Node.Tag = layer;
     }
 }
Exemplo n.º 3
0
        private void 新建分类ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int layerId = -1;

            if (treeView1.SelectedNode != null)
            {
                layerId = ((BaseGeneralLayer)treeView1.SelectedNode.Tag).GLayerId;
            }

            BaseGeneralLayer layer = InvokeController("NewLayer", layerId) as BaseGeneralLayer;
            TreeNode         _node = new TreeNode();

            _node.Text = layer.Name;
            _node.Tag  = layer;
            if (treeView1.SelectedNode != null)
            {
                treeView1.SelectedNode.Nodes.Add(_node);
            }
            else
            {
                treeView1.Nodes.Add(_node);
            }
        }
Exemplo n.º 4
0
 public BaseGeneralLayer AlterLayer(BaseGeneralLayer layer)
 {
     layer.save();
     return(layer);
 }