Exemple #1
0
        private void timerUpdate_Tick(object sender, EventArgs e)
        {
            if (Flag.g_needUpdateContentPanel)
            {
                UIContent.GetInstance().UpdateItem(panelContent);
                Flag.g_needUpdateContentPanel = false;
            }

            if (Flag.g_onButtonClick)
            {
                labelAlName.Text = Define.g_currentAlgorithm;
            }

            if (Flag.g_needUpdateOptionalPanel)
            {
                UIContent.GetInstance().UpdateOptionalPanel(panelOptionalControl);
                Flag.g_needUpdateOptionalPanel = false;
            }

            if (Flag.g_processing)
            {
                UIContent.GetInstance().UpdatePanelDetail(panelDetail, textboxLog);
                Flag.g_processing = false;
            }
        }
Exemple #2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     new UIContent().CreateInstance();
     new File(Define.g_prePath + Define.g_configPath).Read();
     UIContent.GetInstance().UpdateItem(comboboxAlgorithm);
     CSNI.g_dataArray = new System.Collections.Generic.List <int>();
 }
Exemple #3
0
            public void Read()
            {
                try
                {
                    XmlDocument xdoc = new XmlDocument();
                    xdoc.Load(m_filePath);
                    if (xdoc == null)
                    {
                        Log.ERROR("Cant load xml file {0}", m_filePath);
                    }
                    XmlNode root = xdoc.FirstChild;

                    //Node AlgorithmTitle
                    XmlNode alTitle = root["AlgorithmTitle"];
                    for (int i = 0; i < alTitle.ChildNodes.Count; i++)
                    {
                        DictionaryStructure tmpDic = new DictionaryStructure(Key.g_name[0], alTitle.ChildNodes[i].InnerText);
                        UIContent.GetInstance().UpdateDataTable(tmpDic);
                    }

                    //Node AlgorithmContent
                    XmlNodeList alContent = root.SelectNodes("AlgorithmContent");
                    if (alContent.Count == 0)
                    {
                        Log.ERROR("Cant find any nodes like AlgorithmContent");
                    }
                    else
                    {
                        for (int i = 0; i < alContent.Count; i++)
                        {
                            for (int j = 0; j < alContent[i].ChildNodes.Count; j++)
                            {
                                string key = (alContent[i].Attributes["id"].Value.ToLower() == "sort") ? Key.g_name[1] : Key.g_name[2];
                                DictionaryStructure tmpDic = new DictionaryStructure(key, alContent[i].ChildNodes[j].InnerText);
                                UIContent.GetInstance().UpdateDataTable(tmpDic);
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log.ERROR(ex.ToString());
                }
            }
Exemple #4
0
 private void buttonRandom_Click(object sender, EventArgs e)
 {
     UIContent.GetInstance().OnRandomClick(textboxRandomArrayNumber, panelGraphic2, textboxLog);
 }
Exemple #5
0
 private void comboboxAlgorithm_SelectedValueChanged(object sender, EventArgs e)
 {
     UIContent.GetInstance().UpdateDataConfig(new DictionaryStructure(Key.g_name[0], comboboxAlgorithm.Text.ToString()));
     Flag.g_needUpdateContentPanel = true;
 }