Ejemplo n.º 1
0
        private void btnRpermAdd_Click(object sender, EventArgs e)
        {
            RocketPermissions perms       = XmlFileHandler.GetRocketPerm();
            string            grp         = cbGroup.SelectedItem.ToString();
            string            elementType = cbPermConAdd.SelectedItem.ToString();
            string            element     = txtcmdAdd.Text;
            uint CoolDown = Convert.ToUInt32(nudCooldown.Value);

            if (elementType == "Color" || elementType == "color")
            {
                for (int i = 0; i < perms.Groups.Length; i++)
                {
                    if (perms.Groups[i] == (RocketPermissionsGroup)cbGroup.SelectedItem)
                    {
                        perms.Groups[i].Color = element;
                    }
                }
            }
            else
            {
                for (int i = 0; i < perms.Groups.Length; i++)
                {
                    if (perms.Groups[i].DisplayName == cbGroup.DisplayMember)
                    {
                        perms.Groups[i].permission.Add(new Permission(element, CoolDown));
                    }
                }
            }
            //XmlFileHandler.UpdateRocketPerm(rocketPermissions, @lelementType, element, grp,CoolDown);

            DefaultSerialization.serialize(perms, Dir + "\\Permissions.config.xml");
            updateData();
        }
Ejemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            FileHandler.scanFileDirectory();
            ConfigHandler.checkLocalFiles();
            AppCon  = ConfigHandler.getConfig();
            plugins = ConfigHandler.GetPluginList();
            items   = ConfigHandler.GetItemIndex();

            //load plugin Dll files
            assemblies = XmlFileHandler.LoadPlugins();
            PluginManifest();
        }
Ejemplo n.º 3
0
        //Use Update Data to update the lists in the memory and display required data.
        private void updateData()
        {
            txtcmdAdd.Text             = "";
            cbGroup.SelectedIndex      = -1;
            cbPermConAdd.SelectedIndex = -1;
            //cbGroup.Items.Clear();
            rocketPermissions = XmlFileHandler.GetRocketPerm();

            cbGroup.DataSource    = rocketPermissions.Groups;
            cbGroup.DisplayMember = "DisplayName";

            //if (rocketPermissions.Groups != null)
            //{
            //    foreach (var item in rocketPermissions.Groups)
            //    {
            //        cbGroup.Items.Add(item.DisplayName.ToString());
            //    }
            //}
        }