void AddContronToPannel(Fwk.UI.Controls.Menu.Tree.MenuItem item, object obj)
        {
            using (WaitCursorHelper w = new WaitCursorHelper(this))
            {
                Xtra_UC_Base ctrl = null;
                Type         T    = Fwk.HelperFunctions.ReflectionFunctions.CreateType(item.AssemblyInfo);

                if (!controls.Contains(string.Concat(T.Name, item.ID)))
                {
                    ctrl = (Xtra_UC_Base)Fwk.HelperFunctions.ReflectionFunctions.CreateInstance(item.AssemblyInfo);

                    ctrl.Tag = item.Tag;
                    ctrl.Key = string.Concat(T.Name, item.ID);

                    this.panelControl1.Controls.Add(ctrl);
                    controls.Add(ctrl.Key);
                    ctrl.Dock = System.Windows.Forms.DockStyle.Fill;
                    ctrl.OnExitControlEvent += new EventHandler(ctrl_OnExitControlEvent);
                    ctrl.Populate(obj);

                    //ctrl.Populate(null);
                }
                else
                {
                    int i = this.panelControl1.Controls.IndexOfKey(T.Name);
                    ctrl = (Xtra_UC_Base)this.panelControl1.Controls[i];
                }
                btnClose.Visible       = ctrl.ShowClose;
                btnSaveChanges.Visible = ctrl.ShowSave;
                CurrentControl         = ctrl;
                ctrl.BringToFront();
                ctrl.Refresh();
            }
        }
Esempio n. 2
0
        private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            if (_OnInitLoad)
            {
                return;
            }

            if (e.Node == null)
            {
                return;
            }

            if (e.Node.TreeList.FocusedColumn == null)
            {
                return;
            }

            if (e.Node.TreeList.FocusedColumn.Name == "colTypeImage" && _viewImage == true)
            {
                return;
            }

            _MenuItemSelected = (Fwk.UI.Controls.Menu.Tree.MenuItem)treeList1.GetDataRecordByNode(e.Node);

            if (_MenuItemSelected != null)
            {
                MenuEventArgs wMenuEventArgs = new MenuEventArgs(e.Node.TreeList.FocusedColumn.Name, e.Node.TreeList.FocusedColumn.FieldName);
                String        s = e.Node.TreeList.FocusedColumn.FieldName;
                OnMenuItemClick(wMenuEventArgs);
            }
        }
Esempio n. 3
0
 private void listBox1_Click(object sender, EventArgs e)
 {
     if (((System.Windows.Forms.ListBox)(sender)).Text != String.Empty)
     {
         _SelectedPelsoft = (Fwk.UI.Controls.Menu.Tree.MenuItem)((System.Windows.Forms.ListBox)(sender)).SelectedItem;
     }
 }
Esempio n. 4
0
        //[Browsable(false)]
        //public bool CategoryChange
        //{
        //    get { return menuItemEditorSurvey1.CategoryChange; }
        //}

        #endregion

        #region Constructor

        public FRM_EditMenu(TreeMenu menu, Fwk.UI.Controls.Menu.Tree.MenuItem pMenuItemSurvey, Action pAction, string assemblybaseType)
        {
            InitializeComponent();
            menuItemEditorSurvey1.ShowAction       = pAction;
            menuItemEditorSurvey1.MenuItem         = pMenuItemSurvey;
            menuItemEditorSurvey1.TreeMenu         = menu;
            menuItemEditorSurvey1.AssemblyBaseType = assemblybaseType;
            menuItemEditorSurvey1.Populate();
        }
Esempio n. 5
0
        private void treeList1_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            _MenuItemSelected = (Fwk.UI.Controls.Menu.Tree.MenuItem)treeList1.GetDataRecordByNode(e.Node);

            if (_MenuItemSelected != null)
            {
                menuItemEditorSurvey1.ShowAction = Action.Query;
                menuItemEditorSurvey1.MenuItem   = _MenuItemSelected;
                menuItemEditorSurvey1.TreeMenu   = Menu;
                menuItemEditorSurvey1.Populate();
            }
        }
 private void treeList2_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
 {
     if (e.Node == null)
     {
         return;
     }
     Fwk.UI.Controls.Menu.Tree.MenuItem item = (Fwk.UI.Controls.Menu.Tree.MenuItem)treeList2.GetDataRecordByNode(e.Node);
     if (!String.IsNullOrEmpty(item.AssemblyInfo))
     {
         if (FormBase.CheckRule(item.AuthRule))
         {
             AddContronToPannel(item, null);
         }
     }
 }
