Пример #1
0
        /// <summary>
        /// Adds a node to the layer.
        /// </summary>
        /// <param name="node">The node to add to the layer.</param>
        public void AddNode(NodeView node)
        {
            node.Height = nodeLayout.Height - 6;
            nodeLayout.Controls.Add(node);
            AdjustNodes();

            if (metaData.ContainsKey("layerName"))
                node.LayerName = metaData["layerName"];

            if (metaData.ContainsKey("nodeCount"))
            {
                int count = int.Parse(metaData["nodeCount"]) + 1;
                metaData["nodeCount"] = count.ToString();
            }
            else
            {
                metaData.Add("nodeCount", "1");
            }
        }
Пример #2
0
 /// <summary>
 /// Adds a node to the current layer
 /// </summary>
 private void AddNode(object sender, EventArgs e)
 {
     if (currentSelectedLayer.GetType() == typeof(HiddenLayerView))
     {
         HiddenLayerView layer = (HiddenLayerView)currentSelectedLayer;
         NodeView node = new NodeView();
         node.SetMetaDataModel(ref metaData);
         node.Click += new EventHandler(ChangeInformation);
         layer.AddNode(node);
         UpdateSaveStatus();
     }
     else
         MessageBox.Show(
             "The current selected layer is not a hidden layer. " +
             "Please select a hidden layer and try again");
 }