AddObject() public static method

public static AddObject ( object o ) : void
o object
return void
Beispiel #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            foreach (var itm in clbAdd.CheckedItems)
            {
                var o = itm as clb;
                if (o?.C != null)
                {
                    var a = _c.actions.entries.Where(p => p.objecttypeid == 2 && p.objectid == o.C.id).ToList();
                    o.C.id = MainForm.NextCameraId;
                    o.C.settings.micpair = -1;
                    MainForm.AddObject(o.C);

                    foreach (var ent in a)
                    {
                        ent.objectid = o.C.id;
                        MainForm.AddObject(ent);
                    }

                    mainForm.DisplayCamera(o.C);
                }
                //if (o?.M != null)
                //{
                //    o.M.id = MainForm.NextMicrophoneId;
                //    MainForm.AddObject(o.M);
                //    mainForm.DisplayMicrophone(o.M);
                //}
            }
            if (MainForm.Conf.AutoLayout)
            {
                mainForm.LayoutObjects(0, 0);
            }
            Close();
        }