Fixed ColorBlock parsing to respect comments, preventing overflow errors when numbers are present in comments on these lines.
This commit is contained in:
@@ -260,7 +260,10 @@ namespace Filtration.Translators
|
||||
private static void AddColorItemToBlockItems<T>(ItemFilterBlock block, string inputString) where T : ColorBlockItem
|
||||
{
|
||||
var blockItem = Activator.CreateInstance<T>();
|
||||
blockItem.Color = GetColorFromString(inputString);
|
||||
var result = Regex.Matches(inputString, @"([\w\s]*)[#]?(.*)");
|
||||
|
||||
// When Theme support is added result[0].Groups[2].Value will contain the ColorGroup in the comment if it exists.
|
||||
blockItem.Color = GetColorFromString(result[0].Groups[1].Value);
|
||||
block.BlockItems.Add(blockItem);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ namespace Filtration.ViewModels
|
||||
ItemFilterScript Script { get; }
|
||||
IItemFilterBlockViewModel SelectedBlockViewModel { get; set; }
|
||||
IItemFilterBlockViewModel SectionBrowserSelectedBlockViewModel { get; set; }
|
||||
ObservableCollection<ItemFilterBlockGroup> BlockGroups { get; }
|
||||
IEnumerable<IItemFilterBlockViewModel> ItemFilterSectionViewModels { get; }
|
||||
Predicate<IItemFilterBlockViewModel> BlockFilterPredicate { get; set; }
|
||||
bool IsDirty { get; }
|
||||
@@ -183,11 +182,6 @@ namespace Filtration.ViewModels
|
||||
|
||||
public ItemFilterScript Script { get; private set; }
|
||||
|
||||
public ObservableCollection<ItemFilterBlockGroup> BlockGroups
|
||||
{
|
||||
get { return Script.ItemFilterBlockGroups; }
|
||||
}
|
||||
|
||||
public bool IsDirty
|
||||
{
|
||||
get { return _isDirty || HasDirtyChildren; }
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using Filtration.Models;
|
||||
using Filtration.Repositories;
|
||||
using Filtration.Services;
|
||||
using Filtration.Translators;
|
||||
using Filtration.Views;
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
using GalaSoft.MvvmLight.Messaging;
|
||||
using Clipboard = System.Windows.Clipboard;
|
||||
using MessageBox = System.Windows.Forms.MessageBox;
|
||||
using OpenFileDialog = Microsoft.Win32.OpenFileDialog;
|
||||
|
||||
namespace Filtration.ViewModels
|
||||
|
||||
Reference in New Issue
Block a user