logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class CreatePrefetchPolicyWindow

    Step-by-step window for creating or updating a PrefetchPolicyRegistry asset and the PrefetchPolicyProfile assets it references. The stepped-wizard scaffolding — the header and breadcrumb, the body scroll, the footer and its error gate — comes from Serenity.Global.Infrastructure.Editor.SerenityStepWizardWindow`1; this window declares only its own step table and what the primary action does. It never mutates an asset directly: the window only collects input, PrefetchPolicyCreator does the actual work. The registry's get-or-create resolution goes through Serenity.Global.Infrastructure.Editor.SerenityWizardTargetAsset/Serenity.Global.Infrastructure.Editor.SerenityWizardTargetAssetGui; the profile rows themselves — their lifecycle, drawing, and row-binding validation — live in PrefetchPolicyProfileRowsEditor, this window's own row collaborator.

    Every profile row is its own Serenity.Global.Infrastructure.Editor.SerenityWizardScratchDraft<>, seeded from the registry's own Profiles on a real target change, so reopening the wizard and confirming with zero edits can never revert a real field — e.g. MaxSizeMB — to a template default. A row seeded from an existing profile stays bound to THAT asset, never re-resolved by Id: retyping its Id renames that SAME asset, never re-targets onto whatever a DIFFERENT existing profile the new string happens to match (see CreateFromDrafts(IReadOnlyList<SerenityWizardScratchDraft<PrefetchPolicyProfile>>, string, string, bool, UnboundRowWriteMode)) — including across a domain reload, which Serenity.Global.Infrastructure.Editor.SerenityWizardDraftListLifecycle`1 keeps every row's source bound through. ValidateRowBindings blocks the primary action before that write ever runs when a row's current Id collides with a different existing profile.

    Inheritance
    object
    CreatePrefetchPolicyWindow
    Namespace: Serenity.AssetPrefetcher.Infrastructure.Editor.Builder
    Assembly: Serenity.UnityAssetPrefetcher.Infrastructure.Editor.dll
    Syntax
    public sealed class CreatePrefetchPolicyWindow : SerenityStepWizardWindow<CreatePrefetchPolicyWindow.WizardStep>

    Constructors

    CreatePrefetchPolicyWindow()

    Declaration
    public CreatePrefetchPolicyWindow()

    Properties

    OwnedTargets

    Declaration
    protected override IEnumerable<SerenityWizardTargetAsset> OwnedTargets { get; }
    Property Value
    Type Description
    IEnumerable<SerenityWizardTargetAsset>

    PrimaryButtonLabel

    Declaration
    protected override string PrimaryButtonLabel { get; }
    Property Value
    Type Description
    string

    WindowTitle

    Declaration
    protected override string WindowTitle { get; }
    Property Value
    Type Description
    string

    Methods

    BuildSteps()

    Declaration
    protected override WizardStepDescriptor<CreatePrefetchPolicyWindow.WizardStep>[] BuildSteps()
    Returns
    Type Description
    WizardStepDescriptor<WizardStep>[]

    OnBeforeDrawStep()

    Adopts a target the reader picked and left in the same frame, before any step draws — the pick happens inside the Configure step's own body, too late for that step to react to it itself. Otherwise ensures every row's scratch draft survived — see Serenity.AssetPrefetcher.Infrastructure.Editor.Builder.CreatePrefetchPolicyWindow._profileRows's own remarks.

    Declaration
    protected override void OnBeforeDrawStep()

    OnPrimaryAction()

    Lands on Done through Serenity.Global.Infrastructure.Editor.SerenityStepWizardWindow`1.PingAndGoTo(System.String,`0,System.Boolean) rather than Serenity.Global.Infrastructure.Editor.SerenityStepWizardWindow`1.FinishWithAsset(System.String,`0): this wizard has never entered the controller's terminal state, and it does not need to. The stale-validation defect terminal state hides is already answered by the _target.Pick below — the write's own asset becomes the update target, so revalidating never reports it as a collision — while the Configure step's error gate stays live for the next run, which terminal state would switch off permanently (nothing in this window clears it: its Done panel offers no "Create Another").

    Declaration
    protected override void OnPrimaryAction()

    Open()

    Declaration
    public static void Open()
    In this article
    © 2026 Serenity. All Rights Reserved