Exemple #1
0
        public void RenderFrame()
        {
            // ------------------------------------------------------------
            // Out of frame loop
            Debug.Assert(_currentTiming == CurrentFrameTiming.OutOfFrameLoop);
            var isCloseRequested = _isCloseRequested;
            var layers           = Layers;

            var frameTimingPoints = TimingPoints;

            Mouse.InitFrame();
            Keyboard.InitFrame();

            // ------------------------------------------------------------
            // First Frame initializing
            if (_state == RenderingAreaLifeState.Activating)
            {
                _currentTiming = CurrentFrameTiming.FirstFrameInitializing;
                try {
                    Initialized?.Invoke(OwnerScreen);
                }
                catch {
                    if (EngineSetting.UserCodeExceptionCatchMode == UserCodeExceptionCatchMode.Throw)
                    {
                        throw;
                    }
                    // Don't throw. (Ignore exceptions in user code)
                }
                finally {
                    _state = RenderingAreaLifeState.Alive;
                }
            }

            // ------------------------------------------------------------
            // Frame initializing
            _currentTiming = CurrentFrameTiming.FrameInitializing;
            if (isCloseRequested && _state == RenderingAreaLifeState.Alive)
            {
                _state = RenderingAreaLifeState.Terminating;
                _runningTokenSource.Cancel();
                layers.TerminateAllLayers(this,
                                          onDead: static self =>
                {
                    self._state = RenderingAreaLifeState.Dead;
                });
            }
            layers.ApplyAdd();
            frameTimingPoints.FrameInitializing.DoQueuedEvents();

            // ------------------------------------------------------------
            // Early update
            _currentTiming = CurrentFrameTiming.EarlyUpdate;
            frameTimingPoints.EarlyUpdate.DoQueuedEvents();
            layers.EarlyUpdate();

            // ------------------------------------------------------------
            // Update
            _currentTiming = CurrentFrameTiming.Update;
            frameTimingPoints.Update.DoQueuedEvents();
            layers.Update();

            // ------------------------------------------------------------
            // Late update
            _currentTiming = CurrentFrameTiming.LateUpdate;
            frameTimingPoints.LateUpdate.DoQueuedEvents();
            layers.LateUpdate();

            // ------------------------------------------------------------
            // Before rendering
            _currentTiming = CurrentFrameTiming.BeforeRendering;
            FBO.Bind(FBO.Empty, FBO.Target.FrameBuffer);
            ElffyGL.Clear(ClearMask.ColorBufferBit | ClearMask.DepthBufferBit);
            frameTimingPoints.BeforeRendering.DoQueuedEvents();

            // ------------------------------------------------------------
            // Rendering
            _currentTiming = CurrentFrameTiming.Rendering;
            layers.Render();

            // ------------------------------------------------------------
            // After rendering
            _currentTiming = CurrentFrameTiming.AfterRendering;
            frameTimingPoints.AfterRendering.DoQueuedEvents();

            // ------------------------------------------------------------
            // Frame finalizing
            _currentTiming = CurrentFrameTiming.FrameFinalizing;
            layers.ApplyRemove();

            // ------------------------------------------------------------
            // End of frame (only internal accessible)
            _currentTiming = CurrentFrameTiming.Internal_EndOfFrame;
            frameTimingPoints.InternalEndOfFrame.DoQueuedEvents();

            // ------------------------------------------------------------
            // Out of frame loop
            _currentTiming = CurrentFrameTiming.OutOfFrameLoop;
            ContextAssociatedMemorySafety.CollectIfExist(OwnerScreen);

            if (_state == RenderingAreaLifeState.Dead)
            {
                Dispose();
            }
        }
 private void onInitialized()
 {
     Initialized?.Invoke(this, null);
 }
 /// <summary>
 /// Raises the Initialized event.
 /// </summary>
 /// <param name="e">An EventArgs containing the event data.</param>
 protected virtual void OnInitialized(EventArgs e)
 {
     Initialized?.Invoke(this, EventArgs.Empty);
 }
Exemple #4
0
 /// <summary>
 /// Raises the <see cref="Initialized"/> event
 /// </summary>
 protected override void OnInitialized()
 {
     Initialized?.Invoke(this, CreateInitializedEventArgs());
 }
