Ejemplo n.º 1
0
 /// <summary>
 /// Initializes Load process
 /// </summary>
 public void Load()
 {
     BeforeLoad?.Invoke();
     currentData = Serializer.DeserializeData(fileName, folderName);
     Debug.Log(debugPrefix + "Loaded " + currentData.Count + " entries from " + Path.Combine(Application.persistentDataPath, folderName) + " from " + fileName);
     AfterLoad?.Invoke();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Copies data from other serializer if it loaded data (executes load if not)
 /// </summary>
 /// <param name="source"></param>
 public void CopyLoadedDataFrom(SaveData source)
 {
     BeforeLoad?.Invoke();
     if (source.currentData == null)
     {
         source.Load();
     }
     currentData = new Dictionary <string, object>(source.currentData);
     folderName  = source.folderName;
     fileName    = source.fileName;
     AfterLoad?.Invoke();
     Debug.Log(debugPrefix + "Copied " + currentData.Count + " entries from " + source.name);
 }
Ejemplo n.º 3
0
        public DefaultBrowserForm(string defaulturl)
        {
            InitializeComponent();

            if (CefWin.ApplicationIcon != null)
            {
                this.Icon = CefWin.ApplicationIcon;
            }

            this.Text = CefWin.ApplicationTitle;

            this.MinimumSize = new Size(360, 360);

            if (Application.OpenForms.Count - (CefWin._splashForm?.Visible == true ? 1 : 0) == 0)
            {
                this.StartPosition = FormStartPosition.CenterScreen;
            }

            this.Disposed += DefaultBrowserForm_Disposed;

            this.Resize += DefaultBrowserForm_Resize;

            _browserAgent     = new BrowserAgent();
            _browserAgent.Url = defaulturl;

            if (CefWin._splashForm != null)
            {
                this.Opacity = 0;
                //this.ShowInTaskbar = false;   //TODO:this will affect the Forms collection , handle it later
            }


            CefWin.PostToAppThread(delegate
            {
                BeforeLoad?.Invoke(this, EventArgs.Empty);
                CefWin.WriteDebugLine("BeforeLoad Invoked.");
            });
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Raises the <see cref="BeforeLoad" /> event.
 /// </summary>
 /// <param name="args">The <see cref="LoadStateEventArgs"/> instance containing the event data.</param>
 protected virtual void OnBeforeLoad(LoadStateEventArgs args) => BeforeLoad?.Invoke(this, args);
Ejemplo n.º 5
0
 internal static void InvokeBeforeLoad()
 {
     BeforeLoad?.Invoke();
 }
Ejemplo n.º 6
0
 protected virtual void OnBeforeLoad()
 {
     BeforeLoad?.Invoke();
 }