Ejemplo n.º 1
0
        public AddObjectForm(SM3DWorldScene scene, GL_ControlModern control)
        {
            InitializeComponent();
            CenterToParent();
            Localize();
            DBEntryListView.ShowGroups = true;
            DBEntryListView.DoubleBuffering(true);
            if (System.IO.File.Exists(Program.SODDPath))
            {
                OID = new ObjectInformationDatabase(Program.SODDPath);
            }
            FullItems = new ListViewItem[Program.ParameterDB.ObjectParameters.Count];
            int i = 0;

            foreach (var parameter in Program.ParameterDB.ObjectParameters.Values)
            {
                ListViewGroup LVG = null;
                if (parameter.ObjList >= 0 && parameter.ObjList <= ObjList.Linked)
                {
                    LVG = DBEntryListView.Groups[(byte)parameter.ObjList];
                }

                ListViewItem LVI = new ListViewItem(new string[]
                {
                    parameter.ClassName,
                    OID.GetInformation(parameter.ClassName).EnglishName ?? parameter.ClassName,
                    parameter.ObjectNames.Count.ToString().PadLeft(3, '0'),
                    parameter.ModelNames.Count.ToString().PadLeft(3, '0')
                })
                {
                    Group = LVG, Tag = parameter
                };
                FullItems[i++] = LVI;
            }
            DBEntryListView.Items.AddRange(FullItems);

            this.scene   = scene;
            this.control = control;
        }