Exemple #5
0
 protected void OnInitialized()
 {
     IsInitialized = true;
     Initialized?.Invoke(this);
 }
 private void OnInitialized(BaseMessage <InitializedInfo> pInfo)
 {
     Initialized?.Invoke(pInfo);
 }
 public void Init(ISldWorks app, IModelDoc2 model)
 {
     Model = model;
     Initialized?.Invoke(Model);
 }
Exemple #8
0
 internal static void InvokeInitialized()
 {
     Initialized?.Invoke(null, EventArgs.Empty);
 }
Exemple #9
0
 protected internal void Initialize(Geometry geometry)
 {
     _geometry     = geometry;
     IsInitialized = true;
     Initialized?.Invoke();
 }
        public static bool Init()
        {
            Initialized?.Invoke(null, null);

            return(true);
        }
Exemple #11
0
        public void Initialize()
        {
            DUIHandler.ForceFindDUIAndHide();

            FlyoutWindow = new FlyoutWindow();
            CreateWndProc();

            SystemTheme.SystemThemeChanged += OnSystemThemeChange;
            SystemTheme.Initialize();

            DUIHook = new DUIHook();
            DUIHook.Hook();
            DUIHook.DUIShown     += DUIShown;
            DUIHook.DUIDestroyed += DUIDestroyed;
            rehooktimer           = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(3), IsEnabled = false
            };
            rehooktimer.Tick += (_, __) => TryRehook();

            KeyboardHook = new KeyboardHook();

            #region Load Settings

            var adEnabled           = AppDataHelper.AudioModuleEnabled;
            var apmdEnabled         = AppDataHelper.AirplaneModeModuleEnabled;
            var lkkyEnabled         = AppDataHelper.LockKeysModuleEnabled;
            var brEnabled           = AppDataHelper.BrightnessModuleEnabled;
            var defaultFlyoutString = AppDataHelper.DefaultFlyout;

            if (Enum.TryParse(defaultFlyoutString, true, out DefaultFlyout _defaultFlyout))
            {
                DefaultFlyout = _defaultFlyout;
            }
            else
            {
                AppDataHelper.DefaultFlyout = DefaultFlyout.ToString();
            }

            TopBarEnabled         = AppDataHelper.TopBarEnabled;
            DefaultFlyoutPosition = AppDataHelper.DefaultFlyoutPosition;

            async void getStartupStatus()
            {
                RunAtStartup = await StartupHelper.GetRunAtStartupEnabled();
            }

            getStartupStatus();

            #endregion

            #region Initiate Helpers

            AudioFlyoutHelper = new AudioFlyoutHelper()
            {
                IsEnabled = adEnabled
            };
            AirplaneModeFlyoutHelper = new AirplaneModeFlyoutHelper()
            {
                IsEnabled = apmdEnabled
            };
            LockKeysFlyoutHelper = new LockKeysFlyoutHelper()
            {
                IsEnabled = lkkyEnabled
            };
            BrightnessFlyoutHelper = new BrightnessFlyoutHelper()
            {
                IsEnabled = brEnabled
            };

            AudioFlyoutHelper.ShowFlyoutRequested        += ShowFlyout;
            AirplaneModeFlyoutHelper.ShowFlyoutRequested += ShowFlyout;
            LockKeysFlyoutHelper.ShowFlyoutRequested     += ShowFlyout;
            BrightnessFlyoutHelper.ShowFlyoutRequested   += ShowFlyout;

            #endregion

            HasInitialized = true;
            Initialized?.Invoke(null, null);
        }
Exemple #12
0
 public void Initialize(EditorState state)
 {
     State = state;
     Initialized?.Invoke();
 }
Exemple #13
0
 protected virtual void OnInitialized(EventArgs e) => Initialized?.Invoke(this, e);
Exemple #14
0
 /// <summary>
 /// Initializes a new instance of <see cref="VideoView"/> class
 /// </summary>
 public VideoViewWrapper()
 {
     DefaultStyleKey = typeof(VideoView);
     Loaded         += (sender, e) => Initialized?.Invoke(this, new InitializedEventArgs(SwapChainOptions));
 }
 private void OnInitialized(DeviceChangeEventArgs e)
 {
     Initialized?.Invoke(this, e);
 }
