Ejemplo n.º 1
0
 static bool ModExt_NewPropsUI3(CtrlHome __instance, ref int index)
 {
     if (index < 0 || index > Traverse.Create(__instance).Field("characterMapping").GetValue <List <CharacterMapping> >().Count)
     {
         index = 0;
     }
     return(true);
 }
Ejemplo n.º 2
0
        public static void ShowPatch_nonbattleChangeElement(ref UIMartialArts __instance)
        {
            Heluo.Logger.LogError("ShowPatch_nonbattleChangeElement start");
            //获得特技按钮
            WGMartialArtsBtn[] martialArts    = Traverse.Create(__instance).Field("martialArts").GetValue <WGMartialArtsBtn[]>();
            WGMartialArtsBtn   specialButton  = martialArts[5];
            Button             specialButton2 = specialButton.GetComponent <Button>();

            if (specialButton2 == null)
            {
                specialButton2 = specialButton.gameObject.AddComponent <Button>();
            }
            //添加点击事件
            UIHome home = Traverse.Create(__instance).Field("home").GetValue <UIHome>();

            homeController = Traverse.Create(home).Field("controller").GetValue <CtrlHome>();
            specialButton2.onClick.AddListener(delegate() { openElementUI(); });
        }
Ejemplo n.º 3
0
        public ModifyUser(string name, string fullname, string description, List <string> groupList, bool ChangePwNextLogon, bool PasswordCantBeChanged, bool PasswordNeverExpires, bool AccountDisabled, string password, CtrlHome ch, object[] comboBoxItems)
        {
            InitializeComponent();
            ConfigClass    _configClass    = new ConfigClass();
            ScriptHandling _scriptHandling = new ScriptHandling();
            int            indexForChecked = 0;

            foreach (string userGroupsString in _ctrlhome.localGroupMembers)
            {
                chkListBChangeGroups.Items.Add(userGroupsString);
                indexForChecked++;
                {
                    foreach (string checkedString in _ctrlhome.GroupsToBeChecked)
                    {
                        if (checkedString == userGroupsString)
                        {
                            chkListBChangeGroups.SetItemChecked(indexForChecked - 1, true);
                        }
                    }
                }
            }
            if (chkListBChangeGroups.CheckedItems.Count != 0)
            {
                foreach (string checkedItemsString in chkListBChangeGroups.CheckedItems)
                {
                    groupList.Add(checkedItemsString);
                }
            }
            lbUserName.Text                = name;
            tbUserFullName.Text            = fullname;
            tbUserDescription.Text         = description;
            tbNewPasword1.Text             = password;
            tbNewPasword2.Text             = password;
            cbChangePwNextLogon.Checked    = ChangePwNextLogon;
            cbPaswordCantBeChanged.Checked = PasswordCantBeChanged;
            cbPaswordNeverExpires.Checked  = PasswordNeverExpires;
            cbAccountDisabled.Checked      = AccountDisabled;
            _ctrlhome = ch;
        }
Ejemplo n.º 4
0
        public ModifyUser(string userName, CtrlHome ctrl)
        {
            InitializeComponent();
            try
            {
                userPrincipal       = UserPrincipal.FindByIdentity(domain, IdentityType.Name, userName);
                lbUserName.Text     = userPrincipal.Name;
                tbUserFullName.Text = userPrincipal.DisplayName;
                foreach (string strGroup in _ctrlhome.localGroupMembers)
                {
                    chkListBChangeGroups.Items.Add(strGroup);
                }

                tbUserDescription.Text         = userPrincipal.Description;
                cbPaswordNeverExpires.Checked  = userPrincipal.PasswordNeverExpires;
                cbPaswordCantBeChanged.Checked = userPrincipal.UserCannotChangePassword;
                cbAccountDisabled.Checked      = userPrincipal.IsAccountLockedOut();
                _ctrlhome = ctrl;
            }
            catch (Exception ex)
            {
                Actemium.Diagnostics.Trace.WriteError("({0})", "ModifyUser", "ModifyUser", ex, userName);
            }
        }