Exemplo n.º 1
0
 public virtual void OnLoad()
 {
     if (Loaded != null)
     {
         Loaded.Invoke();
     }
 }
Exemplo n.º 2
0
        protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
        {
            base.OnElementPropertyChanged(args);

            /*
             * Console.WriteLine("Container: " + this.Container);
             * Console.WriteLine("Control: " + this.Control);
             * Console.WriteLine("Element: " + this.Element);
             */
            //Console.WriteLine("OnElementPropertyChanged set LoadedControl to " + LoadedControl + " from Control " + Control + " Element: " + Element);

            /* special implementation neccessary beacuse the native Control is not being ready at start/in mainpage contructor */

            if (Control != null && LoadedControl == null)
            {
                LoadedControl = Control;
                // Console.WriteLine("OnElementPropertyChanged set LoadedControl to " + LoadedControl + " from Control " + Control);
                Loaded.Invoke();
            }

            // handling case with Xamarin.Forms.Layout // https://forums.xamarin.com/discussion/comment/386827#Comment_386827
            if (Container != null && LoadedControl == null)
            {
                LoadedControl = Container;
                // Console.WriteLine("OnElementPropertyChanged set LoadedControl to " + LoadedControl + " from Container " + Container);
                Loaded.Invoke();
            }

            // no page equivalent in native
        }
Exemplo n.º 3
0
 /// <summary>
 /// Raises event 'Loaded'
 /// </summary>
 protected virtual void OnLoaded()
 {
     if (Loaded != null)
     {
         Loaded.Invoke(this, System.EventArgs.Empty);
     }
 }
