コード例 #1
0
        private void ShowScore(HttpContext context)
        {
            string xPath = context.Request.Params["XPath"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            DefinitionObject item = new DefinitionObject(Global.Core, source, xPath);

            item.SetValue("Enabled", true);

            item.Save();
        }
コード例 #2
0
        private void SetEquation(HttpContext context)
        {
            string path = context.Request.Params["Path"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            string equation = context.Request.Params["Equation"];

            DefinitionObject item = new DefinitionObject(Global.Core, source, path);

            item.SetValue("Equation", equation);

            item.Save();
        }
コード例 #3
0
        private void SetScoreName(HttpContext context)
        {
            string xPath = context.Request.Params["Path"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            string value = context.Request.Params["Value"];

            DefinitionObject item = new DefinitionObject(Global.Core, source, xPath);

            item.SetValue("Name", value);

            item.Save();
        }
コード例 #4
0
        private void SetScoreFactor(HttpContext context)
        {
            string xPath = context.Request.Params["Path"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            double value = 0.0;

            double.TryParse(context.Request.Params["Value"], out value);

            DefinitionObject item = new DefinitionObject(Global.Core, source, xPath);

            item.SetValue("Value", value);

            item.Save();
        }
コード例 #5
0
        private void ReorderScale(HttpContext context)
        {
            string xPath = context.Request.Params["XPath"];

            // Get the source string from the http request's parameters.
            string source = context.Request.Params["Source"];

            DefinitionObject score = new DefinitionObject(Global.Core, source, xPath);

            int order = int.Parse(context.Request.Params["Order"]);

            int oldOrder = int.Parse(score.GetValue("Order").ToString());

            score.SetValue("Order", order);
            score.Save();

            DefinitionObject[] scores = score.GetParent().GetChilds();
            foreach (DefinitionObject _score in scores)
            {
                int _order = int.Parse(_score.GetValue("Order").ToString());

                if (_order < order)
                {
                    continue;
                }

                if (_order >= oldOrder)
                {
                    continue;
                }

                if (_score.GetValue("Id") == score.GetValue("Id"))
                {
                    continue;
                }

                _score.SetValue(
                    "Order",
                    (_order + 1)
                    );

                _score.Save();
            }

            ReOrderScores(scores.OrderBy(x => int.Parse(x.GetValue("Order").ToString())).ToArray());
        }