Exemple #1
0
        protected override void ProcessItem(Item item)
        {
            LogErrors(() =>
            {
                if (!CheckSessionCanDoInteractiveAction())
                {
                    return;
                }

                if (Context.Job != null)
                {
                    var fields = "*";
                    if (Name != null && Name.Length > 0)
                    {
                        fields = Name.Aggregate((current, next) => current + "|" + next);
                    }
                    var icon         = string.IsNullOrEmpty(SectionIcon) ? item.Appearance.Icon : SectionIcon;
                    var sectionTitle = string.IsNullOrEmpty(SectionTitle) ? item.Name : SectionTitle;
                    var message      = new ShellCommandInItemContextMessage(item,
                                                                            "powershell:fieldeditor(title=" + (string.IsNullOrEmpty(Title) ? item.Name : Title) +
                                                                            ",preservesections=" + (PreserveSections ? "1" : "0") +
                                                                            ",fields=" + fields +
                                                                            ",icon=" + icon +
                                                                            ",section=" + sectionTitle +
                                                                            ",width=" + Width +
                                                                            ",height=" + Height +
                                                                            ",isf=" + (IncludeStandardFields ? "1" : "0") +
                                                                            ")");

                    PutMessage(message);
                    var result = GetSheerResult(message).ToString();
                    WriteObject(result);
                }
            });
        }
Exemple #2
0
                public string Decrypt()
                {
                    string ret = Name.Aggregate("", (agg, c) => agg + (char)((c - 'a' + ID) % 26 + 'a'));

                    return(ret);
                }