Exemplo n.º 4
0
 void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e)
 {
     if (Loaded != null)
     {
         Loaded.Invoke(Assembly.GetExecutingAssembly(), this);
     }
 }
        public async Task LoadAsync()
        {
            var wordpressUrl = configuration.GetServiceUri("app");

            blogInfo = await http.GetFromJsonAsync <BlogInfoModel>($"{wordpressUrl}/wp-json/wp/v2/bloginfo");

            Loaded?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 6
0
 private async void ViewBase_Loaded(object sender, RoutedEventArgs e)
 {
     if (_isLeaving == false)
     {
         Loaded?.Invoke(sender, e);
         await PlayEnterAnimationAsync();
     }
 }
Exemplo n.º 7
0
 /// <summary>
 /// Loads this instance.
 /// </summary>
 public void Load()
 {
     _log.Info($"{Resources.Loading} {Resources.Options}");
     _manager.Load();
     SelectedCulture = Core.Properties.Settings.Default.StartUpCulture;
     IsLoaded        = true;
     Loaded?.Invoke(this, new LoadedEventEventArgs());
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes the command
 /// </summary>
 /// <param name="connectionInfo">Some information about the connection</param>
 public void Initialize(ConnectionInfo connectionInfo)
 {
     ConnectionInfo = connectionInfo;
     if (Loaded != null)
     {
         Loaded.Invoke(this, EventArgs.Empty);
     }
 }
Exemplo n.º 9
0
        /// <summary>
        /// Called when the fragment is resumed.
        /// </summary>
        public override void OnResume()
        {
            base.OnResume();

            Loaded?.Invoke(this);

            InitializeBindingContext();
        }
Exemplo n.º 10
0
        public async Task InitializeHospital()
        {
            Patients.Clear();

            (await PatientDataSource.GetPatientsAsync()).ForEach(p => Patients.Add(new PatientViewModel(p)));

            Loaded?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 11
0
        /// <summary>
        /// Загрузка данных из указанного файла
        /// </summary>
        /// <param name="fileName">Имя файла</param>
        /// <returns>True если загрузка произошла успешно</returns>
        public bool LoadFromFile(string fileName)
        {
            bool result = LoadSessionData(fileName);

            ActiveSession.Info.IsLoaded = true;
            Loaded?.Invoke(null, EventArgs.Empty);
            return(result);
        }
Exemplo n.º 12
0
 private void ObjectExplorerForm_VisibleChanged(object sender, EventArgs e)
 {
     if (!_isLoaded)
     {
         Loaded?.Invoke(sender, e);
         _isLoaded = true;
     }
 }
Exemplo n.º 13
0
        private static void OnLoaded(Image sender)
        {
#if WPF
            sender.RaiseEvent(new RoutedEventArgs(LoadedEvent, sender));
#elif WINRT || SILVERLIGHT
            Loaded?.Invoke(sender, EventArgs.Empty);
#endif
        }
Exemplo n.º 14
0
 private void OnLoaded()
 {
     lock (_syncFire)
     {
         CanFire = true;
     }
     _uiDispatcher.Invoke(() => Loaded?.Invoke(this, new EventArgs()));
 }
Exemplo n.º 15
0
        //-------------------------------------------------------------------------------
        // Load or reload the settings from disk.
        public void Load()
        {
            if (File.Exists(SettingsFilePath))
            {
                var options = new System.Text.Json.JsonSerializerOptions
                {
                    // Allow JSON comments (even though they would be overwritten when
                    //  we save).
                    // Basically, we want to be very permissive here. Strictness is only
                    //  annoying for the user.
                    ReadCommentHandling = System.Text.Json.JsonCommentHandling.Skip,
                    // Same with trailing commas and case insensitivity.
                    AllowTrailingCommas         = true,
                    PropertyNameCaseInsensitive = false,
                };

                try
                {
                    string json;
                    try
                    {
                        json = File.ReadAllText(SettingsFilePath);
                    }
                    catch (IOException)
                    {
                        // IO error (like they are still writing the file). Wait and try again.
                        QueueLoad(1000);
                        return;
                    }
                    this.fields = System.Text.Json.JsonSerializer.Deserialize <Fields>(json, options);
                }
                catch
                {
                    // Serialization error.
                }

                // If we make it to here and it's null, this is the first time we're
                //  running or something went wrong.
                if (this.fields == null)
                {
                    this.fields = new Fields();
                }

                // Sanitization here. Most is handled by JSON format parsing.
                if (this.fields.MarblesDoneToday < 0)
                {
                    this.fields.MarblesDoneToday = 0;
                }
            }
            else
            {
                // Will use default values.
                this.fields = new Fields();
                Save();
            }

            Loaded?.Invoke(this);
        }
Exemplo n.º 16
0
 protected virtual void OnLoaded()
 {
     if (loaded)
     {
         throw new NotImplementedException("Called onload twice");
     }
     loaded = true;
     Loaded?.Invoke(this, new EventArgs());
 }
Exemplo n.º 17
0
 private void ViewBase_Loaded(object sender, RoutedEventArgs e)
 {
     if (_isLeaving == false)
     {
         Loaded?.Invoke(sender, e);
         var enterStoryboard = GetEnterStoryboard();
         enterStoryboard?.Begin();
     }
 }
Exemplo n.º 18
0
 public Settings()
 {
     this.SettingsLoaded += (object sender, System.Configuration.SettingsLoadedEventArgs e) => {
         if (Loaded != null)
         {
             Loaded.Invoke(Assembly.GetExecutingAssembly(), this);
         }
     };
 }
Exemplo n.º 19
0
        public static void OnLoaded()
        {
            if (TZXTapeCounter >= TZXFile.TZXLength)
            {
                LoadComplete = true;
            }

            Loaded?.Invoke();
        }
Exemplo n.º 20
0
            protected override void OnLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode)
            {
                base.OnLoadEnd(browser, frame, httpStatusCode);

                if (frame.IsMain)
                {
                    Loaded?.Invoke(this, EventArgs.Empty);
                }
            }
Exemplo n.º 21
0
 private void TimerElapsed(object sender, ElapsedEventArgs e)
 {
     ((System.Timers.Timer)sender).Dispose();
     Invoke(new Action(() =>
     {
         Hide();
         Loaded?.Invoke(this);
     }));
 }
Exemplo n.º 22
0
 internal void Update(ulong accountHi, ulong accountLo, string battleTagName, int battleTagNumber)
 {
     AccountHi       = accountHi;
     AccountLo       = accountLo;
     BattleTagName   = battleTagName;
     BattleTagNumber = battleTagNumber;
     Loaded?.Invoke();
     IsLoaded = true;
 }
Exemplo n.º 23
0
        /// <summary>
        /// Загрузка данных
        /// </summary>
        /// <returns>True если загрузка произошла успешно</returns>
        public bool Load()
        {
            bool result = false;
            // имя файла с сессией
            string sessionFileNameToLoad = null;

            // проверка есть файл, с которым работали в последний раз
            if (File.Exists(Path.Combine(SESSIONS_FOLDER, "lastsession")))
            {
                EmcosSiteWrapperApp.LogInfo("Обнаружен файл с именем файла последней сессии.");
                var lastusedfile = string.Empty;
                try
                {
                    EmcosSiteWrapperApp.LogInfo("Попытка чтения имени файла последней сессии.");
                    // чтение имени файла
                    lastusedfile = File.ReadAllText(Path.Combine(SESSIONS_FOLDER, "lastsession")).Trim();
                    EmcosSiteWrapperApp.LogInfo("Имя файла последней сессии получено.");
                    if (File.Exists(lastusedfile))
                    {
                        sessionFileNameToLoad = lastusedfile;
                        EmcosSiteWrapperApp.LogInfo("Файл последней сессии существует, попытаемся его загрузить.");
                    }
                    else
                    {
                        EmcosSiteWrapperApp.LogInfo("Указанный файл последней сессии не найден.");
                    }
                }
                catch (System.IO.IOException ex)
                {
                    EmcosSiteWrapperApp.LogInfo("Ошибка при чтении имени файла последней сессии.");
                    _callBackAction(ex);
                }
            }
            else
            {
                if (String.IsNullOrWhiteSpace(BALANCE_SESSION_FILENAME) || File.Exists(Path.Combine(SESSIONS_FOLDER, BALANCE_SESSION_FILENAME + SESSION_FILE_EXTENSION)) == false)
                {
                    EmcosSiteWrapperApp.LogInfo("Сессия не обнаружена.");
                    return(false);
                }
            }
            //
            if (LoadSessionData(sessionFileNameToLoad))
            {
                EmcosSiteWrapperApp.LogInfo("Сессия обнаружена и загружена.");
                ActiveSession.Info.IsLoaded = true;
                Loaded?.Invoke(null, EventArgs.Empty);
                result = true;
            }
            else
            {
                EmcosSiteWrapperApp.LogInfo(String.Format("Не удалось загрузить сессию. Файл [{0}].",
                                                          sessionFileNameToLoad ?? BALANCE_SESSION_FILENAME + SESSION_FILE_EXTENSION));
            }
            return(result);
        }
Exemplo n.º 24
0
 /// <summary>
 /// Load and index the given log files
 /// </summary>
 /// <param name="files">The files to index</param>
 /// <param name="progress">Action to report indexing progress</param>
 /// <param name="cancellationToken">CancellationToken for cancelling the index update</param>
 public void Load(string[] files, Action <double> progress, CancellationToken cancellationToken)
 {
     _source = files;
     for (var i = 0; i < _indexers.Length; i++)
     {
         _indexers[i].Initialize();
     }
     Update(progress, cancellationToken);
     Loaded?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 25
0
        /// <summary>
        /// Called when the view is loaded.
        /// </summary>
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            RaiseViewModelChanged();

            Loaded?.Invoke(this);

            InitializeBindingContext();
        }
Exemplo n.º 26
0
        public async Task LoadContent(IContentLibrary contentLibrary)
        {
            await Task.WhenAll(new List <Task>(Effects.Select(x => x.LoadContent(contentLibrary, _lazyGraphicsDevice())))
            {
                _spriteTargetA.LoadContent(contentLibrary),
                _spriteTargetB.LoadContent(contentLibrary)
            });

            Loaded?.Invoke(this);
        }
Exemplo n.º 27
0
        /// <summary>
        /// Called when the view is loaded.
        /// </summary>
        protected override void OnResume()
        {
            base.OnResume();

            RaiseViewModelChanged();

            Loaded?.Invoke(this);

            InitializeBindingContext();
        }
Exemplo n.º 28
0
        protected override void SceneInitialization(IContextState context, RenderEngine engine, ElementTag camera)
        {
            var smanager = Context.GetSystemManager();

            smanager.CreateSystem <DefaultInputSystem>();
            smanager.CreateSystem <ZoomToAllObjectsSystem>();
            smanager.CreateSystem <MovingSystem>();
            smanager.CreateSystem <CollidingSystem>();
            smanager.CreateSystem <DefaultOrthographicCameraSystem>();
            smanager.CreateSystem <LightsSystem>();
            //  smanager.CreateSystem<MovementSystem>();
            //  smanager.CreateSystem<EmptyAnimationSystem>();
            //  smanager.CreateSystem<MeshAnimationSystem>();
            //  smanager.CreateSystem<StickOnHeightMapSystem>();
            //     smanager.CreateSystem<ObjectMovementSystem>();
            //    smanager.CreateSystem<Systems.TerrainGeneratorSystem>();
            //   smanager.CreateSystem<Physics.Engine.PhysicalSystem>();

            smanager
            .CreateSystem <RenderSystem>()
            .Init(engine.Graphics)
            // .CreateNested<SkyGradientColoringRenderTechnique>()
            //  .CreateNested<SkyPlaneWithParallaxRenderTechnique>()
            //   .CreateNested<TerrainRenderTechnique>()//
            //.CreateNested<Toolkit.D3D.CameraViews.CameraViewsRenderTechnique<CustomRenderProperties>>()
            //.CreateNested<OITTriangleColoredVertexRenderTechnique<ToolkitRenderProperties>>()
            .CreateNested <TriangleColoredVertexRenderTechnique <ToolkitRenderProperties> >()
            .CreateNested <TriangleTexturedVertexRenderTechnique <ToolkitRenderProperties> >()
            .CreateNested <LineVertexRenderTechnique <ToolkitRenderProperties> >()
            //.CreateNested<CudaTestTechniques<ToolkitRenderProperties>>()
            .CreateNested <SpherePointRenderTechnique <ToolkitRenderProperties> >()
            //.CreateNested<AminRenderTechniqueSystem>()
            ;

            //smanager
            //    .CreateSystem<AminRenderSystem>()
            //    .Init(device);Context
            var manager = Context.GetEntityManager();

            cameraObject = CameraObject.UpdateOrthographic <RenderSystem>(camera, Context, Surface);

            LightObject.CreateAmbientLight(manager, 0.2f);                                           //0.05f
            LightObject.CreateFollowCameraDirectLight(manager, System.Numerics.Vector3.UnitZ, 0.8f); //0.95f

            CoordinateSystem = CoordinateSystemLinesGameObject.Create(context, false);

            Loaded?.Invoke();


            //VisualSphereObject.SphereGeo(Context, ElementTag.New($"Point"), new VisualSphereObject.Data {
            //    Center = new Vector3(10, 20, 10),
            //    Color = V4Colors.Yellow,
            //    Radius = 10
            //});
        }
Exemplo n.º 29
0
        internal WindowSession Show()
        {
            var completion = new TaskCompletionSource <bool?>();

            dispatcher.InvokeAsync(() =>
            {
                try
                {
                    if (closeRequested)
                    {
                        completion.SetResult(closeResult);
                        return;
                    }

                    wpfWindow = new MaterialFormsWindow(this, Id);
                    if (closeRequested)
                    {
                        completion.SetResult(closeResult);
                        return;
                    }

                    wpfWindow.Loaded += (sender, args) =>
                    {
                        lock (syncRoot)
                        {
                            if (closeRequested)
                            {
                                completion.SetResult(closeResult);
                                wpfWindow.Close();
                                return;
                            }

                            IsLoaded = true;
                        }

                        Loaded?.Invoke(this, EventArgs.Empty);
                    };

                    var result = wpfWindow.ShowDialog();
                    completion.SetResult(closeRequested ? closeResult : result);
                }
                catch (Exception ex)
                {
                    completion.SetException(ex);
                }
                finally
                {
                    IsClosed  = true;
                    wpfWindow = null;
                }
            });

            task = completion.Task;
            return(this);
        }
Exemplo n.º 30
0
        internal void InvokeEvent_Loaded(object sender, RoutedEventArgs e)
        {
            if (IsLoaded)
            {
                return;
            }

            IsLoaded = true;

            Loaded?.Invoke(this, e);
        }