Beispiel #1
0
 private void roleObjectsTreeView_DragDrop(object sender, DragEventArgs e)
 {
     if (e.Data.GetDataPresent(typeof(List <GrtValue>)) == true)
     {
         List <GrtValue> selGrtValues = (List <GrtValue>)e.Data.GetData(typeof(List <GrtValue>));
         foreach (GrtValue grtValue in selGrtValues)
         {
             RoleEditorBackend.add_object(grtValue);
         }
     }
     else if (e.Data.GetDataPresent(typeof(GrtValue)) == true)
     {
         GrtValue selGrtValue = (GrtValue)e.Data.GetData(typeof(GrtValue));
         RoleEditorBackend.add_object(selGrtValue);
     }
     roleObjectListWrapper.refresh();
     roleObjectListModel.RefreshModel();
 }
Beispiel #2
0
        public override bool ReinitWithArguments(GrtValue value)
        {
            InitializingControls = true;

            try
            {
                Backend = new RoleEditorBE(GrtManager, value);

                // (Re) Initialize backend.
                roleTreeBE = RoleEditorBackend.get_role_tree();
                roleTreeBE.refresh();

                roleObjectListWrapper = RoleEditorBackend.get_object_list();
                roleObjectListWrapper.refresh();
                rolePrivilegeListWrapper = RoleEditorBackend.get_privilege_list();
                rolePrivilegeListWrapper.refresh();

                if (roleTreeModel != null)
                {
                    roleTreeModel.DetachEvents();
                }
                roleTreeModel = new SimpleGrtTreeModel(rolesTreeView, roleTreeBE, false);
                roleTreeModel.AddColumn(roleNameNodeControl, (int)RoleTreeBE.Columns.Name, false);
                rolesTreeView.Model = roleTreeModel;

                if (roleObjectListModel != null)
                {
                    roleObjectListModel.DetachEvents();
                }
                roleObjectListModel = new SimpleGrtListModel(roleObjectsTreeView, roleObjectListWrapper, objectIconNodeControl, false);
                roleObjectListModel.AddColumn(objectNameNodeControl, (int)RoleObjectListWrapper.Columns.Name, false);
                roleObjectsTreeView.Model = roleObjectListModel;

                RefreshFormData();
            }
            finally
            {
                InitializingControls = false;
            }

            Invalidate();

            return(true);
        }
        public override bool ReinitWithArguments(GrtValue value)
        {
            InitializingControls = true;

              try
              {
            Backend = new RoleEditorBE(GrtManager, value);

            // (Re) Initialize backend.
            roleTreeBE = RoleEditorBackend.get_role_tree();
            roleTreeBE.refresh();

            roleObjectListWrapper = RoleEditorBackend.get_object_list();
            roleObjectListWrapper.refresh();
            rolePrivilegeListWrapper = RoleEditorBackend.get_privilege_list();
            rolePrivilegeListWrapper.refresh();

            if (roleTreeModel != null)
              roleTreeModel.DetachEvents();
            roleTreeModel = new SimpleGrtTreeModel(rolesTreeView, roleTreeBE, false);
            roleTreeModel.AddColumn(roleNameNodeControl, (int)RoleTreeBE.Columns.Name, false);
            rolesTreeView.Model = roleTreeModel;

            if (roleObjectListModel != null)
              roleObjectListModel.DetachEvents();
            roleObjectListModel = new SimpleGrtListModel(roleObjectsTreeView, roleObjectListWrapper, objectIconNodeControl, false);
            roleObjectListModel.AddColumn(objectNameNodeControl, (int)RoleObjectListWrapper.Columns.Name, false);
            roleObjectsTreeView.Model = roleObjectListModel;

            RefreshFormData();
              }
              finally
              {
            InitializingControls = false;
              }

              Invalidate();

              return true;
        }