Esempio n. 1
0
        private void InsertValueFromCorsixStringToolStripMenuItemClick(object sender, EventArgs e)
        {
            if (m_trvTables.SelectedNode == null)
            {
                return;
            }
            if (((AttributeValue)m_trvTables.SelectedNode.Tag).DataType != AttributeDataType.Table && !m_collectionMode)
            {
                return;
            }
            var parser = new RBFConvParserForm();

            if (parser.ShowDialog() == DialogResult.OK)
            {
                if (parser.m_rbfConvParser.Output.Count == 0)
                {
                    return;
                }
                foreach (AttributeValue rbfv in parser.m_rbfConvParser.Output)
                {
                    if (m_collectionMode)
                    {
                        m_collection.Add(rbfv);
                        AddToTree(rbfv, m_trvTables.Nodes[0]);
                    }
                    else
                    {
                        AttributeTable table = (AttributeTable)(((AttributeValue)m_trvTables.SelectedNode.Tag).Data);
                        table.AddValue(rbfv);
                        AddToTree(rbfv, m_trvTables.SelectedNode);
                    }
                }
                if (HasChangesChanged != null)
                {
                    HasChangesChanged(this, true);
                }
                if (m_trvTables.SelectedNode != null && m_trvTables.SelectedNode.Tag != null)
                {
                    UpdateDataGrid((AttributeValue)m_trvTables.SelectedNode.Tag);
                }
            }
        }
Esempio n. 2
0
 private void InsertValueFromCorsixStringToolStripMenuItemClick(object sender, EventArgs e)
 {
     if (m_trvTables.SelectedNode == null)
         return;
     if (((AttributeValue) m_trvTables.SelectedNode.Tag).DataType != AttributeDataType.Table && !m_collectionMode)
         return;
     var parser = new RBFConvParserForm();
     if (parser.ShowDialog() == DialogResult.OK)
     {
         if (parser.m_rbfConvParser.Output.Count == 0)
             return;
         foreach (AttributeValue rbfv in parser.m_rbfConvParser.Output)
         {
             if (m_collectionMode)
             {
                 m_collection.Add(rbfv);
                 AddToTree(rbfv, m_trvTables.Nodes[0]);
             }
             else
             {
                 AttributeTable table = (AttributeTable) (((AttributeValue) m_trvTables.SelectedNode.Tag).Data);
                 table.AddValue(rbfv);
                 AddToTree(rbfv, m_trvTables.SelectedNode);
             }
         }
         if (HasChangesChanged != null)
             HasChangesChanged(this, true);
         if (m_trvTables.SelectedNode != null && m_trvTables.SelectedNode.Tag != null)
             UpdateDataGrid((AttributeValue) m_trvTables.SelectedNode.Tag);
     }
 }