Пример #1
0
        public void Populate(string pFullFileName, ImageList imgList)
        {
            if (string.IsNullOrEmpty(pFullFileName))
            {
                return;
            }
            this.imageList1 = imgList;

            TreeMenu menu = TreeListEngineDevExpress.LoadMenuFromFile(pFullFileName);

            this.menuItemSurveyBindingSource.DataSource = menu.ItemList;

            //foreach (MenuImage mi in menu.ImageList.OrderBy<MenuImage, int>(p => p.Index))
            //{
            //    imageList1.Images.Add(mi.Image);
            //}

            ((System.ComponentModel.ISupportInitialize)(this.treeList1)).BeginInit();
            this.treeList1.StateImageList  = this.imageList1;
            this.treeList1.SelectImageList = this.imageList1;

            ((System.ComponentModel.ISupportInitialize)(this.treeList1)).EndInit();
            treeList1.ExpandAll();
            treeList1.RefreshDataSource();
        }
Пример #2
0
        void LoadMenuFile()
        {
            if (String.IsNullOrEmpty(_CurrentFullFileName))
            {
                return;
            }
            menuItemEditorSurvey1.imgList = this.imageList2;

            try
            {
                Menu = TreeListEngineDevExpress.LoadMenuFromFile(_CurrentFullFileName);
                this.menuItemSurveyBindingSource.DataSource = Menu.ItemList;
                PopulateImage();
            }
            catch (InvalidOperationException)
            {
                fwkMessageView_Error.Show("The file not contain correct Pelsoftat to represent any menu .-");
            }
            catch (Exception ex2)
            {
                fwkMessageView_Error.Show(ex2);
            }
            treeList1.ExpandAll();
            treeList1.RefreshDataSource();
            lblFileLoad.Text           = String.Concat("File ", _CurrentFullFileName);
            storage.StorageObject.File = _CurrentFullFileName;
            storage.Save();
        }
Пример #3
0
        private void saveToolStripButton_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrEmpty(_CurrentFullFileName))
            {
                return;
            }

            TreeListEngineDevExpress.SaveMenuToFile(_CurrentFullFileName, Menu);
            _Saved = true;
            fwkMessageView_Warning.Show("Menu sussefully saved");
        }
Пример #4
0
        private void frmMainDevExpress_Leave(object sender, EventArgs e)
        {
            if (!_Saved)
            {
                if (fwkMessageView_Warning.Show("Save file " + _CurrentFullFileName) == DialogResult.OK)
                {
                    if (String.IsNullOrEmpty(_CurrentFullFileName))
                    {
                        return;
                    }

                    TreeListEngineDevExpress.SaveMenuToFile(_CurrentFullFileName, Menu.ItemList);

                    fwkMessageView_Warning.Show("Menu sussefully saved");
                }
            }

            storage.StorageObject.File = _CurrentFullFileName;
            storage.Save();
        }