Esempio n. 1
0
        private void HandleTagReplacement(ContentView contentView)
        {
            var content = contentView.Content;
            var oldTag  = content["DisplayName"].ToString();

            this.OnSave(contentView, content);
            var node = GetContextNodeForControl(this);

            if (oldTag != node.DisplayName)
            {
                TagManager.ReplaceTag(oldTag, node.DisplayName, Page.Request.Params["Paths"].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList());
            }
        }
Esempio n. 2
0
        protected override void MessageControlButtonsAction(object sender, CommandEventArgs e)
        {
            if (Page.Request.QueryString["toBlacklist"] == "true")
            {
                var contextNode   = GetContextNode();
                var blacklistNode = Node.LoadNode(contextNode.Parent.Path + "/Blacklist");
                blacklistNode["BlackListItems"] += " " + contextNode.DisplayName;
                blacklistNode.Save();
            }

            var pathList = Page.Request.Params["Paths"].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            TagManager.ReplaceTag(GetContextNode().DisplayName, String.Empty, pathList);
            base.MessageControlButtonsAction(sender, e);
        }
Esempio n. 3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            var contextNode = GetContextNode();

            if (contextNode == null)
            {
                CallDone();
                return;
            }

            var tmp           = Content.Load(contextNode.Id);
            var pathListParam = Page.Request.Params["Paths"];

            if (string.IsNullOrEmpty(pathListParam))
            {
                return;
            }

            var pathList = pathListParam.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();

            switch (Page.Request.QueryString["Do"])
            {
            case "Add":
                //tmp["IsBlacklisted"] = true;
                TagManager.ManageBlacklist(true, contextNode.Id, pathList);
                TagManager.ReplaceTag(tmp.DisplayName, String.Empty, pathList);
                break;

            case "Remove":
                //tmp["IsBlacklisted"] = false;
                TagManager.ManageBlacklist(false, contextNode.Id, pathList);
                break;
            }

            tmp.Save();

            CallDone();
        }