Ejemplo n.º 1
0
        private void MenuItem_New(object sender, RoutedEventArgs e)
        {
            DialogNewFile dialog       = new DialogNewFile();
            var           dataNameList = JDataTableFunc.GetDataTableList();

            foreach (string dataName in dataNameList)
            {
                dialog.AddComboBoxItem(dataName);
            }
            dialog.Left       = this.Left + dialog.Width / 2;
            dialog.Top        = this.Top + dialog.Height / 2;
            dialog.ResizeMode = ResizeMode.NoResize;
            dialog.ShowDialog();
            if (dialog.DialogResult == true)
            {
                var dataName = dialog.GetComboBoxItem();
                this.CurrrentTableName = dataName;
                this.classNameList.Items.Clear();
                this.propertyGrid1.SelectedObject = null;
                if (!InitTable(this.CurrrentTableName, JDataTableFunc.GetDefaultDataString(dataName)))
                {
                    System.Windows.MessageBox.Show("init table fail");
                    return;
                }
                this.CurrentFilePath = String.Empty;
            }
        }
Ejemplo n.º 2
0
        private void SaveTable(string dataName, string path)
        {
            string result = JDataTableFunc.TableToString(dataName, m_table);

            if (result == String.Empty)
            {
                System.Windows.MessageBox.Show(String.Format("저장에 실패하였습니다."));
                return;
            }
            File.WriteAllText(path, result);
            m_commandList.Save();
            this.Title = GetTitleString(this.CurrrentTableName, this.CurrentFilePath);
            System.Windows.MessageBox.Show(String.Format("{0} 파일에 저장하였습니다.", path));
        }
Ejemplo n.º 3
0
 private bool InitTable(string dataName, string dataStr)
 {
     m_table = JDataTableFunc.StringToTable(dataName, dataStr);
     if (m_table == null)
     {
         System.Windows.MessageBox.Show(String.Format("{0} 테이블은 현재 지원하지 않습니다.", dataName));
         return(false);
     }
     m_table.ForeachCallbackData(delegate(JData data)
     {
         data.AddPropChangedHandler(new JDataPropertyChanged(Property_Key_Changed));
     });
     m_table.ForeachCallbackData(delegate(JData data)
     {
         this.classNameList.Items.Add(data.ToStringKey());
     });
     m_commandList.Clear();
     return(true);
 }