public bool Init() { length = myRenderer.bounds.size.x; if (length <= 0.0f) { return(false); } length *= 1.0f - intersectionAmount; var cloneOffset = length / transform.localScale.x; var leftClone = CreateChildClone(-cloneOffset); var rightClone = CreateChildClone(cloneOffset); leftClone.transform.SetParent(transform, false); rightClone.transform.SetParent(transform, false); InitializedEvent?.Invoke(this, new ScrollEventArgs { PositionX = startPos.x, Offset = length }); return(true); }
public bool Start(string[] args) { if (Running) { throw new Exception("Server is already running"); } log.WriteLine(); log.WriteLine(" = Minecraft Server \"obsidian\" ="); log.WriteLine(); if (!ParseParameters(args)) { return(false); } Commands.Init(); lua.errorLog = "error.log"; Log("Using initfile '" + initfile + "'."); if (!lua.Start(initfile)) { return(false); } string error; Log("", false); Groups.Load(Commands, out error); Log(""); if (error != null) { Log("Error: " + error); return(false); } Log("", false); Accounts.Load(Groups); Log(""); if (level == null) { Log("Error: No level loaded."); return(false); } level.server = this; if (!listener.Start(port)) { Log("Error: Server creation failed, port " + port + " already in use?"); return(false); } Log("Server is running on port " + port + "."); InitializedEvent.Raise(this); heartbeat.Start(1000 * 55); if (heartbeat.Send()) { File.WriteAllText("externalurl.txt", heartbeat.url); Log("URL saved to externalurl.txt.\n " + heartbeat.url); } updateThread.Start(); Queue.Start(); return(true); }
private static void StartMessageLoop() { try { if (MainForm.Create() != null) { Log.Init(); _appContext = new ApplicationContext(TheForm); Application.Run(_appContext); } } finally { InitializedEvent.Set(); } }
async Task <Unit> IRequestHandler <InitializedEvent, Unit> .Handle(InitializedEvent request, CancellationToken cancellationToken) { await DebugAdapterEventingHelper.Run( _initializedDelegates, (handler, ct) => handler(this, ClientSettings, ServerSettings, ct), _initializedHandlers.Union(_collection.Select(z => z.Handler).OfType <IOnDebugAdapterClientInitialized>()), (handler, ct) => handler.OnInitialized(this, ClientSettings, ServerSettings, ct), _concurrency, cancellationToken ); _initializedComplete.OnNext(request); _initializedComplete.OnCompleted(); return(Unit.Value); }
public IEnumerator InitializeRoutine() { repositoriesBase.CreateAllRepositories(); interactorsBase.CreateAllInteractors(); yield return(null); repositoriesBase.SendOnCreateToAllRepositories(); interactorsBase.SendOnCreateToAllInteractors(); yield return(null); repositoriesBase.InitializeAllRepositories(); interactorsBase.InitializeAllInteractors(); yield return(null); repositoriesBase.SendOnStartToAllRepositories(); interactorsBase.SendOnStartToAllInteractors(); InitializedEvent?.Invoke(); }
Task <Unit> IRequestHandler <InitializedEvent, Unit> .Handle(InitializedEvent request, CancellationToken cancellationToken) { _initializedComplete.OnNext(request); _initializedComplete.OnCompleted(); return(Unit.Task); }
/// <summary> /// <para>This event indicates that the debug adapter is ready to accept configuration requests (e.g. SetBreakpointsRequest, SetExceptionBreakpointsRequest).</para> /// <para>A debug adapter is expected to send this event when it is ready to accept configuration requests (but not before the ‘initialize’ request has finished).</para> /// <para>The sequence of events/requests is as follows:</para> /// <list type="bullet"> /// <item><description>adapters sends ‘initialized’ event (after the ‘initialize’ request has returned)</description></item> /// <item><description>frontend sends zero or more ‘setBreakpoints’ requests</description></item> /// <item><description>frontend sends one ‘setFunctionBreakpoints’ request</description></item> /// <item><description>frontend sends a ‘setExceptionBreakpoints’ request if one or more ‘exceptionBreakpointFilters’ have been defined (or if ‘supportsConfigurationDoneRequest’ is not defined or false)</description></item> /// <item><description>frontend sends other future configuration requests</description></item> /// <item><description>frontend sends one ‘configurationDone’ request to indicate the end of the configuration.</description></item> /// </list> /// </summary> public static void SendInitializedEvent(this ProtocolServer server) { InitializedEvent initializedEvent = new InitializedEvent(); server.SendMessage(initializedEvent); }
protected override void Initialize() { InitializeEvent.Set(); InitializedEvent.WaitOne(TimeoutDelay); ThrowIfCancellationRequested(); }
public abstract Task <Unit> Handle(InitializedEvent request, CancellationToken cancellationToken);
public static void SendInitialized(this IDebugClient mediator, InitializedEvent @event) { mediator.SendNotification(EventNames.Initialized, @event); }
protected override void Initialize() { InitializeEvent.Set(); InitializedEvent.WaitOne(TimeoutDelay); }
public void OnInitialized() { InitializedEvent?.Invoke(); }
public void Initialize() { Main = CreateForm("Main"); Main.Visible = false; Main.Invalidated += (sender, args) => InitializedEvent.Set(); }
private void InitializeFuelLevel(InitializedEvent initEvent) { _maxFuelLevel = initEvent.MaxFuelLevel; FuelSlider.value = initEvent.CurrentFuelLevel / initEvent.MaxFuelLevel; }