Esempio n. 1
0
 public void Load()
 {
     lock (_lock)
     {
         InvokeHelper ret = delegate
         {
             FieldInfo[] fields = GraphicsWindowType.GetFields(BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic);
             int         ii     = 0;
             foreach (FieldInfo i in fields)
             {
                 try //Cannot set the constants
                 {
                     object _value = GraphicsWindowType.GetField(i.Name, BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
                     if (!i.IsLiteral)
                     {
                         GraphicsWindowType.GetField(i.Name, BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).SetValue(_value, obj[ii]);
                     }
                     ii++;
                 }
                 catch (Exception ex)
                 {
                     Utilities.OnError(Utilities.GetCurrentMethod(), ex);
                 }
             }
         };
         FastThread.Invoke(ret);
     }
 }
Esempio n. 2
0
 public void Save()
 {
     lock (_lock)
     {
         obj.Clear();
         InvokeHelper ret = delegate
         {
             try
             {
                 FieldInfo[] fields = GraphicsWindowType.GetFields(BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic);
                 foreach (FieldInfo i in fields)
                 {
                     obj.Add(GraphicsWindowType.GetField(i.Name, BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).GetValue(null));
                 }
             }
             catch (Exception ex)
             {
                 Utilities.OnError(Utilities.GetCurrentMethod(), ex);
             }
         };
         FastThread.Invoke(ret);
     }
 }
Esempio n. 3
0
            public Win(int _id)
            {
                id = _id;
                if (id > 0)
                {
                    mCreateWindow.Invoke(null, new object[] { });
                    GraphicsWindow.Show();
                }
                else
                {
                    bool _windowCreated = (bool)GraphicsWindowType.GetField("_windowCreated", BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
                    if (!_windowCreated)
                    {
                        GraphicsWindow.Show();
                        GraphicsWindow.Hide();
                    }
                }
                InvokeHelper ret = delegate
                {
                    try
                    {
                        window            = (Window)GraphicsWindowType.GetField("_window", BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
                        window.Activated += new EventHandler(ActivatedHandler);
                        FieldInfo[] fields = GraphicsWindowType.GetFields(BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic);
                        foreach (FieldInfo i in fields)
                        {
                            obj.Add(GraphicsWindowType.GetField(i.Name, BindingFlags.IgnoreCase | BindingFlags.Static | BindingFlags.NonPublic).GetValue(null));
                        }
                    }
                    catch (Exception ex)
                    {
                        Utilities.OnError(Utilities.GetCurrentMethod(), ex);
                    }
                };

                FastThread.Invoke(ret);
            }