Esempio n. 7
0
        /// <summary>
        /// Agrega un  MenuItem de negocio.
        /// </summary>
        /// <date>2008-07-13T00:00:00</date>
        /// <author>moviedo</author>
        private void AddMenuItem()
        {
            if (Menu == null || Menu.ItemList == null)
            {
                return;
            }
            if (_MenuItemSelected == null)
            {
                if (Menu.ItemList.Count == 0)
                {
                    fwkMessageView_Warning.Show("Please.. You must first create a root menu");
                    return;
                }
                fwkMessageView_Warning.Show("Please.. select any menu to execute this option.-");
                return;
            }
            // Esto hace que solo se desarrolle hasta arbol de nivel dos.
            int parentId = 0;

            if (_MenuItemSelected.ParentID == 0)
            {
                parentId = _MenuItemSelected.ID;
            }
            else
            {
                parentId = _MenuItemSelected.ParentID;
            }

            Fwk.UI.Controls.Menu.Tree.MenuItem wMenuItemNew = new Fwk.UI.Controls.Menu.Tree.MenuItem();
            wMenuItemNew.ParentID = parentId;
            using (FRM_EditMenu wFrm = new FRM_EditMenu(Menu, wMenuItemNew, Action.New, this.AssemblybaseType))
            {
                wFrm.ImageList = this.imageList2;
                if (wFrm.ShowDialog() == DialogResult.OK)
                {
                    if (_MenuItemSelected != null)
                    {
                        wMenuItemNew.ID = Menu.GetNewID();
                    }

                    Menu.ItemList.Add(wMenuItemNew);
                    treeList1.RefreshDataSource();
                    treeList1.ExpandAll();
                }
            }

            _Saved = false;
        }
        private void treeList2_NodeCellStyle(object sender, GetCustomNodeCellStyleEventArgs e)
        {
            if (e.Column.FieldName != "DisplayName")
            {
                return;
            }

            Fwk.UI.Controls.Menu.Tree.MenuItem m = (Fwk.UI.Controls.Menu.Tree.MenuItem)treeList2.GetDataRecordByNode(e.Node);
            if (String.IsNullOrEmpty(m.AuthorizationRuleName))
            {
                return;
            }

            if (!FormBase.CheckRule(m.AuthorizationRuleName))
            {
                //e.Appearance.BackColor = Color.FromArgb(80, 255, 0, 255);
                e.Appearance.ForeColor = Color.Gray;

                //e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
            }
        }
Esempio n. 9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="menuItem"></param>
        private void AddCategory(Fwk.UI.Controls.Menu.Tree.MenuItem menuItem)
        {
            if (Menu == null || Menu.ItemList == null)
            {
                return;
            }

            Fwk.UI.Controls.Menu.Tree.MenuItem wMenuItemNewCategory = new Fwk.UI.Controls.Menu.Tree.MenuItem();
            wMenuItemNewCategory.ParentID    = 0;
            wMenuItemNewCategory.ID          = Menu.GetNewID();
            wMenuItemNewCategory.DisplayName = "Root node " + (wMenuItemNewCategory.ID);
            //wMenuItemNewCategory.Category = wMenuItemNewCategory.DisplayName;
            //wMenuItemNewCategory.IsCategory = true;
            wMenuItemNewCategory.ImageIndex         = 0;
            wMenuItemNewCategory.SelectedImageIndex = 0;
            Menu.ItemList.Add(wMenuItemNewCategory);

            treeList1.RefreshDataSource();
            treeList1.ExpandAll();
            _Saved = false;
        }
Esempio n. 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            OpenFileDialog wSchemaDialog = new OpenFileDialog();

            wSchemaDialog.DefaultExt      = "dll";
            wSchemaDialog.CheckFileExists = true;

            wSchemaDialog.Filter       = FileFunctions.OpenFilterEnums.OpenAssembliesFilter;
            wSchemaDialog.ShowReadOnly = true;

            MenuItemList wMenuItemList = new MenuItemList();

            if (wSchemaDialog.ShowDialog() == DialogResult.OK)
            {
                Fwk.UI.Controls.Menu.Tree.MenuItem wMenuItem = new Fwk.UI.Controls.Menu.Tree.MenuItem();
                Assembly wAssembly = new Assembly(wSchemaDialog.FileName);
                lblFileName.Text = wSchemaDialog.FileName;

                foreach (AssemblyClass wAssemblyClass in wAssembly.ClassCollections)
                {
                    if (wAssemblyClass.BaseType != null)
                    {
                        foreach (string filter in _BaseClassNameFilter)
                        {
                            if (wAssemblyClass.BaseType.Name.Contains(filter))
                            {
                                wMenuItem = new Fwk.UI.Controls.Menu.Tree.MenuItem();
                                wMenuItem.AssemblyInfo = wAssemblyClass.FullyQualifiedName;

                                wMenuItemList.Add(wMenuItem);
                            }
                        }
                    }
                }

                listBox1.DataSource = wMenuItemList;
            }
        }