Ejemplo n.º 1
0
        private async void OpenFile_Click(object sender, RoutedEventArgs e)
        {
            IStorageFile ISF = await AppStorage.OpenFileAsync(".xml");

            if (ISF == null)
            {
                return;
            }

            var j = ViewSource.ZSMData.OpenFile(ISF);
        }
Ejemplo n.º 2
0
        public async void OpenSpider(object sender, RoutedEventArgs e)
        {
            IStorageFile ISF = await AppStorage.OpenFileAsync(".xml");

            if (ISF == null)
            {
                return;
            }

            var j = ViewSource.OpenSpider(ISF);
        }
Ejemplo n.º 3
0
        public async void ImportTable()
        {
            IStorageFile ISF = await AppStorage.OpenFileAsync(".txt");

            if (ISF == null)
            {
                return;
            }

            ViewSource.ConvDataSource.ImportTable(await ISF.ReadString());
            ToggleSaveBtn(true);
        }
Ejemplo n.º 4
0
        private async void ImportBookSpider(object sender, RoutedEventArgs e)
        {
            IStorageFile ISF = await AppStorage.OpenFileAsync(".xml");

            if (ISF == null)
            {
                return;
            }

            try
            {
                EditTarget.ImportSpider(new XRegistry(await ISF.ReadString(), null, false).Parameter("Procedures"));
            }
            catch (Exception ex)
            {
                ProcManager.PanelMessage(EditTarget, Res.SSTR("InvalidXML", ex.Message), LogType.ERROR);
            }
        }
Ejemplo n.º 5
0
        private async void PickFile(object sender, RoutedEventArgs e)
        {
            if (LockedFile)
            {
                return;
            }

            Message.Text = "";
            IStorageFile ISF = await AppStorage.OpenFileAsync(".xml");

            if (ISF == null)
            {
                return;
            }

            UploadBtn.IsLoading = true;

            try
            {
                SelectedBook = await SpiderBook.ImportFile(await ISF.ReadString(), false);

                if (!SelectedBook.CanProcess)
                {
                    StringResources stx = StringResources.Load("ERROR");
                    throw new InvalidDataException(stx.Str("HS_INVALID"));
                }

                FileName.Text = ISF.Name;
                int LDot = ISF.Name.LastIndexOf('.');
                NameInput.PlaceholderText = ~LDot == 0 ? ISF.Name : ISF.Name.Substring(0, LDot);
            }
            catch (Exception ex)
            {
                Message.Text = ex.Message;
            }

            UploadBtn.IsLoading = false;
        }