private void setupCustomization()
    {
        CustomizationContext.EventBus.DispatchEvent(default(CustomizerWidgetEvents.ShowCoinCountWidget));
        CustomizerAvatarController componentInChildren = dependencies.CustomizerAvatarPreview.GetComponentInChildren <CustomizerAvatarController>();
        CustomizationContext       component           = currentLoadedScreen.GetComponent <CustomizationContext>();

        component.Init(componentInChildren, dependencies.DefaultChannelTextures, currentInventoryCategory);
    }
	public override void OnEnter()
	{
		CustomizationContext customizationContext = Object.FindObjectOfType<CustomizationContext>();
		if (customizationContext == null)
		{
			Disney.LaunchPadFramework.Log.LogErrorFormatted(this, "Unable to find CustomizationContext, assuming we already in state {0}", CustomizerState);
			Finish();
		}
		else if (customizationContext.CustomizerState == CustomizerState)
		{
			Finish();
		}
		else
		{
			CustomizationContext.EventBus.AddListener<CustomizerModelEvents.CustomizerStateChangedEvent>(onStateChanged);
		}
	}
        public static async Task UpdateStandardVariablesConfiguration(AuthenticatedClient client, CustomizationContext ctx, Action <string> onFeedback)
        {
            try
            {
                if (ctx.Step == CustomizationSteps.Manual)
                {
                    onFeedback = async msg => { await Console.Out.WriteLineAsync(msg); };
                }
                else if (onFeedback == null)
                {
                    onFeedback = _ => { }
                }
                ;

                var helper = new CustomizationHelper(client, ctx, onFeedback);

                switch (ctx.Step)
                {
                case CustomizationSteps.Manual:
                    if (helper.WhatIf)
                    {
                        helper.SendFeedback("***********************************************************");
                        helper.SendFeedback("**  RUNNING IN WHATIF MODE, NO CHANGES WILL BE APPLIED   **");
                        helper.SendFeedback("***********************************************************");
                    }
                    if (outputJsonInsteadOfCreatingVariables)
                    {
                        helper.SendFeedback("***********************************************************");
                        helper.SendFeedback("**  PRODUCTION OF A JSON FILE, NO VARIABLES CREATION     **");
                        helper.SendFeedback("***********************************************************");
                    }
                    if (SingleSourceIdIsSpecified(helper))
                    {
                        await HandleManualCustomizationOnSingleSourceId(helper);
                    }
                    else
                    {
                        await HandleManualCustomizationOnAllSources(helper);
                    }
                    await Console.Out.WriteLineAsync("Press any key to exit...");

                    Console.ReadKey();
                    break;

                case CustomizationSteps.AfterSourceCreation:
                case CustomizationSteps.AfterSourceMove:
                case CustomizationSteps.AfterSourceUpdate:
                    await HandleAutomatedCustomization(helper);

                    break;

                default:
                    //helper.SendFeedback($"The step {ctx.Step} is not implemented in Eoly customization");
                    return;
                }
            }
            catch (Exception ex)
            {
                onFeedback?.Invoke($"Exception handling customization event <{ctx.Step}> for business key<{ctx.BusinessKey}> on account <{ctx.AccountId}>: {ex}");
            }
        }
예제 #4
0
 public CustomizationHelper(AuthenticatedClient client, CustomizationContext ctx, Action <string> onFeedback)
 {
     Client          = client;
     Context         = ctx;
     this.onFeedback = onFeedback;
 }