Example #1
0
        public void LoadData(string path)
        {
            FileOperation fileOperation = new FileOperation();

            if (!fileOperation.CheckFileExists(path))
            {
                DataCollections.Add(new Data("", "", ""));

                try { fileOperation.CreateFile(path); }
                catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); }

                try { fileOperation.SaveFile(path, DataCollections); }
                catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButton.OK, MessageBoxImage.Error); }
            }

            if (ApplicationDeployment.IsNetworkDeployed)
            {
                try { path = AppDomain.CurrentDomain.SetupInformation.ActivationArguments.ActivationData[0]; }
                catch { path = Environment.CurrentDirectory + "\\keys.pdk"; }
            }

            DataCollections = new FileOperation().OpenFile(path);
        }