Пример #1
0
        private void AddGridView()
        {
            var gvc = new GridViewCustom();
            gvc.ShowDialog(this);
            if (gvc.DialogResult == DialogResult.OK)
            {
                var cg = new configurationGrid
                {
                    Columns = gvc.Cols,
                    Rows = gvc.Rows,
                    name = gvc.GridName,
                    FullScreen = gvc.FullScreen,
                    AlwaysOnTop = gvc.AlwaysOnTop,
                    Display = gvc.Display,
                    Framerate = gvc.Framerate,
                    ModeIndex = gvc.Mode,
                    Fill = gvc.Fill,
                    ModeConfig = gvc.ModeConfig,
                    ShowAtStartup = gvc.ShowAtStartup,
                    GridItem = new configurationGridGridItem[] { }
                };
                List<configurationGrid> l = MainForm.Conf.GridViews.ToList();
                l.Add(cg);
                MainForm.Conf.GridViews = l.ToArray();

                MainClass.ShowGridView(cg.name);

                LoadGrids();
            }
            gvc.Dispose();
        }
Пример #2
0
 public void EditGridView(string name, IWin32Window parent = null)
 {
     if (parent == null)
         parent = this;
     configurationGrid cg = Conf.GridViews.FirstOrDefault(p => p.name == name);
     if (cg != null)
     {
         var gvc = new GridViewCustom
                   {
                       Cols = cg.Columns,
                       Rows = cg.Rows,
                       GridName = cg.name,
                       FullScreen = cg.FullScreen,
                       AlwaysOnTop = cg.AlwaysOnTop,
                       Display = cg.Display,
                       Framerate = cg.Framerate,
                       Mode = cg.ModeIndex,
                       ModeConfig = cg.ModeConfig,
                       Overlays = cg.Overlays,
                       Fill = cg.Fill,
                       ShowAtStartup = cg.ShowAtStartup,
                   };
        // bool b = ((Form) parent).TopMost;
         //((Form) parent).TopMost = false;
         gvc.ShowDialog(parent);
         //((Form)parent).TopMost = b;
         if (gvc.DialogResult == DialogResult.OK)
         {
             cg.Columns = gvc.Cols;
             cg.Rows = gvc.Rows;
             cg.name = gvc.GridName;
             cg.FullScreen = gvc.FullScreen;
             cg.AlwaysOnTop = gvc.AlwaysOnTop;
             cg.Display = gvc.Display;
             cg.Framerate = gvc.Framerate;
             cg.ModeIndex = gvc.Mode;
             cg.ModeConfig = gvc.ModeConfig;
             cg.Overlays = gvc.Overlays;
             cg.Fill = gvc.Fill;
             cg.ShowAtStartup = gvc.ShowAtStartup;
             ListGridViews();
         }
         gvc.Dispose();
     }
 }