Beispiel #1
0
        public static Meziantou.GitLab.SystemHookIdRef FromSystemHook(SystemHook systemHook)
        {
            if ((systemHook == null))
            {
                throw new System.ArgumentNullException(nameof(systemHook));
            }

            return(new Meziantou.GitLab.SystemHookIdRef(systemHook));
        }
Beispiel #2
0
        private SystemHookIdRef(SystemHook systemHook)
        {
            if ((systemHook == null))
            {
                throw new System.ArgumentNullException(nameof(systemHook));
            }

            this._value = systemHook.Id;
        }
        private void Update()
        {
            if (!built)
            {
                var rootElement = Element.Create(rootComponent.Create(), new PropCollection(new Dictionary <string, object>()));
                Reconciler.CreateElementTree(rootElement);
                Reconciler.InvokeBuilders(rootElement, this, this.transform);

                built = true;
            }

            Element.ClearElementCache();
            SystemHook.Prepopulate();
            ScreenSizeHook.Prepopulate();
            MousePositionHook.Prepopulate();
            PropCollection.FlushCallbacks();

            RenderQueue.Instance.DoUnitOfWork(this, this.transform);
        }
Beispiel #4
0
        internal Guid RegisterSystemEvent(SystemEventCallback callback, uint eventId)
        {
            var hookId         = default(Guid);
            var hookReadyEvent = new AutoResetEvent(false);
            var hookThread     = new Thread(() =>
            {
                var hook = new SystemHook(callback, eventId);

                hook.Attach();
                hookId = hook.Id;
                SystemHooks[hookId] = hook;
                hookReadyEvent.Set();
                hook.AwaitDetach();
            });

            hookThread.SetApartmentState(ApartmentState.STA);
            hookThread.IsBackground = true;
            hookThread.Start();

            hookReadyEvent.WaitOne();

            return(hookId);
        }