Пример #1
0
        public bool LoadLibraries(string[] pathArray)
        {
            MbeLib[] libTempArray = new MbeLib[pathArray.Length];
            libArray = null;
            int validCount = 0;

            for (int i = 0; i < pathArray.Length; i++)
            {
                libTempArray[i] = new MbeLib();
                if (libTempArray[i].LoadLibrary(pathArray[i]))
                {
                    validCount++;
                }
                else
                {
                    libTempArray[i] = null;
                }
            }
            if (validCount == 0)
            {
                return(false);
            }
            libArray = new MbeLib[validCount];
            int index = 0;

            for (int i = 0; i < pathArray.Length; i++)
            {
                if (libTempArray[i] != null)
                {
                    libArray[index++] = libTempArray[i];
                }
            }
            return(true);
        }
Пример #2
0
        private void setListboxComponent()
        {
            listBoxComponent.Items.Clear();

            int libIndex = listBoxLib.SelectedIndex;

            if (libIndex < 0)
            {
                return;
            }
            MbeLib lib = (MbeLib)(listBoxLib.Items[libIndex]);

            foreach (MbeObjComponent obj in lib.componentArray)
            {
                listBoxComponent.Items.Add(obj);
            }
            listBoxComponent.SelectedIndex = 0;
        }