/// <summary> /// Serializes this instance of <see cref="VmResources" /> into a <see cref="Carbon.Json.JsonNode" />. /// </summary> /// <param name="container">The <see cref="Carbon.Json.JsonObject"/> container to serialize this object into. If the caller /// passes in <c>null</c>, a new instance will be created and returned to the caller.</param> /// <param name="serializationMode">Allows the caller to choose the depth of the serialization. See <see cref="Microsoft.Rest.ClientRuntime.SerializationMode"/>.</param> /// <returns> /// a serialized instance of <see cref="VmResources" /> as a <see cref="Carbon.Json.JsonNode" />. /// </returns> public Carbon.Json.JsonNode ToJson(Carbon.Json.JsonObject container, Microsoft.Rest.ClientRuntime.SerializationMode serializationMode) { container = container ?? new Carbon.Json.JsonObject(); bool returnNow = false; BeforeToJson(ref container, ref returnNow); if (returnNow) { return(container); } AddIf(null != BootConfig ? (Carbon.Json.JsonNode)BootConfig.ToJson(null) : null, "boot_config", container.Add); if (null != DiskList) { var __x = new Carbon.Json.XNodeArray(); foreach (var __y in DiskList) { AddIf(__y?.ToJson(null), __x.Add); } container.Add("disk_list", __x); } if (null != GpuList) { var __s = new Carbon.Json.XNodeArray(); foreach (var __t in GpuList) { AddIf(__t?.ToJson(null), __s.Add); } container.Add("gpu_list", __s); } AddIf(null != GuestCustomization ? (Carbon.Json.JsonNode)GuestCustomization.ToJson(null) : null, "guest_customization", container.Add); AddIf(null != GuestOsId ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(GuestOsId) : null, "guest_os_id", container.Add); AddIf(null != GuestTools ? (Carbon.Json.JsonNode)GuestTools.ToJson(null) : null, "guest_tools", container.Add); AddIf(null != HardwareClockTimezone ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(HardwareClockTimezone) : null, "hardware_clock_timezone", container.Add); AddIf(null != MemorySizeMib ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)MemorySizeMib) : null, "memory_size_mib", container.Add); if (null != NicList) { var __n = new Carbon.Json.XNodeArray(); foreach (var __o in NicList) { AddIf(__o?.ToJson(null), __n.Add); } container.Add("nic_list", __n); } AddIf(null != NumSockets ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)NumSockets) : null, "num_sockets", container.Add); AddIf(null != NumVcpusPerSocket ? (Carbon.Json.JsonNode) new Carbon.Json.JsonNumber((int)NumVcpusPerSocket) : null, "num_vcpus_per_socket", container.Add); AddIf(null != ParentReference ? (Carbon.Json.JsonNode)ParentReference.ToJson(null) : null, "parent_reference", container.Add); AddIf(null != PowerState ? (Carbon.Json.JsonNode) new Carbon.Json.JsonString(PowerState) : null, "power_state", container.Add); AddIf(null != PowerStateMechanism ? (Carbon.Json.JsonNode)PowerStateMechanism.ToJson(null) : null, "power_state_mechanism", container.Add); AddIf(null != VgaConsoleEnabled ? (Carbon.Json.JsonNode) new Carbon.Json.JsonBoolean((bool)VgaConsoleEnabled) : null, "vga_console_enabled", container.Add); AddIf(null != VnumaConfig ? (Carbon.Json.JsonNode)VnumaConfig.ToJson(null) : null, "vnuma_config", container.Add); AfterToJson(ref container); return(container); }
protected void Application_Start() { BootConfig.Register(); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); AuthConfig.RegisterAuth(); }
private static void BuildPlayerHandler() { #if UNITY_ANDROID BootConfig bootConfig = Util.FindScriptableObject <BootConfig>(); bootConfig.buildNumber = PlayerSettings.Android.bundleVersionCode; EditorUtility.SetDirty(bootConfig); #endif if (EditorUtility.DisplayDialog("Build with Addressables", "Do you want to build a clean addressables before export?", "Build with Addressables", "Skip")) { PreExport(); } }
private DeviceAppAttributes BuildDeviceAppAttributes() { string appVersion = ""; var appName = ApplicationInformationService.GetApplicationDisplayNameAsync().Result; var packageVersion = Package.Current.Id.Version; appVersion = packageVersion.Major + "." + packageVersion.Minor + "." + packageVersion.Build; var osVersion = GetDeviceFamilyVersion(AnalyticsInfo.VersionInfo.DeviceFamilyVersion); var osName = "windows"; var appType = ApplicationInformationService.GetAppType(); var mobileSdkVersion = SDKManager.SDK_VERSION; var deviceModel = new EasClientDeviceInformation().SystemProductName; ; var deviceId = new EasClientDeviceInformation().Id.ToString(); var clientId = BootConfig.GetBootConfig().Result.ClientId; return(new DeviceAppAttributes(appVersion, appName, osVersion, osName, appType, mobileSdkVersion, deviceModel, deviceId, clientId)); }
public MotionBoot( JesterEntity owner, PlayerModel playerModel, FlightStatsModel flightStatsmodel, UserInputModel userInputModel, BootConfig bootConfig) : base(owner) { _playerModel = playerModel; _flightStatsmodel = flightStatsmodel; _userInputModel = userInputModel; _bootConfig = bootConfig; OnKickActionSubscription = _userInputModel.OnClickedAnywhere .Subscribe(_ => OnKickUserAction()) .AddTo(owner); OnJesterKickedSubscription = owner.OnKicked .Subscribe(_ => OnJesterKicked()) .AddTo(owner); _kickForceTweener = DOTween .To((x) => _flightStatsmodel.RelativeKickForce.Value = x, _bootConfig.MinForceFactor, _bootConfig.MaxForceFactor, _bootConfig.ForceFactorChangeSeconds) .SetLoops(-1, LoopType.Yoyo); Owner.IsPaused.Subscribe(isPaused => { if (isPaused && _kickForceTweener.IsPlaying()) { _kickForceTweener?.Pause(); } else if (!_kickForceTweener.IsPlaying()) { _kickForceTweener?.Play(); } }) .AddTo(owner); }