From bd75e4b0b7884680ec64c6e315b1d07bd911dbbb Mon Sep 17 00:00:00 2001 From: VladimirKhil Date: Sun, 10 Mar 2024 22:05:13 +0100 Subject: [PATCH] Remove legacy code (old package format editing) from SIQuester --- .../SI.GameServer.Client/GameServerClient.cs | 5 +- .../SI.GameServer.Client/IGameServerClient.cs | 4 + src/Common/SIPackages/Package.cs | 2 +- src/Common/SIPackages/Theme.cs | 22 +- .../ViewModel/SIOnlineViewModel.cs | 9 +- src/SIQuester/QTxtConverter/QConverter.cs | 10 +- .../SIQuester.ViewModel/AnswersViewModel.cs | 38 +- .../SIQuester.ViewModel/AtomViewModel.cs | 68 -- .../Configuration/AppOptions.cs | 15 - .../Helpers/PackageItemsHelper.cs | 21 +- .../Items/PackageViewModel.cs | 5 - .../Items/QuestionViewModel.cs | 146 +--- .../Items/RoundViewModel.cs | 7 +- .../Items/ThemeViewModel.cs | 11 +- .../Model/InfoOwnerData.cs | 32 - .../Model/QuestionTypesNames.cs | 24 - .../QuestionTypeParamViewModel.cs | 42 - .../QuestionTypeViewModel.cs | 115 --- .../SIQuester.ViewModel/ScenarioViewModel.cs | 500 ----------- .../Workspaces/Dialogs/ExportViewModel.cs | 34 - .../Dialogs/SelectThemesViewModel.cs | 15 - .../Workspaces/ImportDBStorageViewModel.cs | 24 +- .../Workspaces/ImportSIStorageViewModel.cs | 6 +- .../Workspaces/ImportTextViewModel.cs | 5 - .../Workspaces/MainViewModel.cs | 12 +- .../Workspaces/NewViewModel.cs | 6 +- .../Workspaces/QDocument.cs | 507 +---------- .../Sidebar/MediaStorageViewModel.cs | 9 - src/SIQuester/SIQuester/App.xaml | 805 ++---------------- .../Behaviors/ItemsControlWatcher.cs | 10 +- .../SIQuester/Behaviors/SmartMenuManager.cs | 8 - .../QuestionTypeParamTemplateSelector.cs | 33 - .../SIQuester/View/DocumentView.xaml | 5 +- src/SIQuester/SIQuester/View/FlatDocView.xaml | 156 +--- .../SIQuester/View/FlatDocView.xaml.cs | 12 +- .../SIQuester/View/TreeDocView.xaml.cs | 105 +-- src/SIQuester/SIQuester/appsettings.json | 3 - 37 files changed, 207 insertions(+), 2624 deletions(-) delete mode 100644 src/SIQuester/SIQuester.ViewModel/AtomViewModel.cs delete mode 100644 src/SIQuester/SIQuester.ViewModel/Model/QuestionTypesNames.cs delete mode 100644 src/SIQuester/SIQuester.ViewModel/QuestionTypeParamViewModel.cs delete mode 100644 src/SIQuester/SIQuester.ViewModel/QuestionTypeViewModel.cs delete mode 100644 src/SIQuester/SIQuester.ViewModel/ScenarioViewModel.cs delete mode 100644 src/SIQuester/SIQuester/Selectors/QuestionTypeParamTemplateSelector.cs diff --git a/src/Common/SI.GameServer.Client/GameServerClient.cs b/src/Common/SI.GameServer.Client/GameServerClient.cs index d6ecf90c..e5382ac6 100644 --- a/src/Common/SI.GameServer.Client/GameServerClient.cs +++ b/src/Common/SI.GameServer.Client/GameServerClient.cs @@ -106,6 +106,9 @@ public Task GetGamesHostInfoAsync(CancellationToken cancellationToken public Task GetNewsAsync(CancellationToken cancellationToken = default) => _connection.InvokeAsync("GetNews", cancellationToken); + public Task GetNewsNewAsync(CancellationToken cancellationToken = default) => + _connection.InvokeAsync("GetNewsNew", cancellationToken); + public Task GetLatestChatMessagesAsync(CancellationToken cancellationToken = default) => _connection.InvokeAsync("GetLatestChatMessages", cancellationToken); @@ -126,7 +129,7 @@ private async Task AuthenticateUserAsync( ["password"] = password }); - var response = await _client.PostAsync(uri, content, cancellationToken); + using var response = await _client.PostAsync(uri, content, cancellationToken); if (response.IsSuccessStatusCode) { diff --git a/src/Common/SI.GameServer.Client/IGameServerClient.cs b/src/Common/SI.GameServer.Client/IGameServerClient.cs index fbf24cd6..442e0d6f 100644 --- a/src/Common/SI.GameServer.Client/IGameServerClient.cs +++ b/src/Common/SI.GameServer.Client/IGameServerClient.cs @@ -57,6 +57,10 @@ public interface IGameServerClient : IAsyncDisposable Task GetNewsAsync(CancellationToken cancellationToken = default); + Task GetNewsNewAsync(CancellationToken cancellationToken = default); + + Task GetLatestChatMessagesAsync(CancellationToken cancellationToken = default); + Task GetUsersAsync(CancellationToken cancellationToken = default); Task> GetGamesAsync(int fromId, CancellationToken cancellationToken = default); diff --git a/src/Common/SIPackages/Package.cs b/src/Common/SIPackages/Package.cs index bd5dfb5e..b4f967e6 100644 --- a/src/Common/SIPackages/Package.cs +++ b/src/Common/SIPackages/Package.cs @@ -16,7 +16,7 @@ public sealed class Package : InfoOwner, IEquatable /// /// Default package version. /// - public const double DefaultVersion = 4.0; + public const double DefaultVersion = 5.0; /// /// Maximum supported package version. diff --git a/src/Common/SIPackages/Theme.cs b/src/Common/SIPackages/Theme.cs index cdddc7cf..5511ff74 100644 --- a/src/Common/SIPackages/Theme.cs +++ b/src/Common/SIPackages/Theme.cs @@ -24,34 +24,26 @@ public sealed class Theme : InfoOwner, IEquatable /// /// Question price. /// Does the question belong to the final round. - /// Does the theme belong to an upgraded package. - public Question CreateQuestion(int price = -1, bool isFinal = false, bool upgraded = false) + /// Question text. + public Question CreateQuestion(int price = -1, bool isFinal = false, string text = "") { int qPrice = DetectQuestionPrice(price, isFinal); var quest = new Question { - Price = qPrice - }; - - if (upgraded) - { - quest.Parameters = new StepParameters + Price = qPrice, + Parameters = new StepParameters { [QuestionParameterNames.Question] = new StepParameter { Type = StepParameterTypes.Content, ContentValue = new List { - new() { Type = ContentTypes.Text, Value = "" }, + new() { Type = ContentTypes.Text, Value = text }, } } - }; - } - else - { - quest.Scenario.Add(new Atom()); - } + } + }; quest.Right.Add(""); Questions.Add(quest); diff --git a/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs b/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs index d9a12c82..241ce113 100644 --- a/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs +++ b/src/SIGame/SIGame.ViewModel/ViewModel/SIOnlineViewModel.cs @@ -638,12 +638,19 @@ public async void Load() { try { - var news = await _gameServerClient.GetNewsAsync(_cancellationTokenSource.Token); + var news = await _gameServerClient.GetNewsNewAsync(_cancellationTokenSource.Token); if (!string.IsNullOrEmpty(news)) { OnMessage(Resources.News, news); } + + var latestMesssages = await _gameServerClient.GetLatestChatMessagesAsync(_cancellationTokenSource.Token); + + foreach (var item in latestMesssages) + { + OnMessage(item.UserName, item.Text); + } } catch (Exception exc) { diff --git a/src/SIQuester/QTxtConverter/QConverter.cs b/src/SIQuester/QTxtConverter/QConverter.cs index c02894cb..13847030 100644 --- a/src/SIQuester/QTxtConverter/QConverter.cs +++ b/src/SIQuester/QTxtConverter/QConverter.cs @@ -1245,7 +1245,7 @@ private static int CountLines(string template) /// /// /// - /// + /// /// public bool ReadFile(SIPart[][] list, SITemplate templates, ref SIDocument document, bool addToExisting, string docName, string authorName, string emptyRoundName, out int themesNum) { @@ -1601,12 +1601,12 @@ public bool ReadFile(SIPart[][] list, SITemplate templates, ref SIDocument docum #endregion - var quest = document.Package.Rounds[roundIndex].Themes[themeIndex].CreateQuestion(int.Parse(questNumber.ClearPoints().GrowFirstLetter())); + var quest = document.Package.Rounds[roundIndex].Themes[themeIndex].CreateQuestion( + int.Parse(questNumber.ClearPoints().GrowFirstLetter()), + text: questText.ClearPoints().GrowFirstLetter()); + questIndex++; - // The whole package is upgraded after completion - quest.Scenario.Clear(); - quest.Scenario.Add(questText.ClearPoints().GrowFirstLetter()); quest.Right.Clear(); quest.Right.Add(questAnswer.ClearPoints().GrowFirstLetter()); diff --git a/src/SIQuester/SIQuester.ViewModel/AnswersViewModel.cs b/src/SIQuester/SIQuester.ViewModel/AnswersViewModel.cs index 6e5889cb..0fb1234e 100644 --- a/src/SIQuester/SIQuester.ViewModel/AnswersViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/AnswersViewModel.cs @@ -236,33 +236,25 @@ private void ToNewComment_Executed(object? arg) private void SelectAtomObject_Executed(object? arg) { - if (Owner.IsUpgraded) + if (Owner.Parameters == null) { - if (Owner.Parameters == null) - { - return; - } - - if (Owner.Parameters.Model.ContainsKey(QuestionParameterNames.Answer)) - { - return; - } - - var answer = new StepParameterViewModel(Owner, new StepParameter - { - Type = StepParameterTypes.Content, - ContentValue = new List() - }); - - if (answer.ContentValue != null && answer.ContentValue.SelectAtomObjectCore(arg)) - { - Owner.Parameters.AddAnswer(answer); - } + return; + } + if (Owner.Parameters.Model.ContainsKey(QuestionParameterNames.Answer)) + { return; } - Owner.Scenario.SelectAtomObject_AsAnswer(arg); - OwnerDocument.ActiveItem = this; + var answer = new StepParameterViewModel(Owner, new StepParameter + { + Type = StepParameterTypes.Content, + ContentValue = new List() + }); + + if (answer.ContentValue != null && answer.ContentValue.SelectAtomObjectCore(arg)) + { + Owner.Parameters.AddAnswer(answer); + } } } diff --git a/src/SIQuester/SIQuester.ViewModel/AtomViewModel.cs b/src/SIQuester/SIQuester.ViewModel/AtomViewModel.cs deleted file mode 100644 index cb36c377..00000000 --- a/src/SIQuester/SIQuester.ViewModel/AtomViewModel.cs +++ /dev/null @@ -1,68 +0,0 @@ -using SIPackages; -using SIPackages.Core; - -namespace SIQuester.ViewModel; - -/// -/// Represents question scenario atom view model. -/// -/// -public sealed class AtomViewModel : MediaOwnerViewModel -{ - /// - /// Original model wrapped by this view model. - /// - public Atom Model { get; } - - /// - /// Media item type. - /// - public override string Type => Model.Type switch - { - AtomTypes.Image => CollectionNames.ImagesStorageName, - AtomTypes.Audio => CollectionNames.AudioStorageName, - AtomTypes.AudioNew => CollectionNames.AudioStorageName, - AtomTypes.Video => CollectionNames.VideoStorageName, - AtomTypes.Html => CollectionNames.HtmlStorageName, - _ => Model.Type, - }; - - /// - /// Scenario view model that contains current view model. - /// - public ScenarioViewModel? OwnerScenario { get; set; } - - private bool _isExpanded = true; - - public bool IsExpanded - { - get => _isExpanded; - set - { - if (_isExpanded != value) - { - _isExpanded = value; - OnPropertyChanged(); - } - } - } - - public AtomViewModel(Atom model) => Model = model; - - protected override IMedia GetMedia() - { - if (OwnerScenario == null) - { - throw new InvalidOperationException("OwnerScenario is undefined"); - } - - if (OwnerScenario.OwnerDocument == null) - { - throw new InvalidOperationException("OwnerDocument is undefined"); - } - - return OwnerScenario.OwnerDocument.Wrap(Model); - } - - protected override void OnError(Exception exc) => OwnerScenario?.OwnerDocument?.OnError(exc); -} diff --git a/src/SIQuester/SIQuester.ViewModel/Configuration/AppOptions.cs b/src/SIQuester/SIQuester.ViewModel/Configuration/AppOptions.cs index e5de8e04..89efd78d 100644 --- a/src/SIQuester/SIQuester.ViewModel/Configuration/AppOptions.cs +++ b/src/SIQuester/SIQuester.ViewModel/Configuration/AppOptions.cs @@ -9,19 +9,4 @@ public sealed class AppOptions /// Options configuration section name. /// public static readonly string ConfigurationSectionName = "SIQuester"; - - /// - /// Upgrade new packages to new format. - /// - public bool UpgradeNewPackages { get; set; } - - /// - /// Upgrade opened packages to new format. - /// - public bool UpgradeOpenedPackages { get; set; } - - /// - /// Is select answer type enabled. - /// - public bool SelectAnswerTypeEnabled { get; set; } } diff --git a/src/SIQuester/SIQuester.ViewModel/Helpers/PackageItemsHelper.cs b/src/SIQuester/SIQuester.ViewModel/Helpers/PackageItemsHelper.cs index e1686667..75bd3f05 100644 --- a/src/SIQuester/SIQuester.ViewModel/Helpers/PackageItemsHelper.cs +++ b/src/SIQuester/SIQuester.ViewModel/Helpers/PackageItemsHelper.cs @@ -12,30 +12,23 @@ internal static class PackageItemsHelper /// Creates a question with provided price. /// /// Question price. - /// Should the question have upgraded format. - internal static Question CreateQuestion(int price, bool upgraded) + internal static Question CreateQuestion(int price) { - var question = new Question { Price = price }; - - if (upgraded) + var question = new Question { - question.Parameters = new StepParameters + Price = price, + Parameters = new StepParameters { [QuestionParameterNames.Question] = new StepParameter { Type = StepParameterTypes.Content, ContentValue = new List { - new ContentItem { Type = AtomTypes.Text, Value = "" }, + new() { Type = ContentTypes.Text, Value = "" }, } } - }; - } - else - { - var atom = new Atom(); - question.Scenario.Add(atom); - } + } + }; question.Right.Add(""); diff --git a/src/SIQuester/SIQuester.ViewModel/Items/PackageViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Items/PackageViewModel.cs index 970388a8..f7ab7377 100644 --- a/src/SIQuester/SIQuester.ViewModel/Items/PackageViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Items/PackageViewModel.cs @@ -23,11 +23,6 @@ public sealed class PackageViewModel : ItemViewModel public ObservableCollection Rounds { get; } = new(); - /// - /// Does the package have the new format. - /// - public bool IsUpgraded => Model.Version >= 5.0; - public ICommand AddRound { get; private set; } public SimpleCommand AddRestrictions { get; private set; } diff --git a/src/SIQuester/SIQuester.ViewModel/Items/QuestionViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Items/QuestionViewModel.cs index 37d3f75e..952c6bb9 100644 --- a/src/SIQuester/SIQuester.ViewModel/Items/QuestionViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Items/QuestionViewModel.cs @@ -21,10 +21,6 @@ public sealed class QuestionViewModel : ItemViewModel public AnswersViewModel Wrong { get; private set; } - public ScenarioViewModel Scenario { get; private set; } - - public QuestionTypeViewModel Type { get; private set; } - public event Action? TypeNameChanged; public string TypeName @@ -54,11 +50,6 @@ public string TypeName public ICommand ClearType { get; private set; } - /// - /// Upgraded package flag. - /// - public bool IsUpgraded => OwnerTheme?.OwnerRound?.OwnerPackage?.IsUpgraded == true; - public override ICommand Add { get => null; @@ -99,11 +90,8 @@ public string AnswerType public QuestionViewModel(Question question) : base(question) { - Type = new QuestionTypeViewModel(question.Type); - Right = new AnswersViewModel(this, question.Right, true); Wrong = new AnswersViewModel(this, question.Wrong, false); - Scenario = new ScenarioViewModel(this, question.Scenario); if (question.Parameters != null) { @@ -134,88 +122,17 @@ public QuestionViewModel(Question question) private void Wrong_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) => AddWrongAnswers.CanBeExecuted = Model.Wrong.Count == 0; - private void AddComplexAnswer_Executed(object? arg) - { - if (IsUpgraded) + private void AddComplexAnswer_Executed(object? arg) => + Parameters?.AddAnswer(new StepParameterViewModel(this, new StepParameter { - Parameters?.AddAnswer(new StepParameterViewModel(this, new StepParameter - { - Type = StepParameterTypes.Content, - ContentValue = new List(new[] + Type = StepParameterTypes.Content, + ContentValue = new List(new[] { - new ContentItem { Type = AtomTypes.Text, Placement = ContentPlacements.Screen, Value = "" } + new ContentItem { Type = ContentTypes.Text, Placement = ContentPlacements.Screen, Value = "" } }) - })); - - return; - } - - if (Scenario.IsComplex) - { - return; - } - - var document = OwnerTheme.OwnerRound.OwnerPackage.Document; - - try - { - using var change = document.OperationsManager.BeginComplexChange(); - - Scenario.AddMarker_Executed(arg); - Scenario.AddText_Executed(arg); - - change.Commit(); - } - catch (Exception exc) - { - PlatformSpecific.PlatformManager.Instance.Inform(exc.Message, true); - } - } - - private void RemoveComplexAnswer_Executed(object? arg) - { - if (IsUpgraded) - { - Parameters?.RemoveAnswer(); - return; - } - - if (!Scenario.IsComplex) - { - return; - } - - var document = OwnerTheme.OwnerRound.OwnerPackage.Document; + })); - try - { - using var change = document.OperationsManager.BeginComplexChange(); - - for (var i = 0; i < Scenario.Count; i++) - { - if (Scenario[i].Model.Type == AtomTypes.Marker) - { - while (i < Scenario.Count) - { - Scenario.RemoveAt(i); - } - - break; - } - } - - if (Scenario.Count == 0) - { - Scenario.AddText_Executed(null); - } - - change.Commit(); - } - catch (Exception exc) - { - PlatformSpecific.PlatformManager.Instance.Inform(exc.Message, true); - } - } + private void RemoveComplexAnswer_Executed(object? arg) => Parameters?.RemoveAnswer(); private void AddWrongAnswers_Executed(object? arg) { @@ -247,19 +164,8 @@ private void CloneQuestion_Executed(object? arg) private void SetQuestionType_Executed(object? arg) { - if (IsUpgraded) - { - var typeName = (string?)arg ?? ""; - TypeName = typeName == QuestionTypes.Default ? "?" : typeName; - return; - } - - if (arg == null) - { - throw new ArgumentNullException(nameof(arg)); - } - - Type.Model.Name = (string)arg; + var typeName = (string?)arg ?? ""; + TypeName = typeName == QuestionTypes.Default ? "?" : typeName; } private void SetAnswerType_Executed(object? arg) @@ -357,25 +263,16 @@ private void SwitchEmpty_Executed(object? arg) { Model.Price = AppSettings.Default.QuestionBase * ((OwnerTheme?.Questions.IndexOf(this) ?? 0) + 1); - if (IsUpgraded) - { - Parameters!.ClearOneByOne(); + Parameters!.ClearOneByOne(); - Parameters.AddParameter(QuestionParameterNames.Question, new StepParameterViewModel(this, new StepParameter - { - Type = StepParameterTypes.Content, - ContentValue = new List + Parameters.AddParameter(QuestionParameterNames.Question, new StepParameterViewModel(this, new StepParameter + { + Type = StepParameterTypes.Content, + ContentValue = new List { new() { Type = ContentTypes.Text, Value = "" }, } - })); - } - else - { - Scenario.ClearOneByOne(); - Scenario.AddText_Executed(null); - Type.Params.ClearOneByOne(); - } + })); Right.ClearOneByOne(); Right.Add(""); @@ -387,17 +284,8 @@ private void SwitchEmpty_Executed(object? arg) Model.Price = Question.InvalidPrice; - if (IsUpgraded) - { - Parameters?.ClearOneByOne(); - TypeName = QuestionTypes.Default; - } - else - { - Scenario.ClearOneByOne(); - Type.Params.ClearOneByOne(); - Type.Name = QuestionTypes.Simple; - } + Parameters?.ClearOneByOne(); + TypeName = QuestionTypes.Default; Right.ClearOneByOne(); Wrong.ClearOneByOne(); diff --git a/src/SIQuester/SIQuester.ViewModel/Items/RoundViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Items/RoundViewModel.cs index 7d017536..b60a045b 100644 --- a/src/SIQuester/SIQuester.ViewModel/Items/RoundViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Items/RoundViewModel.cs @@ -30,11 +30,6 @@ public sealed class RoundViewModel : ItemViewModel public ICommand AddTheme { get; private set; } - /// - /// Upgraded package flag. - /// - public bool IsUpgraded => OwnerPackage?.IsUpgraded == true; - public RoundViewModel(Round round) : base(round) { @@ -122,7 +117,7 @@ private void AddTheme_Executed(object? arg) { for (int i = 0; i < 5; i++) { - var question = PackageItemsHelper.CreateQuestion((i + 1) * AppSettings.Default.QuestionBase, IsUpgraded); + var question = PackageItemsHelper.CreateQuestion((i + 1) * AppSettings.Default.QuestionBase); themeViewModel.Questions.Add(new QuestionViewModel(question)); } } diff --git a/src/SIQuester/SIQuester.ViewModel/Items/ThemeViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Items/ThemeViewModel.cs index 57fbabee..2232480e 100644 --- a/src/SIQuester/SIQuester.ViewModel/Items/ThemeViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Items/ThemeViewModel.cs @@ -52,11 +52,6 @@ public sealed class ThemeViewModel : ItemViewModel /// public ICommand ShuffleQuestions { get; private set; } - /// - /// Upgraded package flag. - /// - public bool IsUpgraded => OwnerRound?.OwnerPackage?.IsUpgraded == true; - public ThemeViewModel(Theme theme) : base(theme) { @@ -178,14 +173,12 @@ private void AddQuestion_Executed(object? arg) var document = OwnerRound.OwnerPackage.Document; var price = DetectNextQuestionPrice(); - var question = PackageItemsHelper.CreateQuestion(price, IsUpgraded); + var question = PackageItemsHelper.CreateQuestion(price); var questionViewModel = new QuestionViewModel(question); Questions.Add(questionViewModel); - QDocument.ActivatedObject = IsUpgraded - ? questionViewModel.Parameters?.FirstOrDefault().Value.ContentValue?.FirstOrDefault() - : questionViewModel.Scenario.FirstOrDefault(); + QDocument.ActivatedObject = questionViewModel.Parameters?.FirstOrDefault().Value.ContentValue?.FirstOrDefault(); document.Navigate.Execute(questionViewModel); } diff --git a/src/SIQuester/SIQuester.ViewModel/Model/InfoOwnerData.cs b/src/SIQuester/SIQuester.ViewModel/Model/InfoOwnerData.cs index a2914911..0643afcd 100644 --- a/src/SIQuester/SIQuester.ViewModel/Model/InfoOwnerData.cs +++ b/src/SIQuester/SIQuester.ViewModel/Model/InfoOwnerData.cs @@ -189,37 +189,5 @@ private void GetQuestion(QDocument documentViewModel, Question question) targetCollection.Add(link, preparedMedia.Uri); } } - - foreach (var atom in question.Scenario) - { - if (!atom.IsLink) - { - continue; - } - - var collection = documentViewModel.TryGetCollectionByMediaType(atom.Type); - - if (collection == null) - { - continue; - } - - var targetCollection = atom.Type switch - { - AtomTypes.Image => Images, - AtomTypes.Audio => Audio, - AtomTypes.AudioNew => Audio, - AtomTypes.Video => Video, - _ => null, - }; - - var link = atom.Text[1..]; - - if (!targetCollection.ContainsKey(link)) - { - var preparedMedia = collection.Wrap(link); - targetCollection.Add(link, preparedMedia.Uri); - } - } } } diff --git a/src/SIQuester/SIQuester.ViewModel/Model/QuestionTypesNames.cs b/src/SIQuester/SIQuester.ViewModel/Model/QuestionTypesNames.cs deleted file mode 100644 index 9b5a983c..00000000 --- a/src/SIQuester/SIQuester.ViewModel/Model/QuestionTypesNames.cs +++ /dev/null @@ -1,24 +0,0 @@ -using SIPackages.Core; -using SIQuester.ViewModel.Properties; -using System.Runtime.Serialization; - -namespace SIQuester.Model; - -/// -/// Defines a localized collection of well-known question types names. -/// -[Serializable] -public sealed class QuestionTypesNames : Dictionary -{ - public QuestionTypesNames() - { - this[QuestionTypes.Simple] = Resources.SimpleQuestion; - this[QuestionTypes.Auction] = Resources.StakeQuestion; - this[QuestionTypes.Cat] = Resources.SecretQuestion; - this[QuestionTypes.BagCat] = Resources.SuperSecretQuestion; - this[QuestionTypes.Sponsored] = Resources.NoRiskQuestion; - this[""] = Resources.OtherTypeQuestion; - } - - private QuestionTypesNames(SerializationInfo serializationInfo, StreamingContext streamingContext) { } -} diff --git a/src/SIQuester/SIQuester.ViewModel/QuestionTypeParamViewModel.cs b/src/SIQuester/SIQuester.ViewModel/QuestionTypeParamViewModel.cs deleted file mode 100644 index ac55ea46..00000000 --- a/src/SIQuester/SIQuester.ViewModel/QuestionTypeParamViewModel.cs +++ /dev/null @@ -1,42 +0,0 @@ -using SIPackages; -using System.Windows.Input; -using Utils.Commands; - -namespace SIQuester.ViewModel; - -/// -/// Defines a view model for question type parameter. -/// -/// -public sealed class QuestionTypeParamViewModel : ModelViewBase -{ - /// - /// Underlying question type parameter model. - /// - public QuestionTypeParam Model { get; } - - public QuestionTypeViewModel Owner { get; internal set; } - - public ICommand? AddQuestionTypeParam => Owner?.AddQuestionTypeParam; - - public SimpleCommand RemoveQuestionTypeParam { get; private set; } - - public QuestionTypeParamViewModel(QuestionTypeParam item) - { - Model = item; - Init(); - } - - public QuestionTypeParamViewModel() - { - Model = new QuestionTypeParam(); - Init(); - } - - private void Init() - { - RemoveQuestionTypeParam = new SimpleCommand(RemoveQuestionTypeParam_Executed); - } - - private void RemoveQuestionTypeParam_Executed(object? arg) => Owner.Params.Remove(this); -} diff --git a/src/SIQuester/SIQuester.ViewModel/QuestionTypeViewModel.cs b/src/SIQuester/SIQuester.ViewModel/QuestionTypeViewModel.cs deleted file mode 100644 index 15d51123..00000000 --- a/src/SIQuester/SIQuester.ViewModel/QuestionTypeViewModel.cs +++ /dev/null @@ -1,115 +0,0 @@ -using SIPackages; -using SIPackages.Core; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.ComponentModel; -using Utils.Commands; - -namespace SIQuester.ViewModel; - -public sealed class QuestionTypeViewModel : ModelViewBase -{ - public string Name - { - get => Model.Name; - set { Model.Name = value; } - } - - public QuestionType Model { get; } - - public ObservableCollection Params { get; private set; } - - public SimpleCommand AddQuestionTypeParam { get; private set; } - - public QuestionTypeViewModel(QuestionType model) - { - Model = model; - Params = new ObservableCollection(); - - Model.PropertyChanged += Model_PropertyChanged; - - AddQuestionTypeParam = new SimpleCommand(AddQuestionTypeParam_Executed) { CanBeExecuted = AddQuestionTypeParam_CanExecute() }; - - foreach (var item in Model.Params) - { - var viewModel = new QuestionTypeParamViewModel(item) { Owner = this }; - viewModel.RemoveQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam.CanBeExecuted; - Params.Add(viewModel); - } - - Params.CollectionChanged += Params_CollectionChanged; - } - - private void Params_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) - { - switch (e.Action) - { - case NotifyCollectionChangedAction.Add: - case NotifyCollectionChangedAction.Replace: - for (int i = e.NewStartingIndex; i < e.NewStartingIndex + e.NewItems.Count; i++) - { - Params[i].Owner = this; - Model.Params.Insert(i, Params[i].Model); - } - break; - - case NotifyCollectionChangedAction.Remove: - foreach (QuestionTypeParamViewModel param in e.OldItems) - { - param.Owner = null; - Model.Params.RemoveAt(e.OldStartingIndex); - } - break; - - case NotifyCollectionChangedAction.Reset: - Model.Params.Clear(); - - foreach (QuestionTypeParamViewModel param in Params) - { - param.Owner = this; - Model.Params.Add(param.Model); - } - break; - } - } - - private void Model_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(QuestionType.Name)) - { - AddQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam_CanExecute(); - - foreach (var item in Params) - { - item.RemoveQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam.CanBeExecuted; - } - } - - OnPropertyChanged(e); - } - - public void AddParam(string name, string value) - { - var param = new QuestionTypeParamViewModel(new QuestionTypeParam { Name = name, Value = value }); - param.RemoveQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam.CanBeExecuted; - Params.Add(param); - } - - private void AddQuestionTypeParam_Executed(object? arg) - { - var param = new QuestionTypeParamViewModel(); - param.RemoveQuestionTypeParam.CanBeExecuted = AddQuestionTypeParam.CanBeExecuted; - Params.Add(param); - } - - private bool AddQuestionTypeParam_CanExecute() - { - var name = Model.Name; - - return name != QuestionTypes.Simple - && name != QuestionTypes.Cat - && name != QuestionTypes.BagCat - && name != QuestionTypes.Auction - && name != QuestionTypes.Sponsored; - } -} diff --git a/src/SIQuester/SIQuester.ViewModel/ScenarioViewModel.cs b/src/SIQuester/SIQuester.ViewModel/ScenarioViewModel.cs deleted file mode 100644 index 4797326f..00000000 --- a/src/SIQuester/SIQuester.ViewModel/ScenarioViewModel.cs +++ /dev/null @@ -1,500 +0,0 @@ -using SIPackages; -using SIPackages.Core; -using SIQuester.ViewModel.PlatformSpecific; -using SIQuester.ViewModel.Properties; -using System.Collections.Specialized; -using System.ComponentModel; -using System.Windows.Input; -using Utils.Commands; - -namespace SIQuester.ViewModel; - -/// -/// Defines a question scenario view model. -/// -public sealed class ScenarioViewModel : ItemsViewModel -{ - internal Scenario Model { get; } - - internal QuestionViewModel Owner { get; private set; } - - public ICommand AddText { get; private set; } - - public ICommand AddVoice { get; private set; } - - public ICommand AddMarker { get; private set; } - - public ICommand ChangeType { get; private set; } - - public SimpleCommand SetTime { get; private set; } - - public SimpleCommand CollapseMedia { get; private set; } - - public SimpleCommand ExpandMedia { get; private set; } - - public SimpleCommand ExportMedia { get; private set; } - - public ICommand SelectAtomObject { get; private set; } - - public override QDocument? OwnerDocument => Owner.OwnerTheme?.OwnerRound?.OwnerPackage?.Document; - - private bool _isComplex; - - /// - /// Does this scenario contain a complex answer. - /// - public bool IsComplex - { - get => _isComplex; - set - { - if (_isComplex != value) - { - _isComplex = value; - OnPropertyChanged(new PropertyChangedEventArgs(nameof(IsComplex))); - } - } - } - - public ScenarioViewModel(QuestionViewModel owner, Scenario scenario) - { - Model = scenario; - Owner = owner; - - foreach (var atom in scenario) - { - Add(new AtomViewModel(atom) { OwnerScenario = this }); - - if (atom.Type == AtomTypes.Marker) - { - IsComplex = true; - } - } - - CollectionChanged += ScenarioViewModel_CollectionChanged; - - AddText = new SimpleCommand(AddText_Executed); - AddVoice = new SimpleCommand(AddVoice_Executed); - AddMarker = new SimpleCommand(AddMarker_Executed); - - ChangeType = new SimpleCommand(ChangeType_Executed); - - SetTime = new SimpleCommand(SetTime_Executed); - - CollapseMedia = new SimpleCommand(CollapseMedia_Executed); - ExpandMedia = new SimpleCommand(ExpandMedia_Executed); - ExportMedia = new SimpleCommand(ExportMedia_Executed); - - SelectAtomObject = new SimpleCommand(SelectAtomObject_Executed); - - UpdateCommands(); - } - - protected override void OnCurrentItemChanged(AtomViewModel oldValue, AtomViewModel newValue) - { - base.OnCurrentItemChanged(oldValue, newValue); - - if (oldValue != null) - { - oldValue.PropertyChanged -= CurrentAtom_PropertyChanged; - oldValue.Model.PropertyChanged -= Model_PropertyChanged; - } - - if (newValue != null) - { - newValue.PropertyChanged += CurrentAtom_PropertyChanged; - newValue.Model.PropertyChanged += Model_PropertyChanged; - } - - UpdateAtomCommands(); - } - - private void CurrentAtom_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(AtomViewModel.IsExpanded)) - { - UpdateAtomCommands(); - } - } - - private void Model_PropertyChanged(object? sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(Atom.AtomTime)) - { - UpdateAtomCommands(); - } - } - - private void UpdateAtomCommands() - { - var atom = CurrentItem; - var atomType = atom.Model.Type; - var isMedia = atomType == AtomTypes.Image || atomType == AtomTypes.Audio || atomType == AtomTypes.Video; - - SetTime.CanBeExecuted = atom != null && atom.Model.AtomTime == 0; - - CollapseMedia.CanBeExecuted = atom != null && isMedia && atom.IsExpanded; - ExpandMedia.CanBeExecuted = atom != null && isMedia && !atom.IsExpanded; - ExportMedia.CanBeExecuted = atom != null && isMedia; - } - - private void ScenarioViewModel_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e) - { - switch (e.Action) - { - case NotifyCollectionChangedAction.Add: - for (int i = e.NewStartingIndex; i < e.NewStartingIndex + e.NewItems?.Count; i++) - { - this[i].OwnerScenario = this; - Model.Insert(i, this[i].Model); - } - - break; - - case NotifyCollectionChangedAction.Replace: - for (int i = e.NewStartingIndex; i < e.NewStartingIndex + e.NewItems?.Count; i++) - { - this[i].OwnerScenario = this; - Model[i] = this[i].Model; - } - - break; - - case NotifyCollectionChangedAction.Remove: - if (e.OldItems != null) - { - foreach (var atom in e.OldItems.Cast()) - { - atom.OwnerScenario = null; - Model.RemoveAt(e.OldStartingIndex); - OwnerDocument?.ClearLinks(atom); - } - } - - IsComplex = Items.Any(atom => atom.Model.Type == AtomTypes.Marker); - break; - - case NotifyCollectionChangedAction.Reset: - Model.Clear(); - - foreach (AtomViewModel atom in this) - { - atom.OwnerScenario = this; - Model.Add(atom.Model); - } - - IsComplex = Items.Any(atom => atom.Model.Type == AtomTypes.Marker); - break; - } - - UpdateCommands(); - } - - internal AtomViewModel Add(string atomType, string atomText) - { - var atom = new AtomViewModel(new Atom { Type = atomType, Text = atomText }); - Add(atom); - - return atom; - } - - internal void SelectAtomObject_AsAnswer(object arg) => SelectAtomObjectCore(arg, true); - - internal void AddText_Executed(object? arg) => QDocument.ActivatedObject = Add(AtomTypes.Text, ""); - - private void AddVoice_Executed(object? arg) - { - var index = CurrentPosition; - - if (index > -1 && index < Count && string.IsNullOrWhiteSpace(this[index].Model.Text)) - { - RemoveAt(index); - } - - QDocument.ActivatedObject = Add(AtomTypes.Oral, ""); - } - - internal void AddMarker_Executed(object? arg) - { - Add(AtomTypes.Marker, ""); - IsComplex = true; - } - - private void ChangeType_Executed(object? arg) - { - var index = CurrentPosition; - - if (index > -1 && index < Count) - { - var atom = this[index]; - - if (atom.Model.Type == AtomTypes.Text) - { - atom.Model.Type = AtomTypes.Oral; - } - else if (atom.Model.Type == AtomTypes.Oral) - { - atom.Model.Type = AtomTypes.Text; - } - } - } - - protected override bool CanRemove() => Count > 1; - - private void SetTime_Executed(object? arg) - { - QDocument.ActivatedObject = CurrentItem; - CurrentItem.Model.AtomTime = 5; - } - - private void CollapseMedia_Executed(object? arg) - { - CurrentItem.IsExpanded = false; - CollapseMedia.CanBeExecuted = false; - ExpandMedia.CanBeExecuted = true; - } - - private void ExpandMedia_Executed(object? arg) - { - CurrentItem.IsExpanded = true; - CollapseMedia.CanBeExecuted = true; - ExpandMedia.CanBeExecuted = false; - } - - private void ExportMedia_Executed(object? arg) - { - try - { - var document = OwnerDocument ?? throw new InvalidOperationException("document is undefined"); - var media = document.Document.GetLink(CurrentItem.Model); - - if (media.GetStream != null && media.Uri != null) - { - var fileName = media.Uri; - - if (PlatformManager.Instance.ShowSaveUI(Resources.ExportMedia, "", null, ref fileName)) - { - using var stream = media.GetStream().Stream; - using var fileStream = File.Open(fileName, FileMode.Create, FileAccess.Write); - - stream.CopyTo(fileStream); - } - } - } - catch (Exception exc) - { - PlatformManager.Instance.ShowExclamationMessage($"{Resources.ExportMediaError}: {exc}"); - } - } - - private void SelectAtomObject_Executed(object? arg) => SelectAtomObjectCore(arg, false); - - private void SelectAtomObjectCore(object? arg, bool asAnswer) - { - var data = (Tuple)arg; - var media = data.Item1; - var mediaType = data.Item2.ToString(); - - if (media is MediaItemViewModel file) - { - SelectAtomObject_Do(mediaType, file, asAnswer); - return; - } - - if (mediaType == AtomTypes.Html) - { - LinkAtomObject(mediaType, asAnswer); - return; - } - - if (media is not string text) - { - return; - } - - if (text == Resources.File) // TODO: do not rely business logic on resource strings - { - AddAtomObject(mediaType, asAnswer); - } - else - { - LinkAtomObject(mediaType, asAnswer); - } - } - - private void LinkAtomObject(string mediaType, bool asAnswer) - { - var document = OwnerDocument ?? throw new InvalidOperationException("document is undefined"); - - var index = CurrentPosition; - - if (index == -1 || index >= Count) - { - if (Count == 0) - { - return; - } - - index = Count - 1; - } - - var uri = PlatformManager.Instance.AskText(Resources.InputMediaUri); - - if (string.IsNullOrWhiteSpace(uri)) - { - return; - } - - try - { - using var change = document.OperationsManager.BeginComplexChange(); - - if (asAnswer) - { - if (!_isComplex) - { - AddMarker_Executed(null); - index = Count - 1; - } - } - else if (string.IsNullOrWhiteSpace(this[index].Model.Text)) - { - RemoveAt(index--); - } - - var atom = new AtomViewModel(new Atom { Type = mediaType, Text = uri }); - QDocument.ActivatedObject = atom; - Insert(index + 1, atom); - document.ActiveItem = null; - - change.Commit(); - } - catch (Exception exc) - { - document.OnError(exc); - } - } - - private void SelectAtomObject_Do(string mediaType, MediaItemViewModel file, bool asAnswer) - { - var index = CurrentPosition; - - if (index == -1) - { - index = Count - 1; - } - - try - { - using var change = OwnerDocument.OperationsManager.BeginComplexChange(); - - if (asAnswer) - { - if (!_isComplex) - { - AddMarker_Executed(null); - index = Count - 1; - } - } - else if (string.IsNullOrWhiteSpace(this[index].Model.Text)) - { - RemoveAt(index--); - } - - var atom = new AtomViewModel(new Atom { Type = mediaType, Text = "" }); - Insert(index + 1, atom); - - SIDocument.SetLink(atom.Model, file.Model.Name); - OwnerDocument.ActiveItem = null; - - change.Commit(); - } - catch (Exception exc) - { - OwnerDocument.OnError(exc); - } - } - - private void AddAtomObject(string mediaType, bool asAnswer) - { - QDocument document; - - try - { - document = OwnerDocument; - } - catch (Exception exc) - { - PlatformManager.Instance.ShowErrorMessage(exc.Message); - return; - } - - if (document == null) - { - return; - } - - var collection = document.GetCollectionByMediaType(mediaType); - var initialItemCount = collection.Files.Count; - - try - { - using var change = document.OperationsManager.BeginComplexChange(); - - collection.AddItem.Execute(null); - - if (!collection.HasPendingChanges) - { - return; - } - - if (initialItemCount == collection.Files.Count) - { - return; - } - - var index = CurrentPosition; - - if (index == -1 || index >= Count) - { - if (Count == 0) - { - return; - } - - index = Count - 1; - } - - if (asAnswer) - { - if (!_isComplex) - { - AddMarker_Executed(null); - index = Count - 1; - } - } - else if (string.IsNullOrWhiteSpace(this[index].Model.Text) && this[index].Model.Type != AtomTypes.Marker) - { - RemoveAt(index--); - } - - var atom = new AtomViewModel(new Atom { Type = mediaType, Text = "" }); - Insert(index + 1, atom); - - var last = collection.Files.LastOrDefault(); - - if (last != null) - { - SIDocument.SetLink(atom.Model, last.Model.Name); - } - - document.ActiveItem = null; - - change.Commit(); - } - catch (Exception exc) - { - document.OnError(exc); - } - } -} diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/ExportViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/ExportViewModel.cs index a7e1da80..16a5cc55 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/ExportViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/ExportViewModel.cs @@ -153,7 +153,6 @@ internal async Task ExportAsync(string filename, int index, Encoding encoding) /// Имя основного файла для экспорта private async Task ExportMediaAsync(string filename) { - var extMedia = new List(); var extMediaNew = new List<(MediaInfo, string)>(); foreach (var round in _source.Package.Rounds) @@ -162,24 +161,6 @@ private async Task ExportMediaAsync(string filename) { foreach (var quest in theme.Questions) { - foreach (var atom in quest.Scenario) - { - var type = atom.Model.Type; - - if (type == AtomTypes.Image || type == AtomTypes.Audio || type == AtomTypes.AudioNew || type == AtomTypes.Video) - { - var media = _source.Document.GetLink(atom.Model); - - if (media.GetStream != null) - { - if (media.Uri != null) - { - extMedia.Add(media); - } - } - } - } - foreach (var content in quest.Model.GetContent()) { if (content.IsRef) @@ -196,21 +177,6 @@ private async Task ExportMediaAsync(string filename) } } - if (extMedia.Any()) - { - var name = Path.GetFileNameWithoutExtension(filename); - var folder = Path.Combine(Path.GetDirectoryName(filename), name + "_Media"); - Directory.CreateDirectory(folder); - - foreach (var media in extMedia) - { - using var stream = media.GetStream().Stream; - var file = Path.Combine(folder, media.Uri); - using var fs = File.Open(file, FileMode.Create, FileAccess.Write); - await stream.CopyToAsync(fs); - } - } - if (extMediaNew.Any()) { var name = Path.GetFileNameWithoutExtension(filename); diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/SelectThemesViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/SelectThemesViewModel.cs index 0c3e5535..9010b712 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/SelectThemesViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/Dialogs/SelectThemesViewModel.cs @@ -97,11 +97,6 @@ private async void Select_Executed(object? arg) await CopyCollectionsAsync(_document, targetDocument, allthemes[index - 1]); } - if (_appOptions.UpgradeNewPackages) - { - newDocument.Upgrade(); - } - OnNewItem(targetDocument); } catch (Exception exc) @@ -131,11 +126,6 @@ private async void Select2_Executed(object? arg) await CopyCollectionsAsync(_document, targetDocument, theme); } - if (_appOptions.UpgradeNewPackages) - { - newDocument.Upgrade(); - } - OnNewItem(targetDocument); } catch (Exception exc) @@ -161,11 +151,6 @@ private static async Task CopyCollectionsAsync(QDocument oldDocument, QDocument { oldDocument.Document.CopyAuthorsAndSources(newDocument.Document, question); - foreach (var atom in question.Scenario) - { - await CopyMediaAsync(oldDocument, newDocument, atom, tempMediaFolder); - } - foreach (var contentItem in question.GetContent()) { await CopyMediaAsync(oldDocument, newDocument, contentItem, tempMediaFolder); diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportDBStorageViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportDBStorageViewModel.cs index 9c0d1f4a..89bacc8a 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportDBStorageViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportDBStorageViewModel.cs @@ -213,8 +213,6 @@ internal async Task SelectAsync(DBNode item, CancellationToken cance var qText = new StringBuilder(); i--; - Question quest; - #region questionsReading while (++i < text.Length) @@ -229,10 +227,7 @@ internal async Task SelectAsync(DBNode item, CancellationToken cance if (qText.Length > 0) { - quest = theme.CreateQuestion(10 * (j - 1)); // Upgraded later - quest.Type.Name = QuestionTypes.Simple; - quest.Scenario.Clear(); - quest.Scenario.Add(qText.ToString().GrowFirstLetter().ClearPoints()); + theme.CreateQuestion(10 * (j - 1), text: qText.ToString().GrowFirstLetter().ClearPoints()); } int add = 3; @@ -255,20 +250,18 @@ internal async Task SelectAsync(DBNode item, CancellationToken cance } } + var questionText = qText.ToString().GrowFirstLetter().ClearPoints(); + if (final) { - quest = theme.CreateQuestion(0); - quest.Right[0] = node2["Answer"].InnerText.Trim().GrowFirstLetter().ClearPoints(); + var question = theme.CreateQuestion(0, text: questionText); + question.Right[0] = node2["Answer"].InnerText.Trim().GrowFirstLetter().ClearPoints(); } else { - quest = theme.CreateQuestion(10 * j); + theme.CreateQuestion(10 * j, text: questionText); } - quest.Scenario.Clear(); - quest.Scenario.Add(qText.ToString().GrowFirstLetter().ClearPoints()); - quest.Type.Name = QuestionTypes.Simple; - #endregion #region answersReading @@ -402,11 +395,6 @@ internal async Task SelectAsync(DBNode item, CancellationToken cance #endregion } - if (_appOptions.UpgradeNewPackages) - { - siDocument.Upgrade(); - } - return siDocument; } diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportSIStorageViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportSIStorageViewModel.cs index e5bb3145..6cf7b665 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportSIStorageViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportSIStorageViewModel.cs @@ -72,11 +72,7 @@ async Task loader(Uri uri, CancellationToken cancellationToken) ms.Position = 0; var doc = SIPackages.SIDocument.Load(ms); - - if (_appOptions.UpgradeNewPackages) - { - doc.Upgrade(); - } + doc.Upgrade(); return _documentViewModelFactory.CreateViewModelFor(doc); }; diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportTextViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportTextViewModel.cs index ac40a86a..fb53405c 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportTextViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/ImportTextViewModel.cs @@ -590,11 +590,6 @@ private Tuple Analyze() Resources.ThemesCollection, out int themesNum); - if (_existing != null && _appOptions.UpgradeNewPackages) - { - _existing.Upgrade(); - } - return Tuple.Create(result, themesNum); } diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/MainViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/MainViewModel.cs index 0611a58a..069d8afc 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/MainViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/MainViewModel.cs @@ -414,11 +414,7 @@ Task loader(CancellationToken cancellationToken) => Task.Run(() => // Loads in read only mode to keep file LastUpdate time unmodified var doc = SIDocument.Load(stream); - - if (_appOptions.UpgradeOpenedPackages) - { - doc.Upgrade(); - } + doc.Upgrade(); _logger.LogInformation("Document has been successfully opened. Path: {path}", path); @@ -582,11 +578,7 @@ private void ImportYaml_Executed(object? arg) } var doc = SIDocument.Create(package); - - if (_appOptions.UpgradeNewPackages) - { - doc.Upgrade(); - } + doc.Upgrade(); var docViewModel = _documentViewModelFactory.CreateViewModelFor(doc, Path.GetFileNameWithoutExtension(file)); docViewModel.Path = ""; diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/NewViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/NewViewModel.cs index 8d160c61..be44ab44 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/NewViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/NewViewModel.cs @@ -156,17 +156,13 @@ private void Create_Executed(object? arg) if (_currentTemplate.FileName != null) { siDocument = CreateFromCustomTemplate(_currentTemplate.FileName); + siDocument.Upgrade(); } else { siDocument = CreateFromStandardTemplate(); } - if (_appOptions.UpgradeNewPackages) - { - siDocument.Upgrade(); - } - OnNewItem(_documentViewModelFactory.CreateViewModelFor(siDocument)); _logger.LogInformation("New document created. Name: {name}", siDocument.Package.Name); OnClosed(); diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/QDocument.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/QDocument.cs index 0f871e18..f83bca44 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/QDocument.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/QDocument.cs @@ -246,38 +246,12 @@ internal void ClearLinks(QuestionViewModel question) return; } - foreach (var atom in question.Scenario) - { - ClearLinks(atom); - } - foreach (var content in question.Model.GetContent()) { ClearLinks(content); } } - internal void ClearLinks(AtomViewModel atom) - { - if (!AppSettings.Default.RemoveLinks || OperationsManager.IsMakingUndo) - { - return; - } - - var link = atom.Model.Text; - - if (!link.StartsWith("@")) // External link - { - return; - } - - if (!HasLinksTo(link)) // Called after items removal so works properly - { - var collection = GetCollectionByMediaType(atom.Model.Type); - RemoveFileByName(collection, link[1..]); - } - } - internal void ClearLinks(ContentItem contentItem) { if (!AppSettings.Default.RemoveLinks || OperationsManager.IsMakingUndo || !contentItem.IsRef) @@ -325,14 +299,6 @@ private bool HasLinksTo(string link) return true; } } - - foreach (var atom in question.Scenario) - { - if (atom.Text == link) - { - return true; - } - } } } } @@ -760,20 +726,6 @@ private void CreatePropertyListeners() foreach (var question in theme.Questions) { question.Model.PropertyChanged += Object_PropertyValueChanged; - question.Type.PropertyChanged += Object_PropertyValueChanged; - question.Type.Params.CollectionChanged += Object_CollectionChanged; - - foreach (var param in question.Type.Params) - { - param.PropertyChanged += Object_PropertyValueChanged; - } - - question.Scenario.CollectionChanged += Object_CollectionChanged; - - foreach (var atom in question.Model.Scenario) - { - atom.PropertyChanged += Object_PropertyValueChanged; - } if (question.Parameters != null) { @@ -986,66 +938,13 @@ private void Object_PropertyValueChanged(object? sender, PropertyChangedEventArg return; } - if (sender is QuestionTypeViewModel questionType) - { - OperationsManager.RecordComplexChange(() => OnQuestionTypeChanged(sender, e, ext, questionType)); - } - else - { - OperationsManager.AddChange( - new SimplePropertyValueChange - { - Element = sender, - PropertyName = e.PropertyName, - Value = ext.OldValue - }); - } - } - } - - private void OnQuestionTypeChanged(object? sender, PropertyChangedEventArgs e, ExtendedPropertyChangedEventArgs ext, QuestionTypeViewModel questionType) - { - OperationsManager.AddChange(new SimplePropertyValueChange - { - Element = sender, - PropertyName = e.PropertyName, - Value = ext.OldValue - }); - - foreach (var param in questionType.Params) - { - param.PropertyChanged -= Object_PropertyValueChanged; - } - - var typeName = questionType.Model.Name; - - if (typeName == QuestionTypes.Cat || - typeName == QuestionTypes.BagCat || - typeName == QuestionTypes.Auction || - typeName == QuestionTypes.Simple || - typeName == QuestionTypes.Sponsored) - { - while (questionType.Params.Count > 0) // Delete one be one to support undo operation (Undo reset does not work) - { - questionType.Params.RemoveAt(0); - } - } - - if (typeName == QuestionTypes.Cat || typeName == QuestionTypes.BagCat) - { - questionType.AddParam(QuestionTypeParams.Cat_Theme, ""); - questionType.AddParam(QuestionTypeParams.Cat_Cost, "0"); - - if (typeName == QuestionTypes.BagCat) - { - questionType.AddParam(QuestionTypeParams.BagCat_Self, QuestionTypeParams.BagCat_Self_Value_False); - questionType.AddParam(QuestionTypeParams.BagCat_Knows, QuestionTypeParams.BagCat_Knows_Value_After); - } - } - - foreach (var param in questionType.Params) - { - param.PropertyChanged += Object_PropertyValueChanged; + OperationsManager.AddChange( + new SimplePropertyValueChange + { + Element = sender, + PropertyName = e.PropertyName, + Value = ext.OldValue + }); } } @@ -1102,21 +1001,6 @@ private void Object_CollectionChanged(object? sender, NotifyCollectionChangedEve { var questionViewModel = (QuestionViewModel)itemViewModel; - questionViewModel.Type.PropertyChanged += Object_PropertyValueChanged; - questionViewModel.Type.Params.CollectionChanged += Object_CollectionChanged; - - foreach (var param in questionViewModel.Type.Params) - { - param.PropertyChanged += Object_PropertyValueChanged; - } - - questionViewModel.Scenario.CollectionChanged += Object_CollectionChanged; - - foreach (var atom in questionViewModel.Scenario) - { - atom.PropertyChanged += Object_PropertyValueChanged; - } - if (questionViewModel.Parameters != null) { AttachParametersListener(questionViewModel.Parameters); @@ -1130,11 +1014,6 @@ private void Object_CollectionChanged(object? sender, NotifyCollectionChangedEve } } } - else if (item is QuestionTypeViewModel type) - { - type.PropertyChanged += Object_PropertyValueChanged; - type.Params.CollectionChanged += Object_CollectionChanged; - } else if (item is StepParameterRecord parameter) { AttachParameterListeners(parameter); @@ -1170,21 +1049,6 @@ private void Object_CollectionChanged(object? sender, NotifyCollectionChangedEve { var questionViewModel = (QuestionViewModel)itemViewModel; - questionViewModel.Type.PropertyChanged -= Object_PropertyValueChanged; - questionViewModel.Type.Params.CollectionChanged -= Object_CollectionChanged; - - foreach (var param in questionViewModel.Type.Params) - { - param.PropertyChanged -= Object_PropertyValueChanged; - } - - questionViewModel.Scenario.CollectionChanged -= Object_CollectionChanged; - - foreach (var atom in questionViewModel.Scenario) - { - atom.PropertyChanged -= Object_PropertyValueChanged; - } - if (questionViewModel.Parameters != null) { DetachParametersLsteners(questionViewModel.Parameters); @@ -1198,11 +1062,6 @@ private void Object_CollectionChanged(object? sender, NotifyCollectionChangedEve } } } - else if (item is QuestionTypeViewModel type) - { - type.PropertyChanged -= Object_PropertyValueChanged; - type.Params.CollectionChanged -= Object_CollectionChanged; - } else if (item is StepParameterRecord parameter) { DetachParameterListeners(parameter); @@ -1576,54 +1435,6 @@ internal void NavigateToStorageItem(MediaStorageViewModel mediaStorage, MediaIte errors.Add($"{round.Model.Name}/{theme.Model.Name}/{question.Model.Price}: {Resources.MissingFile} \"{media.Uri}\"! {(allowExternal ? "" : Resources.ExternalLinksAreForbidden)}"); } } - - foreach (var atom in question.Scenario) - { - ICollection collection; - HashSet usedFiles; - - switch (atom.Model.Type) - { - case AtomTypes.Image: - collection = images; - usedFiles = usedImages; - break; - - case AtomTypes.Audio: - case AtomTypes.AudioNew: - collection = audio; - usedFiles = usedAudio; - break; - - case AtomTypes.Video: - collection = video; - usedFiles = usedVideo; - break; - - case AtomTypes.Html: - collection = html; - usedFiles = usedHtml; - break; - - default: - continue; - } - - var media = Document.GetLink(atom.Model); - - if (collection.Contains(media.Uri)) - { - usedFiles.Add(media.Uri); - } - else if (allowExternal && !atom.Model.Text.StartsWith("@")) - { - continue; - } - else - { - errors.Add($"{round.Model.Name}/{theme.Model.Name}/{question.Model.Price}: {Resources.MissingFile} \"{media.Uri}\"! {(allowExternal ? "" : Resources.ExternalLinksAreForbidden)}"); - } - } } } } @@ -1689,34 +1500,16 @@ internal void Paste_Executed(object? arg) var itemData = (InfoOwnerData)_clipboardService.GetData(ClipboardKey); var level = itemData.ItemLevel; - var isUpgraded = Package.IsUpgraded; - if (level == InfoOwnerData.Level.Round) { var round = (Round)itemData.GetItem(); - if (isUpgraded) - { - foreach (var theme in round.Themes) - { - foreach (var question in theme.Questions) - { - question.Upgrade(); - } - } - } - else + // Remove later + foreach (var theme in round.Themes) { - foreach (var theme in round.Themes) + foreach (var question in theme.Questions) { - foreach (var question in theme.Questions) - { - if (question.Parameters != null) - { - PlatformManager.Instance.ShowExclamationMessage(Resources.ObjectInNewFormat); - return; - } - } + question.Upgrade(); } } @@ -1740,23 +1533,10 @@ internal void Paste_Executed(object? arg) { var theme = (Theme)itemData.GetItem(); - if (isUpgraded) - { - foreach (var question in theme.Questions) - { - question.Upgrade(); - } - } - else + // Remove later + foreach (var question in theme.Questions) { - foreach (var question in theme.Questions) - { - if (question.Parameters != null) - { - PlatformManager.Instance.ShowExclamationMessage(Resources.ObjectInNewFormat); - return; - } - } + question.Upgrade(); } if (_activeNode is RoundViewModel myRound) @@ -1781,15 +1561,8 @@ internal void Paste_Executed(object? arg) { var question = (Question)itemData.GetItem(); - if (isUpgraded) - { - question.Upgrade(); - } - else if (question.Parameters != null) - { - PlatformManager.Instance.ShowExclamationMessage(Resources.ObjectInNewFormat); - return; - } + // Remove later + question.Upgrade(); if (_activeNode is ThemeViewModel myTheme) { @@ -1945,16 +1718,7 @@ private async void ImportSiq_Executed(object? arg) { using var stream = File.OpenRead(file); using var doc = SIDocument.Load(stream); - - if (Package.IsUpgraded) - { - doc.Upgrade(); - } - else if (doc.Package.Version >= 5.0) - { - PlatformManager.Instance.ShowExclamationMessage(Resources.PackageInNewFormat); - return; - } + doc.Upgrade(); CopyAuthorsAndSources(doc, doc.Package); @@ -1979,19 +1743,6 @@ private async void ImportSiq_Executed(object? arg) await ImportContentItemAsync(doc, item, contentImportTable); } - - if (!Package.IsUpgraded) - { - foreach (var atom in question.Scenario) - { - if (atom.Type != AtomTypes.Image && atom.Type != AtomTypes.Audio && atom.Type != AtomTypes.AudioNew && atom.Type != AtomTypes.Video && atom.Type != AtomTypes.Html) - { - continue; - } - - await ImportAtomAsync(doc, atom, scenarioImportTable); - } - } } } @@ -2048,47 +1799,6 @@ private async Task ImportContentItemAsync(SIDocument doc, ContentItem contentIte contentItem.Value = fileName; } - private async Task ImportAtomAsync(SIDocument doc, Atom atom, Dictionary scenarioImportTable) - { - var collection = doc.GetCollection(atom.Type); - var newCollection = GetCollectionByMediaType(atom.Type); - - var link = doc.GetLink(atom); - - if (link.GetStream == null) - { - return; - } - - if (scenarioImportTable.TryGetValue(link.Uri, out var newName)) - { - SIDocument.SetLink(atom, newName); - return; - } - - var fileName = FileHelper.GenerateUniqueFileName(link.Uri, name => newCollection.Files.Any(f => f.Model.Name == name)); - scenarioImportTable[link.Uri] = fileName; - - var tempPath = System.IO.Path.Combine( - System.IO.Path.GetTempPath(), - AppSettings.ProductName, - AppSettings.TempMediaFolderName, - Guid.NewGuid().ToString()); - - Directory.CreateDirectory(tempPath); - - var tempFile = System.IO.Path.Combine(tempPath, fileName); - - using (var fileStream = File.Create(tempFile)) - using (var mediaStream = link.GetStream().Stream) - { - await mediaStream.CopyToAsync(fileStream); - } - - newCollection.AddFile(tempFile); - SIDocument.SetLink(atom, fileName); - } - private void CopyAuthorsAndSources(SIDocument document, InfoOwner infoOwner) { var length = infoOwner.Info.Authors.Count; @@ -2329,13 +2039,7 @@ private void ExportMirc_Executed(object? arg) file.AppendLine(string.Format("[q{0}price]", qind)); file.AppendLine(question.Price.ToString()); file.AppendLine(string.Format("[q{0}type]", qind)); - file.AppendLine(question.Type.Name); - - foreach (QuestionTypeParam p in question.Type.Params) - { - file.AppendLine(string.Format("[q{0}{1}]", qind, p.Name)); - file.AppendLine(p.Value.Replace('[', '<').Replace(']', '>')); - } + file.AppendLine(question.TypeName); var qText = new StringBuilder(); var showmanComments = new StringBuilder(); @@ -2386,41 +2090,6 @@ private void ExportMirc_Executed(object? arg) } } - foreach (var item in question.Scenario) - { - if (item.Type == AtomTypes.Image) - { - if (showmanComments.Length > 0) - showmanComments.AppendLine(); - - showmanComments.Append($"* {Resources.MircImage}: "); - showmanComments.Append(item.Text); - } - else if (item.Type == AtomTypes.Audio || item.Type == AtomTypes.AudioNew) - { - if (showmanComments.Length > 0) - showmanComments.AppendLine(); - - showmanComments.Append($"* {Resources.MircAudio}: "); - showmanComments.Append(item.Text); - } - else if (item.Type == AtomTypes.Video) - { - if (showmanComments.Length > 0) - showmanComments.AppendLine(); - - showmanComments.Append($"* {Resources.MircVideo}: "); - showmanComments.Append(item.Text); - } - else - { - if (qText.Length > 0) - qText.AppendLine(); - - qText.Append(item.Text); - } - } - var comments = question.Info.Comments.Text.GrowFirstLetter().EndWithPoint(); if (showmanComments.Length == 0 || comments.Length > 0) @@ -2976,14 +2645,6 @@ private void WikifyAsync() foreach (var quest in theme.Questions) { - foreach (var atom in quest.Scenario) - { - if (atom.Model.Type == AtomTypes.Text) - { - atom.Model.Text = atom.Model.Text.Wikify(); - } - } - foreach (var item in quest.Model.GetContent()) { if (item.Type == ContentTypes.Text) @@ -3061,8 +2722,6 @@ private void ConvertToCompTvSI_Executed(object? arg) { try { - var upgraded = Package.IsUpgraded; - var allthemes = new List(); using var change = OperationsManager.BeginComplexChange(); @@ -3114,7 +2773,7 @@ private void ConvertToCompTvSI_Executed(object? arg) if (themeViewModel.Questions.Count <= k) { - var question = PackageItemsHelper.CreateQuestion(100 * (i + 1) * (k + 1), upgraded); + var question = PackageItemsHelper.CreateQuestion(100 * (i + 1) * (k + 1)); questionViewModel = new QuestionViewModel(question); themeViewModel.Questions.Add(questionViewModel); @@ -3125,14 +2784,6 @@ private void ConvertToCompTvSI_Executed(object? arg) questionViewModel.Model.Price = (100 * (i + 1) * (k + 1)); } - foreach (var atom in questionViewModel.Scenario) - { - if (atom.Model.Type == AtomTypes.Text) - { - atom.Model.Text = atom.Model.Text.ClearPoints().GrowFirstLetter(); - } - } - if (questionViewModel.Right.Count > 0) { questionViewModel.Right[0] = questionViewModel.Right[0].ClearPoints().GrowFirstLetter(); @@ -3163,7 +2814,7 @@ private void ConvertToCompTvSI_Executed(object? arg) if (themeViewModel.Questions.Count == 0) { - var question = PackageItemsHelper.CreateQuestion(0, upgraded); + var question = PackageItemsHelper.CreateQuestion(0); questionViewModel = new QuestionViewModel(question); themeViewModel.Questions.Add(questionViewModel); @@ -3174,11 +2825,6 @@ private void ConvertToCompTvSI_Executed(object? arg) questionViewModel.Model.Price = 0; } - foreach (var atom in questionViewModel.Scenario) - { - atom.Model.Text = atom.Model.Text.ClearPoints(); - } - if (questionViewModel.Right.Count > 0) { questionViewModel.Right[0] = questionViewModel.Right[0].ClearPoints().GrowFirstLetter(); @@ -3252,34 +2898,6 @@ private void ConvertToCompTvSISimple_Executed(object? arg) } } - var singleAtom = theme.Questions.Count > 1 && theme.Questions[0].Scenario.Count > 1 ? theme.Questions[0].Scenario[0].Model.Text : null; - - if (singleAtom != null) - { - var allAtomsTheSame = true; - - for (int i = 1; i < theme.Questions.Count; i++) - { - var scenario = theme.Questions[i].Scenario; - - if (scenario.Count < 2 || scenario[0].Model.Text != singleAtom) - { - allAtomsTheSame = false; - break; - } - } - - if (allAtomsTheSame) - { - for (int i = 0; i < theme.Questions.Count; i++) - { - theme.Questions[i].Scenario.RemoveAt(0); - } - - theme.Info.Comments.Text += singleAtom; - } - } - WikifyInfoOwner(theme); foreach (var quest in theme.Questions) @@ -3324,35 +2942,6 @@ private void ConvertToCompTvSISimple_Executed(object? arg) } } } - - foreach (var atom in quest.Scenario) - { - if (atom.Model.Type == AtomTypes.Text) - { - var text = atom.Model.Text; - - if (text != null) - { - atom.Model.Text = text.Wikify().ClearPoints().GrowFirstLetter(); - } - } - } - - if (quest.Type.Name == QuestionTypes.Cat || quest.Type.Name == QuestionTypes.BagCat) - { - foreach (var param in quest.Type.Params) - { - if (param.Model.Name == QuestionTypeParams.Cat_Theme) - { - var val = param.Model.Value; - - if (val != null) - { - param.Model.Value = val.Wikify().ToUpper().ClearPoints(); - } - } - } - } } } } @@ -3519,11 +3108,6 @@ private void ToggleMedia(bool expand) { foreach (var quest in theme.Questions) { - foreach (var atom in quest.Scenario) - { - atom.IsExpanded = expand; - } - if (quest.Parameters != null) { foreach (var parameter in quest.Parameters) @@ -3595,36 +3179,6 @@ internal void LoadMediaFromFolder(string folder) mediaStorage.AddFile(mediaFileName); } - - foreach (var atom in question.Scenario) - { - if (!atom.Model.IsLink) - { - continue; - } - - var link = Document.GetLink(atom.Model); - var mediaStorage = GetCollectionByMediaType(atom.Model.Type); - - if (mediaStorage.Files.Any(f => f.Model.Name == link.Uri)) - { - continue; - } - - var mediaFileName = System.IO.Path.Combine(folder, link.Uri); - - if (!File.Exists(mediaFileName)) - { - mediaFileName = System.IO.Path.Combine(folder, mediaStorage.Name, link.Uri); - - if (!File.Exists(mediaFileName)) - { - continue; - } - } - - mediaStorage.AddFile(mediaFileName); - } } } } @@ -3802,36 +3356,17 @@ private void MergePackage(Package package) questionViewModel.Info.Comments.Text = question.Info.Comments.Text; questionViewModel.Model.Price = question.Price; - questionViewModel.Type.Name = question.Type.Name; + questionViewModel.Model.TypeName = question.TypeName; questionViewModel.Right.Merge(question.Right); questionViewModel.Wrong.Merge(question.Wrong); - questionViewModel.Type.Params.Merge( - question.Type.Params, - p => new QuestionTypeParamViewModel(p), - (vm, p) => - { - vm.Model.Name = p.Name; - vm.Model.Value = p.Value; - }); - if (question.Parameters != null && questionViewModel.Parameters != null) { questionViewModel.Parameters.Merge( question.Parameters.ToList(), p => new StepParameterRecord(p.Key, new StepParameterViewModel(questionViewModel, p.Value))); } - - questionViewModel.Scenario.Merge( - question.Scenario, - atom => new AtomViewModel(atom), - (atomViewModel, atom) => - { - atomViewModel.Model.Type = atom.Type; - atomViewModel.Model.Text = atom.Text; - atomViewModel.Model.AtomTime = atom.AtomTime; - }); }); }); }); diff --git a/src/SIQuester/SIQuester.ViewModel/Workspaces/Sidebar/MediaStorageViewModel.cs b/src/SIQuester/SIQuester.ViewModel/Workspaces/Sidebar/MediaStorageViewModel.cs index 2388a13b..c0aa7988 100644 --- a/src/SIQuester/SIQuester.ViewModel/Workspaces/Sidebar/MediaStorageViewModel.cs +++ b/src/SIQuester/SIQuester.ViewModel/Workspaces/Sidebar/MediaStorageViewModel.cs @@ -401,15 +401,6 @@ private void NavigateToUsage_Executed(object? arg) return; } } - - foreach (var atom in question.Model.Scenario) - { - if (atom.IsLink && atom.Text.ExtractLink() == item.Name) - { - _document.Navigate.Execute(question); - return; - } - } } } } diff --git a/src/SIQuester/SIQuester/App.xaml b/src/SIQuester/SIQuester/App.xaml index a976dd74..f3fabbbf 100644 --- a/src/SIQuester/SIQuester/App.xaml +++ b/src/SIQuester/SIQuester/App.xaml @@ -77,7 +77,6 @@ - @@ -305,27 +304,16 @@ - - - - - @@ -349,13 +337,6 @@ - - - - - - - @@ -366,45 +347,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1326,12 +1273,12 @@ - + - + - - - - - - - - - - - @@ -1424,17 +1360,6 @@ - - - - - - - - - @@ -1533,149 +1458,6 @@ - - -