Exemple #16
0
 /// <summary>
 /// Fires the Initialized event
 /// </summary>
 /// <param name="e">The event args.</param>
 protected virtual void OnInitialize(PaintEventArgs e)
 {
     Initialized?.Invoke(this, e);
 }
Exemple #17
0
 private void OnInitialized()
 {
     IsInitialized = true;
     Initialized?.Invoke(this, EventArgs.Empty);
 }
 /// <summary>
 /// Initialize the specified provider.
 /// </summary>
 /// <param name='provider'>
 /// Provider.
 /// </param>
 public static void Initialize(ISHKeyValueStorageProvider provider)
 {
     Current = provider;
     Initialized.Raise(typeof(SHKeyValueStorageProvider));
 }
Exemple #19
0
 protected virtual void InitializeImpl()
 {
     OnInitialize();
     Initialized.Call();
     initialized.Set();
 }
Exemple #20
0
 public virtual void Initialize() => Initialized.Add(GetType());
        public Initialized On(Initialized initialized)
        {
            Guard.AgainstNull(initialized, "initialized");

            return(_initialized = initialized);
        }
 private void InitializeCart()
 {
     Initialized = DateTime.Now;
     Expires     = Initialized.Add(ShoppingCartSettings.CookieExpiration);
     CartCookie  = Guid.NewGuid().ToString();
 }
Exemple #23
0
 void Start()
 {
     Initialized?.Invoke(this, new InitializedEventArgs());
 }
Exemple #24
0
 /// <summary>
 /// Fires the Initialized Event
 /// </summary>
 protected virtual void OnInitialize()
 {
     _isInitialized = true;
     Initialized?.Invoke(this, EventArgs.Empty);
 }
 void CompleteInitialization()
 {
     CompleteInitializationOverride();
     IsInitialized = true;
     Initialized.Do(x => x(this, EventArgs.Empty));
 }
Exemple #26
0
 /// <summary>
 /// Raises the <see cref="Initialized"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Catel.Services.CameraOperationCompletedEventArgs"/> instance containing the event data.</param>
 protected void RaiseInitialized(CameraOperationCompletedEventArgs e)
 {
     Initialized.SafeInvoke(this, e);
 }
Exemple #27
0
 public virtual void OnInitialized()
 {
     Initialized?.Invoke(this);
 }
Exemple #28
0
 protected void OnInitialized()
 {
     Initialized?.Invoke(this);
 }
Exemple #29
0
 public void Apply(Initialized e)
 {
     // Do nothing, this represents the default constructor
 }
Exemple #30
0
        async Task InitializeAsync()
        {
            int p = 0;
            await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            UpdateInitStatus(p += 10);

            VcProject = Project.Object as VCProject;
            if (VcProject == null)
            {
                return;
            }
            UpdateInitStatus(p += 10);

            var context = Project.Object as IVsBrowseObjectContext;

            if (context == null)
            {
                return;
            }
            UpdateInitStatus(p += 10);

            UnconfiguredProject = context.UnconfiguredProject;
            if (UnconfiguredProject == null ||
                UnconfiguredProject.ProjectService == null ||
                UnconfiguredProject.ProjectService.Services == null)
            {
                return;
            }
            await TaskScheduler.Default;

            UpdateInitStatus(p += 10);

            var configs = await UnconfiguredProject.Services
                          .ProjectConfigurationsService.GetKnownProjectConfigurationsAsync();

            UpdateInitStatus(p += 10);

            Initialized.Set();

            Subscribers = new List <Subscriber>();
            int n = configs.Count;
            int d = (100 - p) / (n * 2);

            foreach (var config in configs)
            {
                var configProject = await UnconfiguredProject.LoadConfiguredProjectAsync(config);

                UpdateInitStatus(p += d);
                Subscribers.Add(new Subscriber(this, configProject));
                configProject.ProjectUnloading += OnProjectUnloadingAsync;
                if (QtVsToolsPackage.Instance.Options.BuildDebugInformation)
                {
                    Messages.Print(string.Format(
                                       "{0:HH:mm:ss.FFF} QtProjectTracker({1}): Started tracking [{2}] {3}",
                                       DateTime.Now, Thread.CurrentThread.ManagedThreadId,
                                       config.Name, ProjectPath));
                }
                UpdateInitStatus(p += d);
            }
        }