示例#1
0
        private void ClickSave()
        {
            Writer.Write(ListTests);
            var mbx = new MessageBox.Avalonia.MessageBoxWindow("Сохранение", "Данные успешно сохранены.");

            mbx.Show();
        }
示例#2
0
        public void ShowAllMetadata()
        {
            var tb = new TextTableBuilder();

            tb.AddRow("Group", "Tag name", "Description");
            tb.AddRow("-----", "--------", "-----------");


            var directories = ImageMetadataReader.ReadMetadata(Frames[SelectedIndex].Patch);

            foreach (var directory in directories)
            {
                foreach (var tag in directory.Tags)
                {
                    tb.AddRow(directory.Name, tag.Name, tag.Description);
                }
            }

            var msgbox = new MessageBox.Avalonia.MessageBoxWindow(new MessageBoxParams
            {
                Button         = ButtonEnum.Ok,
                ContentTitle   = $"Metadata of {Path.GetFileName(Frames[SelectedIndex].Patch)}",
                ContentMessage = tb.Output(),
                Icon           = Icon.Info,
                Style          = Style.None,
                ShowInCenter   = true
            });

            msgbox.Show();
        }
        private void ClickNextTest()
        {
            if (CurrentItemTest is TestItemViewModel && ((TestItemViewModel)CurrentItemTest)?.IsSelectAnswer() == false)
            {
                var mbx = new MessageBox.Avalonia.MessageBoxWindow("Предупреждение", "Не выбран ни один ответ.");
                mbx.Show();
                return;
            }

            IsNext = (bool)((TestItemViewModel)CurrentItemTest)?.Next();
            if (IsNext == false)
            {
                CurrentItemTest = new TestItemEndViewModel(((TestItemViewModel)CurrentItemTest)?.Questions);
            }
        }
示例#4
0
        public async void Exit()
        {
            var message = "Do you really want to exit?";

            var msgbox = new MessageBox.Avalonia.MessageBoxWindow(new MessageBoxParams
            {
                Button         = ButtonEnum.YesNo,
                ContentTitle   = "Exit",
                ContentMessage = message,
                Icon           = Icon.Info,
                Style          = Style.None,
                ShowInCenter   = true
            });
            var result = await msgbox.Show();

            if (result.ToLower() == "yes")
            {
                Application.Current.MainWindow.Close();
            }
        }
示例#5
0
        public void ShowGeoData()
        {
            string msg         = string.Empty;
            int    rows        = 0;
            var    directories = ImageMetadataReader.ReadMetadata(Frames[SelectedIndex].Patch);

            foreach (var directory in directories)
            {
                foreach (var tag in directory.Tags)
                {
                    if (directory.Name.ToLower() == "gps")
                    {
                        if (tag.Name.ToLower() == "gps latitude" ||
                            tag.Name.ToLower() == "gps longitude" ||
                            tag.Name.ToLower() == "gps altitude")
                        {
                            rows++;
                            msg += $"{tag.Name}: {tag.Description}\n";
                        }
                    }
                }
            }

            if (rows != 3)
            {
                msg = "This image have hot geo tags.\nUse `Show all metadata` more for more details.";
            }
            var msgbox = new MessageBox.Avalonia.MessageBoxWindow(new MessageBoxParams
            {
                Button         = ButtonEnum.Ok,
                ContentTitle   = $"Geo position of {Path.GetFileName(Frames[SelectedIndex].Patch)}",
                ContentMessage = msg,
                Icon           = Icon.Info,
                Style          = Style.None,
                ShowInCenter   = true
            });

            msgbox.Show();
        }