/// <summary>
        /// Rebuilds the tree from scratch.
        /// </summary>
        public void RebuildTree(bool saveState)
        {
            // store old tree state
            if (project != null && saveState)
            {
                PluginData.GetPrefs(project).ExpandedPaths = ExpandedPaths;
                PluginData.Save();
            }

            foreach (GenericNode node in Nodes)
            {
                node.Dispose();
            }

            BeginUpdate();

            SelectedNodes = null;
            Nodes.Clear();
            nodeMap.Clear();
            ShowRootLines = false;

            if (project == null)
            {
                EndUpdate();
                return;
            }

            // create the top-level project node
            ProjectNode projectNode = new ProjectNode(project);

            Nodes.Add(projectNode);
            projectNode.Refresh(true);
            projectNode.Expand();

            ArrayList classpaths = new ArrayList();

            if (Settings.ShowProjectClasspaths)
            {
                classpaths.AddRange(project.Classpaths);
            }

            if (Settings.ShowGlobalClasspaths)
            {
                classpaths.AddRange(Settings.GlobalClasspaths.Split(';'));
            }

            // add classpaths at the top level also
            foreach (string classpath in classpaths)
            {
                string absolute = classpath;

                if (!Path.IsPathRooted(absolute))
                {
                    absolute = project.GetAbsolutePath(classpath);
                }

                if (absolute.StartsWith(project.Directory))
                {
                    continue;
                }

                ClasspathNode cpNode = new ClasspathNode(project, absolute, classpath);
                Nodes.Add(cpNode);
                cpNode.Refresh(true);
                ShowRootLines = true;
            }

            // restore tree state
            if (project != null && Settings.RestoreTreeState)
            {
                ExpandedPaths = PluginData.GetPrefs(project).ExpandedPaths;
            }

            // scroll to the top
            projectNode.EnsureVisible();
            SelectedNode = projectNode;
            Win32.Scrolling.scrollToLeft(this);

            EndUpdate();
        }
Ejemplo n.º 2
0
        private void RegisterDefaults()
        {
            if (_stored.Events == null || _stored.Events.Count != 0)
            {
                return;
            }

            _stored.Events.Add(new EventSetting
            {
                EventDuration     = 800f,
                EventName         = "Low Level",
                NpcAggression     = 120f,
                NpcRadius         = 15f,
                NpcCount          = 6,
                NpcHealth         = 100,
                NpcName           = "Easy Guard",
                MarkerColor       = "#32a844",
                MarkerBorderColor = "#000000",
                MarkerOpacity     = 0.9f
            });

            _stored.Events.Add(new EventSetting
            {
                EventDuration     = 800f,
                EventName         = "Medium Level",
                NpcAggression     = 120f,
                NpcRadius         = 15f,
                NpcCount          = 8,
                NpcHealth         = 150,
                NpcName           = "Medium Guard",
                MarkerColor       = "#eddf45",
                MarkerBorderColor = "#000000",
                MarkerOpacity     = 0.9f
            });

            _stored.Events.Add(new EventSetting {
                EventDuration     = 1800f,
                EventName         = "Hard Level",
                NpcAggression     = 150f,
                NpcRadius         = 50f,
                NpcCount          = 10,
                NpcHealth         = 200,
                NpcName           = "Hard Guard",
                MarkerColor       = "#3060d9",
                MarkerBorderColor = "#000000",
                MarkerOpacity     = 0.9f
            });

            _stored.Events.Add(new EventSetting {
                EventDuration     = 1800f,
                EventName         = "Elite Level",
                NpcAggression     = 180f,
                NpcRadius         = 50f,
                NpcCount          = 12,
                NpcHealth         = 350,
                NpcName           = "Elite Guard",
                MarkerColor       = "#e81728",
                MarkerBorderColor = "#000000",
                MarkerOpacity     = 0.9f
            });

            _stored.Save();
        }
Ejemplo n.º 3
0
        protected void CtrlItemCommand(object source, RepeaterCommandEventArgs e)
        {
            var cArg       = e.CommandArgument.ToString();
            var param      = new string[3];
            var pluginData = new PluginData(PortalId);

            switch (e.CommandName.ToLower())
            {
            case "entrydetail":
                param[0] = "eid=" + cArg;
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "move":
                MoveRecord(cArg);
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "save":
                if (Utils.IsNumeric(cArg))
                {
                    pluginData.UpdatePlugin(rpData, Convert.ToInt32(cArg));
                    pluginData.Save();
                }
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "add":
                pluginData.AddNewPlugin();
                pluginData.Save();
                param[0] = "";
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "delete":
                // NOTE: The delete button cannot work at portal level.  Each plugin must be entered at system level, therefore deleting at portal level has no effect
                // the plugin is re-entered back into the portal from the system level. (This is CORRECT, pluging needs to be uninstalled to be removed, at portal level we simply hide them)
                if (Utils.IsNumeric(cArg))
                {
                    pluginData.RemovePlugin(Convert.ToInt32(cArg));
                    pluginData.Save();
                }
                param[0] = "";
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "resetportal":
                pluginData.RemovePortalLevel();
                param[0] = "";
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "reload":
                param[0] = "";
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;

            case "return":
                param[0] = "";
                Response.Redirect(NBrightBuyUtils.AdminUrl(TabId, param), true);
                break;
            }
        }