public DialogContext(DialogType type, IApplicationLicenseKey key, ILicenseProfile profile) { this.Key = key; this.Profile = profile; switch (type) { case DialogType.Steam: this.Content = new AddSteamKey(); break; case DialogType.UserNamePassword: this.Content = new AddSteamKey(false); break; case DialogType.Executable: case DialogType.Process: this.Content = new AddProcessKey(); break; case DialogType.Registry: this.Content = new AddRegistryKey(); break; case DialogType.RegistryImport: this.Content = new RegistryImportKey(); break; default: break; } }
/// <summary> /// Creates new ApplicationLicense instance. /// </summary> /// <param name="key">License key.</param> public ApplicationLicense(IApplicationLicenseKey key) { if (key != null) { this.Key = key; } else { throw new ArgumentNullException("Key", "License key may not be null."); } }
public override IApplicationLicenseKey EditLicense(IApplicationLicenseKey key, ILicenseProfile profile, ref bool additionHandled, Window owner) { var context = new DialogContext(DialogType.Process, key, profile); if (context.Display(owner)) { return context.Key; } else { return null; } }
public override IApplicationLicenseKey EditLicense(IApplicationLicenseKey key, ILicenseProfile profile, ref bool additionHandled, Window owner) { var context = new DialogContext(DialogType.Steam, key, profile); return context.Display(owner) ? context.Key : null; }
public virtual IApplicationLicenseKey EditLicense(IApplicationLicenseKey key, ILicenseProfile profile, ref bool additionHandled, Window owner) { return(null); }