2021-02-21 21:52:41 -06:00
|
|
|
// Decompiled with JetBrains decompiler
|
|
|
|
|
// Type: ZuneUI.NotifyChoice
|
|
|
|
|
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
|
|
|
|
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
|
|
|
|
|
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
|
|
|
|
|
|
|
|
|
|
using Microsoft.Iris;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
|
|
|
|
namespace ZuneUI
|
|
|
|
|
{
|
|
|
|
|
public class NotifyChoice : Choice
|
|
|
|
|
{
|
|
|
|
|
private InvokePolicy _invokePolicy;
|
|
|
|
|
|
|
|
|
|
public NotifyChoice()
|
2021-02-21 22:59:09 -06:00
|
|
|
: this(null)
|
2021-02-21 21:52:41 -06:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public NotifyChoice(IModelItemOwner owner)
|
|
|
|
|
: this(owner, InvokePolicy.Synchronous)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public NotifyChoice(IModelItemOwner owner, InvokePolicy invokePolicy)
|
|
|
|
|
: base(owner)
|
|
|
|
|
=> this._invokePolicy = invokePolicy;
|
|
|
|
|
|
|
|
|
|
protected override void OnChosenChanged()
|
|
|
|
|
{
|
|
|
|
|
if (this.ChosenValue == null)
|
|
|
|
|
return;
|
|
|
|
|
((Command)this.ChosenValue).Invoke(this._invokePolicy);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void ValidateOptionsListWorker(IList potentialOptions)
|
|
|
|
|
{
|
|
|
|
|
base.ValidateOptionsListWorker(potentialOptions);
|
|
|
|
|
if (potentialOptions == null)
|
|
|
|
|
return;
|
2021-02-21 22:59:09 -06:00
|
|
|
foreach (object potentialOption in potentialOptions)
|
2021-02-21 21:52:41 -06:00
|
|
|
{
|
|
|
|
|
if (!(potentialOption is Command))
|
|
|
|
|
throw new ArgumentException("Contents must be of type Command");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|