Add requested changes
This commit is contained in:
parent
8f0f73f185
commit
c260014a16
|
@ -180,24 +180,16 @@ namespace Filtration.ViewModels
|
|||
_scriptCommandManager = Script.CommandManager;
|
||||
AddItemFilterBlockViewModels(Script.ItemFilterBlocks, -1);
|
||||
|
||||
foreach(var block in Script.ItemFilterBlocks)
|
||||
foreach(var block in Script.ItemFilterBlocks.OfType<IItemFilterBlock>())
|
||||
{
|
||||
var itemBlock = block as IItemFilterBlock;
|
||||
if(itemBlock != null)
|
||||
foreach (var customSoundBlockItem in block.BlockItems.OfType<CustomSoundBlockItem>())
|
||||
{
|
||||
foreach(var blockItem in itemBlock.BlockItems)
|
||||
{
|
||||
var customSoundBlockItem = blockItem as CustomSoundBlockItem;
|
||||
if (customSoundBlockItem != null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(customSoundBlockItem.Value) && _customSoundsAvailable.IndexOf(customSoundBlockItem.Value) < 0)
|
||||
if (!string.IsNullOrWhiteSpace(customSoundBlockItem.Value) && CustomSoundsAvailable.IndexOf(customSoundBlockItem.Value) < 0)
|
||||
{
|
||||
CustomSoundsAvailable.Add(customSoundBlockItem.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Script.ItemFilterBlocks.CollectionChanged += ItemFilterBlocksOnCollectionChanged;
|
||||
_customSoundsAvailable.CollectionChanged += CustomSoundsAvailableOnCollectionChanged;
|
||||
|
@ -273,12 +265,9 @@ namespace Filtration.ViewModels
|
|||
var itemBlock = itemFilterBlock as IItemFilterBlock;
|
||||
if (itemBlock != null)
|
||||
{
|
||||
foreach (var blockItem in itemBlock.BlockItems)
|
||||
foreach (var customSoundBlockItem in itemBlock.BlockItems.OfType<CustomSoundBlockItem>())
|
||||
{
|
||||
var customSoundBlockItem = blockItem as CustomSoundBlockItem;
|
||||
if (customSoundBlockItem != null)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(customSoundBlockItem.Value) && _customSoundsAvailable.IndexOf(customSoundBlockItem.Value) < 0)
|
||||
if (!string.IsNullOrWhiteSpace(customSoundBlockItem.Value) && CustomSoundsAvailable.IndexOf(customSoundBlockItem.Value) < 0)
|
||||
{
|
||||
CustomSoundsAvailable.Add(customSoundBlockItem.Value);
|
||||
}
|
||||
|
@ -286,7 +275,6 @@ namespace Filtration.ViewModels
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveItemFilterBlockviewModels(IEnumerable<IItemFilterBlockBase> itemFilterBlocks)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue