chore: use file-scoped namespace

This commit is contained in:
NaBian committed 2022-03-13 20:28:58 +08:00
1 parent 99d2fafb72
commit bbf1b7d4c6
748 files changed
+57929 -58678

No files matched your search

@@ -1,46 +1,45 @@
using System;
using System.Windows;
namespace HandyControl.Interactivity
namespace HandyControl.Interactivity;
public class TriggerActionCollection : AttachableCollection<TriggerAction>
{
public class TriggerActionCollection : AttachableCollection<TriggerAction>
internal TriggerActionCollection()
{
internal TriggerActionCollection()
{
}
protected override Freezable CreateInstanceCore()
{
return new TriggerActionCollection();
}
internal override void ItemAdded(TriggerAction item)
{
if (item.IsHosted)
throw new InvalidOperationException(ExceptionStringTable
.CannotHostTriggerActionMultipleTimesExceptionMessage);
if (AssociatedObject != null)
item.Attach(AssociatedObject);
item.IsHosted = true;
}
internal override void ItemRemoved(TriggerAction item)
{
if (((IAttachedObject) item).AssociatedObject != null)
item.Detach();
item.IsHosted = false;
}
protected override void OnAttached()
{
foreach (var action in this)
action.Attach(AssociatedObject);
}
protected override void OnDetaching()
{
foreach (var action in this)
action.Detach();
}
}
}
protected override Freezable CreateInstanceCore()
{
return new TriggerActionCollection();
}
internal override void ItemAdded(TriggerAction item)
{
if (item.IsHosted)
throw new InvalidOperationException(ExceptionStringTable
.CannotHostTriggerActionMultipleTimesExceptionMessage);
if (AssociatedObject != null)
item.Attach(AssociatedObject);
item.IsHosted = true;
}
internal override void ItemRemoved(TriggerAction item)
{
if (((IAttachedObject) item).AssociatedObject != null)
item.Detach();
item.IsHosted = false;
}
protected override void OnAttached()
{
foreach (var action in this)
action.Attach(AssociatedObject);
}
protected override void OnDetaching()
{
foreach (var action in this)
action.Detach();
}
}