Inheritance: MonoBehaviour
Exemplo n.º 1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Controllor-First模式,先创建Controllor(PersonControllor)再将View(PersonForm)注入到Controllor(PersonControllor)中
            PersonControl control = new PersonControl(new FormMain());

            Application.Run(control.View);
        }
Exemplo n.º 2
0
        public ResourceManager(ClientControl clientControl)
        {
            ClientControl = clientControl;

            _personControl           = new PersonControl(ClientControl);
            _groupControl            = new GroupControl(ClientControl);
            _ocgSSoDControl          = new OcgSSoDControl(clientControl);
            _ocgOrgUnitControl       = new OcgOrgUnitControl(clientControl);
            _ocgOrgAssignmentControl = new OcgOrgAssignmentControl(clientControl);
            _ocgRoleControl          = new OcgRoleControl(clientControl);
            _approvalControl         = new ApprovalControl(clientControl);
            _genericControl          = new GenericControl(clientControl);
        }
Exemplo n.º 3
0
        private void AttachEvents()
        {
            // TODO move elsewhere
            App.Core.PeopleM.PropertyChanged += (o, e) => {
                if (nameof(App.Core.PeopleM.Current).Equals(e.PropertyName))
                {
                    var current = App.Core.PeopleM.Current;
                    Activate(TabPerson, current != null);
                    _ = PersonControl.ReloadPersonSegmentsAsync(current);

                    if (current != null && !App.WMain.RightSlidePanel.IsOpen)
                    {
                        App.WMain.RightSlidePanel.IsOpen = true;
                    }
                }
            };
        }
        private void LoadPerson(Person person = null)
        {
            // check if tab already loaded
            if (person != null)
            {
                foreach (XtraTabPage t in tabMain.TabPages)
                {
                    IControl control = GetControl(t);
                    if (control.TabType == TabType.Person &&
                        control.Id == person.Oid)
                    {
                        tabMain.SelectedTabPage = t;
                        return;
                    }
                }
            }


            PersonControl p = new PersonControl();

            if (person == null)
            {
                p.LoadData(new Person(), collectionCategories);
            }
            else
            {
                p.LoadData(person, collectionCategories);
            }

            var tab = tabMain.TabPages.Add(person == null ? "[New Person]" : p.Title.Replace("&", "and"));

            p.Dock = DockStyle.Fill;
            tab.Controls.Add(p);
            tab.Image = imgIcons.Images[2];
            tabMain.SelectedTabPage = tab;
        }