コード例 #1
0
        private void btnDialogOk_Click(object sender, RoutedEventArgs e)
        {
            string pattern = "^[a-zA-Z0-9]+$";



            string d    = ((MainWindow)Application.Current.MainWindow).textBox.Text;
            string path = ConfigurationManager.ConnectionStrings["SqLiteBase"].ToString();

            bool result = SqLiteFunc.GetImportedFileList(path).Contains(txtAnswer.Text);

            if (Regex.IsMatch(txtAnswer.Text, pattern, RegexOptions.IgnoreCase))
            {
                if (result == false)
                {
                    ((MainWindow)Application.Current.MainWindow).GetLoadSingle(txtAnswer.Text + FormatList.Text);
                }

                SqLiteFunc.Insert(path, txtAnswer.Text + FormatList.Text, d, FormatList.Text);
                ((MainWindow)Application.Current.MainWindow).Title = txtAnswer.Text + FormatList.Text;

                this.Close();
            }
            else
            {
                MessageBox.Show("Invalid name");
            }
        }
コード例 #2
0
        private void openMenuItem_Click(object sender, System.EventArgs e)
        {
            var myItemsMenuItems = sender as MenuItem;
            


            string d = Convert.ToString(myItemsMenuItems.Header);
            this.Title = d;
            textBox.Text = SqLiteFunc.Open(PathFileSqLiteBase, d);
           

        }
コード例 #3
0
        public void GetLoadList (string PathData)
        {



            foreach (string FileName in SqLiteFunc.GetImportedFileList(PathData))
            {
                
                MenuItem fileMenuItem = new MenuItem();
                fileMenuItem.Header = FileName;
               
                fileMenuItem.Click += openMenuItem_Click;
                ListFiles.Items.Add(fileMenuItem);
            }

        }
コード例 #4
0
        public MainWindow()
        {
           
            InitializeComponent();
            //   CompressBase.Compress();
          
    


            if (File.Exists(PathFolderSqLiteBase + PathFileNameSqLiteBase + ".zip") != true)
            {
                
                SqLiteFunc.CreateDb(PathFileSqLiteBase);
            }else
            {

                CompressBase.DeCompress(PathFolderSqLiteBase, PathFileNameSqLiteBase);
                GetLoadList(PathFileSqLiteBase);
               // File.Delete(PathFolderSqLiteBase + PathFileNameSqLiteBase + ".zip");

            }
            

        }