public void Import()
        {
            string command = @"CRU-IMPORT";

            try {
                reinitialize();

                MSExcel.Clear();
                clear();

                MSExcel.Import(@"settings.xls", Settings.MSExcel.FORMAT.HEAP);

                flash();
            } catch (System.Exception e) {
                Logging.AcEditorWriteException(e, command);

                Logging.ExceptionCaller(MethodBase.GetCurrentMethod(), e);
            }

            Logging.DebugCaller(MethodBase.GetCurrentMethod(), string.Format(@"Выполнена команда: {0}", command));
        }
Пример #2
0
        private void listBoxFileSettings_SelectedIndexChanged(object sender, EventArgs ev)
        {
            TreeNode nodeBlock
            , nodeEntity;
            int iRow = -1;

            try {
                MSExcel.Clear();
                MSExcel.Import(m_listBoxFileSettings.SelectedItem.ToString(), MSExcel.FORMAT.HEAP);

                m_treeViewBlockDefinition.Nodes.Clear();

                foreach (string nameBlock in MSExcel.s_dictBlock.Keys)
                {
                    nodeBlock = m_treeViewBlockDefinition.Nodes.Add(nameBlock);

                    nodeBlock.Tag     = nameBlock;
                    nodeBlock.Checked = true;

                    foreach (KeyValuePair <KEY_ENTITY, EntityParser.ProxyEntity> pair in MSExcel.s_dictBlock[nameBlock].m_dictEntityParser)
                    {
                        nodeEntity = nodeBlock.Nodes.Add(pair.Value.m_name);

                        nodeEntity.Tag     = pair.Key;
                        nodeEntity.Checked = true;
                    }

                    foreach (MSExcel.POINT3D placement in MSExcel.s_dictBlock[nameBlock].m_ListReference)
                    {
                        iRow = m_clbBlockReferences.Items.Add(string.Format(@"{0} ({1})"
                                                                            , nameBlock, placement.ToString()), true);
                    }
                }

                //m_treeViewBlockDefinition.TopNode.Expand();
                m_treeViewBlockDefinition.SelectedNode = m_treeViewBlockDefinition.Nodes[0];
            } catch (Exception e) {
                Logging.ExceptionCaller(MethodBase.GetCurrentMethod(), e);
            }
        }