private void ButtonSave_Click(object sender, EventArgs e)
        {
            this.SaveFileDialogStock.InitialDirectory = GetRegistryOpenFilePath_Save();

            if (this.SaveFileDialogStock.ShowDialog(this) == DialogResult.OK)
            {
                SetRegistryOpenFilePath_Save(this.SaveFileDialogStock.InitialDirectory);

                StockFileInfo[] stockFileInfoArray = this.GetStockFileInfos();

                GlobalSetting.SaveConfigSetting(this.SaveFileDialogStock.FileName, stockFileInfoArray);
            }
        }
Beispiel #2
0
        private void SaveConfigFormInfo()
        {
            List <PlateInfo> plateInfoList = new List <PlateInfo>();

            for (int iIndex = 0; iIndex < this.TreeView.Nodes.Count; iIndex++)
            {
                TreeNode treeNodeParent = this.TreeView.Nodes[iIndex];
                if (treeNodeParent == null)
                {
                    continue;
                }

                PlateInfo plateInfo = new PlateInfo();
                plateInfo.Name         = treeNodeParent.Text;
                plateInfo.VarietyInfos = new VarietyInfo[0];

                plateInfoList.Add(plateInfo);

                List <VarietyInfo> varietyInfoList = new List <VarietyInfo>();

                for (int iIndex2 = 1; iIndex2 < treeNodeParent.Nodes.Count; iIndex2++)
                {
                    TreeNode treeNodeParentSub = treeNodeParent.Nodes[iIndex2];
                    if (treeNodeParentSub == null)
                    {
                        continue;
                    }

                    VarietyInfo varietyInfo = new VarietyInfo();
                    varietyInfo.Name      = treeNodeParentSub.Text;
                    varietyInfo.FileInfos = new FileInfo[0];

                    varietyInfoList.Add(varietyInfo);

                    UserControl outUserControl = null;
                    if (m_AllConfigControlInfo.TryGetValue(treeNodeParentSub, out outUserControl) == true)
                    {
                        ConfigAControl outConfigAControl = outUserControl as ConfigAControl;
                        if (outConfigAControl != null)
                        {
                            List <FileInfo> fileInfoList = new List <FileInfo>();

                            for (int iIndex3 = 0; iIndex3 < outConfigAControl.ListView.Items.Count; iIndex3++)
                            {
                                ListViewItem listViewItem = outConfigAControl.ListView.Items[iIndex3];

                                FileInfo fileInfo = new FileInfo();
                                fileInfo.StockName   = listViewItem.Text;
                                fileInfo.StockSymbol = listViewItem.SubItems[1].Text;
                                fileInfo.FilePath    = listViewItem.SubItems[2].Text;

                                fileInfoList.Add(fileInfo);
                            }

                            varietyInfo.FileInfos = fileInfoList.ToArray();
                        }
                    }
                }

                plateInfo.VarietyInfos = varietyInfoList.ToArray();
            }

            GlobalSetting.SaveConfigSetting(GlobalSetting.ConfigFilePath, plateInfoList.ToArray());
        }