Beispiel #1
1
        /// <summary>
        /// Creates a new Nulunk instance. 
        /// </summary>
        public Nulunk(string sourceType = "nulunk", int forceFlushCount = 100)
        {
            _cqueue = new ConcurrentQueue<string>();
            _args = new Args();
            Command cli = Command.Splunk("search");
            _service = Service.Connect(cli.Opts);
            _receiver = new Receiver(_service);

            _args.Add("sourcetype", sourceType);
            _forceFlushCount = forceFlushCount;
        }
        public void TestLiveNamespace1()
        {
            Service service = Connect();

            String username = "******";
            String password = "******";
            String savedSearch = "sdk-test1";
            String searchString = "search index=main * | 10";

            // Setup a namespace
            Args splunkNameSpace = new Args();
            splunkNameSpace.Add("owner", username);
            splunkNameSpace.Add("app", "search");

            // Get all users, scrub and make our test user
            UserCollection users = service.GetUsers();
            if (users.ContainsKey(username))
            {
                users.Remove(username);
            }

            Assert.IsFalse(users.ContainsKey(username), "Expected users to not contain: " + username);
            users.Create(username, password, "user");
            Assert.IsTrue(users.ContainsKey(username), "Expected users to contain: " + username);

            // Get saved searches for our new namespace, scrub and make our test saved searches
            SavedSearchCollection savedSearches = service.GetSavedSearches(splunkNameSpace);
            if (savedSearches.ContainsKey(savedSearch))
            {
                savedSearches.Remove(savedSearch);
            }

            Assert.IsFalse(savedSearches.ContainsKey(savedSearch), "Expected the saved search to not contain " + savedSearch);

        }
Beispiel #3
0
 private static bool ParseCmdType(string[] strArgs, Args args)
 {
     switch (strArgs[0])
     {
         case "list":
             args.CmdType = CommandType.ListPasses;
             break;
         case "update":
             args.CmdType = CommandType.Update;
             break;
         case "add":
             args.CmdType = CommandType.AddPass;
             args.PassItem = ParsePassItem(strArgs);
             break;
         case "del":
             args.CmdType = CommandType.RemovePass;
             args.FindPassById = ParseId(strArgs);
             break;
         case "edit":
             args.CmdType = CommandType.EditPass;
             args.FindPassById = ParseId(strArgs);//to be sure that i have id
             args.PassItem = ParsePassItem(strArgs);
             break;
         case "info":
             args.CmdType = CommandType.ShowPassInfo;
             args.FindPassById = ParseId(strArgs);
             break;
         case "reset":
             args.CmdType = CommandType.ResetPsd;
             break;
         default:
             return false;
     }
     return true;
 }
Beispiel #4
0
        protected override void Execute(Args args)
        {
            var entries = ScriptLogEntry.Load(Database);
            var version = VersionNumber.Parse(args.GetValue("version"));

            if (entries.Any(x => x.Version == version.ToString() && !x.ScriptNumber.HasValue))
            {
                switch (args.GetValueOrDefault("conflict", ConflictStrategy.Fail))
                {
                    case ConflictStrategy.Fail:
                        throw new ApplicationException("Version already exists.");
                    case ConflictStrategy.Notify:
                        using (TemporaryConsoleColorWarning())
                            Console.WriteLine("Version already exists.");
                        return;
                    case ConflictStrategy.Ignore:
                        return;
                    default:
                        throw new ArgumentOutOfRangeException();
                }
            }

            const string sql = "insert [dbo].[ScriptLog] ([Version], [User], [Date]) values (@version, @user, @date)";
            var entry = new
                                {
                                    Date = DateTimeOffset.UtcNow,
                                    User = Environment.UserName,
                                    Version = version.ToString()
                                };
            Database.Execute(sql, entry);
        }
Beispiel #5
0
 public void SimpleIntPresent()
 {
     var args = new Args("x#", "-x", "42");
     args.Has('x').ShouldBeTrue();
     args.Get<int>('x').ShouldBe(42);
     args.NextArgument().ShouldBe(2);
 }
 private static void FillUserPassword(Args args)
 {
     if (args.UserPassword != null)
         return;
     Console.WriteLine("Enter user password:");
     args.UserPassword = Console.ReadLine();
 }
Beispiel #7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Resource"/> class, 
        /// adding optional arguments for namespace and other endpoint 
        /// arguments.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="path">The path of this resource.</param>
        /// <param name="args">The variable arguments.</param>
        public Resource(Service service, string path, Args args)
        {
            this.Service = service;
            /* Pull out namespace items (app, owner, sharing) from the args, and
             * then use to create the full path.
             */
            Args clonedArgs = new Args(args);
            Args splunkNamespace = new Args();
            if (args.ContainsKey("app"))
            {
                splunkNamespace.Set("app", args["app"].ToString());
                clonedArgs.Remove("app");
            }
            if (args.ContainsKey("owner"))
            {
                splunkNamespace.Set("owner", args["owner"].ToString());
                clonedArgs.Remove("owner");
            }
            if (args.ContainsKey("sharing"))
            {
                splunkNamespace.Set(
                    "sharing", args["sharing"].ToString());
                clonedArgs.Remove("sharing");
            }
            if (!clonedArgs.ContainsKey("count"))
            {
                clonedArgs.Set("count", "-1");
            }

            this.RefreshArgs = clonedArgs;
            this.Path = service.Fullpath(
                path, splunkNamespace.Count == 0 ? null : splunkNamespace);
            this.MaybeValid = false;
        }
Beispiel #8
0
        public static NamedAction GetActionKey(Args arguments, NamedAction defaultAction)
        {
            NamedAction actionKey = arguments.IsDefault ?
                                                            defaultAction : arguments.GetActionKey();

            return actionKey;
        }
Beispiel #9
0
 private static Args ParseArgs(string[] argArray)
 {
     var args = new Args{Repeat = 1};
     Action<string> nextArg = null;
     foreach (var a in argArray)
     {
         if (nextArg != null)
         {
             nextArg(a);
             nextArg = null;
             continue;
         }
         if (a.StartsWith("-") || a.StartsWith("/"))
         {
             switch (a.Substring(1))
             {
                 case "r":
                     nextArg = s => args.Repeat = int.Parse(s);
                     break;
                 default:
                     throw new ArgumentOutOfRangeException("unknown arg: " + a);
             }
         }
     }
     return args;
 }
Beispiel #10
0
 public void Test_Creating()
 {
     var args = new Args("path", "mask", ProgramAction.FileRename);
     Assert.AreEqual(args.Path, "path");
     Assert.AreEqual(args.Mask, "mask");
     Assert.AreEqual(args.Action, ProgramAction.FileRename);
 }
Beispiel #11
0
 private static void BotChatConnection_ChatMessageReceived(object o, Args.ChatMessageReceivedEventArgs e)
 {
     if(e.Message.Message == Command)
     {
         StartRaidGame();
         enteredViewers.Add(new Viewer(e.Message.Author));
     }
 }
Beispiel #12
0
 public void TestUsge()
 {
     var args = new Args(1, "abc", new DateTime(2013, 10, 15), this);
       Assert.That(args.Get<int>(0), Is.EqualTo(1));
       Assert.That(args.Get<string>(1), Is.EqualTo("abc"));
       Assert.That(args.Get<DateTime>(2), Is.EqualTo(new DateTime(2013, 10, 15)));
       Assert.That(args.Get<ArgsTest>(3), Is.SameAs(this));
 }
Beispiel #13
0
        private static void FillPcPath(Args args)
        {
            if (args.PcPath != null)
                return;

            Console.WriteLine("Enter path to PC base:");
            args.PcPath = Console.ReadLine();
        }
Beispiel #14
0
 public void ExtraArgumentsThatLookLikeFlags()
 {
     var args = new Args("x,y", "-x", "alpha", "-y", "beta");
     args.Has('x').ShouldBeTrue();
     args.Has('y').ShouldBeFalse();
     args.Get<bool>('x').ShouldBeTrue();
     args.Get<bool>('y').ShouldBeFalse();
     args.NextArgument().ShouldBe(1);
 }
        /// <summary>
        /// Establishes and returns a namespace.
        /// </summary>
        public Args CreateNamespace(String username, String appname)
        {
            Args splunkNamespace = new Args();

            splunkNamespace.Add("owner", username);
            splunkNamespace.Add("app", appname);

            return splunkNamespace;
        }
        private static void RunGeneration(IAnnotator annotator, NugetSpec nuspec, Args parsedArgs)
        {
            var version = parsedArgs.Version ?? new Version("1.0.0.0");
            var dir = parsedArgs.Directory ?? new DirectoryInfo(Environment.CurrentDirectory);
            var fixedSpec = SpecWithVersion(nuspec, version);
            annotator.CreateNugetPackage(fixedSpec, dir);

            Console.WriteLine($"Generated version {version}  in {dir.FullName}");
        }
        public static void Start(Args args)
        {
            var job = m_instancePool.Allocate();

            job.m_args = args;
            args.Tracker.Add(args.GeometryCell, job);

            MyPrecalcComponent.EnqueueBack(job);
        }
Beispiel #18
0
 public void ExtraArguments()
 {
     var args = new Args("x,y*", "-x", "-y", "alpha", "beta");
     args.Has('x').ShouldBeTrue();
     args.Has('y').ShouldBeTrue();
     args.Get<bool>('x').ShouldBeTrue();
     args.Get<string>('y').ShouldBe("alpha");
     args.NextArgument().ShouldBe(3);
 }
Beispiel #19
0
        protected override void Execute(Args args)
        {
            var count = int.Parse(args.GetValueOrDefault("count", "10"));
            var entries = ScriptLogEntry.Load(Database, count).ToList();

            Console.WriteLine();
            Console.WriteLine(ScriptLogEntry.Format(entries));
            Console.WriteLine();
        }
        public static void Start(Args args)
        {
            Debug.Assert(args.Storage != null);
            var job = m_instancePool.Allocate();

            job.m_isCancelled = false;
            job.m_args = args;
            args.RenderWorkTracker.Add(args.WorkId, job);

            MyPrecalcComponent.EnqueueBack(job, false /*job.m_args.IsHighPriority*/);
        }
Beispiel #21
0
 public DacCreator(Args args)
 {
     _outputPath = args.DacpacPath;
     _sourceFolder = args.SourcePath;
     _references = args.References;
     _version = args.SqlServerVersion;
     _options = args.SqlModelOptions;
     _preDeployScript = args.PreCompareScript;
     _postDeployScript = args.PostCompareScript;
     if(args.FixDeployScripts)
         ScriptFixer = new DdlScriptParser(_version);
 }
 protected override void Execute(Args args)
 {
     Database.Execute(
         @"MERGE DatabaseVersion AS target
     USING (SELECT @VersionNumber) AS source (VersionNumber)
     ON (target.VersionNumber = source.VersionNumber)
     WHEN MATCHED THEN
     UPDATE SET InsertedDate = sysdatetime()
     WHEN NOT MATCHED THEN
     INSERT (VersionNumber, DescriptionText)
     VALUES (source.VersionNumber, 'DbMigrator');",
         new {VersionNumber = args.GetValue("version")});
 }
        protected override void Execute(Args args)
        {
            var runAtDeployScript = args.GetValue("storedprocedure");
            Console.WriteLine();
            Console.WriteLine("Server   " + args.GetValue("server"));
            Console.WriteLine("Database " + args.GetValue("database"));
            Console.WriteLine("Stored Procedure " + runAtDeployScript);

            var isInitialized = "SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[" + runAtDeployScript + "]') AND type in (N'P', N'PC')";
            if (!Database.Query(isInitialized).Any()) throw new ApplicationException("Stored procedure " + runAtDeployScript + " is missing in database.");

            Database.Execute(x => x.Execute("exec " + runAtDeployScript));
        }
Beispiel #24
0
        static Args CreateArgs(string[] args)
        {
            Args result = new Args();
            result.ShowHelp = false;

            try
            {
                foreach (string arg in args)
                {
                    if (arg.StartsWith("-p="))
                    {
                        result.Project = arg.Remove(0, 3);
                    }
                    else if (arg.StartsWith("--project="))
                    {
                        result.Project = arg.Remove(0, 10);
                    }
                    else if (arg.StartsWith("-o="))
                    {
                        result.OutputFile = arg.Remove(0, 3);
                    }
                    else if (arg.StartsWith("--output="))
                    {
                        result.OutputFile = arg.Remove(0, 9);
                    }
                    else if (arg.StartsWith("-f="))
                    {
                        result.Format = arg.Remove(0, 3);
                    }
                    else if (arg.StartsWith("--format="))
                    {
                        result.Format = arg.Remove(0, 9);
                    }
                    else if (arg.StartsWith("-h"))
                    {
                        result.ShowHelp = true;
                    }
                    else if (arg.StartsWith("--help"))
                    {
                        result.ShowHelp = true;
                    }
                }
            }
            catch
            {
                result.ShowHelp = true;
            }

            return result;
        }
        public static void Start(Args args)
        {
            Debug.Assert(args.Storage != null);
            var job = m_instancePool.Allocate();

            job.m_isCancelled = false;
            job.m_args = args;

            if (!args.RenderWorkTracker.Exists(args.WorkId))
            {
                args.RenderWorkTracker.Add(args.WorkId, job);
            }

            MyPrecalcComponent.EnqueueBack(job);
        }
Beispiel #26
0
 public int Execute(string[] args)
 {
     try
     {
         _args = Parse(args);
         Execute(_args);
         return 0;
     }
     catch (Exception exception)
     {
         using (TemporaryConsoleColorError())
             Console.WriteLine(exception.Message);
         return 1;
     }
 }
        public static void Start(Args args)
        {
            var job = m_instancePool.Allocate();
            Debug.Assert(job.m_outBatches.Count == 0, "Merge job batches not cleared");

            job.m_isCancelled = false;
            job.m_args = args;

            if (!args.RenderWorkTracker.Exists(args.WorkId))
            {
                args.RenderWorkTracker.Add(args.WorkId, job);
            }

            MyPrecalcComponent.EnqueueBack(job);
        }
    public void Create(string title_)
    {
      gbControls.Text = title_;

      m_args = new Args();

      cmbCommodity.AddItems(Singleton<ComIDs>.Instance);
      cmbCommodity.Bind(m_args, "Commodity");

      cmbMonth.AddItems(typeof(MonthCode));
      cmbMonth.Bind(m_args, "Month", new Validators.EnumDescValidator(MonthCode.J));
      cmbMonth.SelectedIndex = 0;

      tbYearOffset.Bind(m_args, "YearOffset", new Validators.IntValidator());
    }
Beispiel #29
0
        public static Args ParseArgs(string[] args)
        {
            if (args == null) args = new string[0];
            if (args.Length == 0)
                _isDefault = true;

            var result = new Args();
            IArgumentMapFactory _argumentMapFactory = new ArgumentMapFactory();
            IArgumentParser _argumentParser = new ArgumentParser();
            IEnumerable<IArgument> arguments = _argumentParser.Parse(args);
            IArgumentMap mapper = _argumentMapFactory.CreateMap(result);
            IEnumerable<IArgument> remaining = mapper.ApplyTo(result, arguments);

            return result;
        }
Beispiel #30
0
 public void CallEvent(Event Event, Args.ChraftEventArgs e)
 {
     switch (Event)
     {
         case Event.BlockDestroy:
             OnDestroy(e as BlockDestroyEventArgs);
             break;
         case Event.BlockPlace:
             OnPlace(e as BlockPlaceEventArgs);
             break;
         case Event.BlockTouch:
             OnTouch(e as BlockTouchEventArgs);
             break;
     }
 }
Beispiel #31
0
 public void Error(string messageSignature, params object[] args)
 {
     Logger.AddEntry(messageSignature, Args.Exception(messageSignature, args), args.Select(a => a.ToString()).ToArray());
 }
 protected bool IsArg(string arg) => Args.ElementAtOrDefault(CurrentArg) == arg;
Beispiel #33
0
 public IJsonValue Visit(ArrayFieldProperties properties, Args args)
 {
     return(JsonValue.Array());
 }
Beispiel #34
0
 public IJsonValue Visit(IField <UIFieldProperties> field, Args args)
 {
     return(args.Value);
 }
Beispiel #35
0
        internal static void Initializer()
        {
            try
            {
                MyLogic.Menu = new Menu("FlowersKatarina", "Flowers Katarina", true);
                {
                    MyLogic.Menu.Add(new MenuSeperator("MadebyNightMoon", "Made by NightMoon"));
                    MyLogic.Menu.Add(new MenuSeperator("CreditName", "Credit: badao"));
                    MyLogic.Menu.Add(new MenuSeperator("willbeRemove", "This Assembly will be Remove"));
                    MyLogic.Menu.Add(new MenuSeperator("inthisassembly", "Use SharpAIO (new Version)"));
                    MyLogic.Menu.Add(new MenuSeperator("ASDASDF"));
                }

                MyLogic.Orbwalker = new Aimtec.SDK.Orbwalking.Orbwalker();
                MyLogic.Orbwalker.Attach(MyLogic.Menu);

                MyLogic.ComboMenu = new Menu("FlowersKatarina.ComboMenu", ":: Combo Settings");
                {
                    MyLogic.ComboMenu.Add(new MenuSeperator("FlowersKatarina.ComboMenu.QSettings", "-- Q Settings"));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.Q", "Use Q"));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.QOnMinion", "Use Q| On Minion to Gapcloser", false));

                    MyLogic.ComboMenu.Add(new MenuSeperator("FlowersKatarina.ComboMenu.WSettings", "-- W Settings"));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.W", "Use W"));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.WSmart", "Use W| Smart Gapcloser"));

                    MyLogic.ComboMenu.Add(new MenuSeperator("FlowersKatarina.ComboMenu.ESettings", "-- E Settings"));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.E", "Use E"));
                    MyLogic.ComboMenu.Add(new MenuKeyBind("FlowersKatarina.ComboMenu.EKillAble", "Use E| Only KillAble",
                                                          Aimtec.SDK.Util.KeyCode.G, KeybindType.Toggle));

                    MyLogic.ComboMenu.Add(new MenuSeperator("FlowersKatarina.ComboMenu.RSettings", "-- R Settings"));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.R", "Use R"));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.RAlways", "Use R| Always Cast", false));
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.RKillAble", "Use R| KillAble"));
                    MyLogic.ComboMenu.Add(new MenuSliderBool("FlowersKatarina.ComboMenu.RCountHit", "Use R| Min Hit Count >= x", true, 3, 1, 5));

                    MyLogic.ComboMenu.Add(new MenuSeperator("FlowersKatarina.ComboMenu.ModeSettings", "-- Other Settings"));
                    MyLogic.ComboMenu.Add(new MenuList("FlowersKatarina.ComboMenu.Mode", "Combo Mode: ", new[] { "QE", "EQ" }, 0));
                    MyLogic.ComboMenu.Add(new MenuKeyBind("FlowersKatarina.ComboMenu.SwitchMode",
                                                          "Switch Combo Mode Key", Aimtec.SDK.Util.KeyCode.H, KeybindType.Press))
                    .OnValueChanged +=
                        delegate(MenuComponent iMenuComponent, ValueChangedArgs Args)
                    {
                        if (Args.GetNewValue <MenuKeyBind>().Enabled)
                        {
                            switch (MyLogic.ComboMenu["FlowersKatarina.ComboMenu.Mode"].As <MenuList>().Value)
                            {
                            case 0:
                                MyLogic.ComboMenu["FlowersKatarina.ComboMenu.Mode"].As <MenuList>().Value = 1;
                                break;

                            case 1:
                                MyLogic.ComboMenu["FlowersKatarina.ComboMenu.Mode"].As <MenuList>().Value = 0;
                                break;
                            }
                        }
                    };
                    MyLogic.ComboMenu.Add(new MenuBool("FlowersKatarina.ComboMenu.Ignite", "Use Ignite"));
                }
                MyLogic.Menu.Add(MyLogic.ComboMenu);

                MyLogic.HarassMenu = new Menu("FlowersKatarina.HarassMenu", ":: Harass Settings");
                {
                    MyLogic.HarassMenu.Add(new MenuSeperator("FlowersKatarina.HarassMenu.QSettings", "-- Q Settings"));
                    MyLogic.HarassMenu.Add(new MenuBool("FlowersKatarina.HarassMenu.Q", "Use Q"));
                    MyLogic.HarassMenu.Add(new MenuBool("FlowersKatarina.HarassMenu.QOnMinion", "Use Q| On Minion to Gapcloser", false));

                    MyLogic.HarassMenu.Add(new MenuSeperator("FlowersKatarina.HarassMenu.WSettings", "-- W Settings"));
                    MyLogic.HarassMenu.Add(new MenuBool("FlowersKatarina.HarassMenu.W", "Use W", false));

                    MyLogic.HarassMenu.Add(new MenuSeperator("FlowersKatarina.HarassMenu.ESettings", "-- E Settings"));
                    MyLogic.HarassMenu.Add(new MenuBool("FlowersKatarina.HarassMenu.E", "Use E", false));

                    MyLogic.HarassMenu.Add(new MenuSeperator("FlowersKatarina.HarassMenu.ModeSettings", "-- Mode Settings"));
                    MyLogic.HarassMenu.Add(new MenuList("FlowersKatarina.HarassMenu.Mode", "Harass Mode: ", new[] { "QE", "EQ" }, 0));
                }
                MyLogic.Menu.Add(MyLogic.HarassMenu);

                MyLogic.ClearMenu = new Menu("FlowersKatarina.ClearMenu", ":: Clear Settings");
                {
                    MyLogic.ClearMenu.Add(new MenuSeperator("FlowersKatarina.ClearMenu.LaneClearSettings", "-- LaneClear Settings"));
                    MyLogic.ClearMenu.Add(new MenuBool("FlowersKatarina.ClearMenu.LaneClearQ", "Use Q"));
                    MyLogic.ClearMenu.Add(new MenuBool("FlowersKatarina.ClearMenu.LaneClearQOnlyLH", "Use Q| Only LastHit"));
                    MyLogic.ClearMenu.Add(new MenuBool("FlowersKatarina.ClearMenu.LaneClearW", "Use W"));

                    MyLogic.ClearMenu.Add(new MenuSeperator("FlowersKatarina.ClearMenu.JungleClearSettings", "-- JungleClear Settings"));
                    MyLogic.ClearMenu.Add(new MenuBool("FlowersKatarina.ClearMenu.JungleClearQ", "Use Q"));
                    MyLogic.ClearMenu.Add(new MenuBool("FlowersKatarina.ClearMenu.JungleClearW", "Use W"));
                    MyLogic.ClearMenu.Add(new MenuBool("FlowersKatarina.ClearMenu.JungleClearE", "Use E"));
                }
                MyLogic.Menu.Add(MyLogic.ClearMenu);

                MyLogic.LastHitMenu = new Menu("FlowersKatarina.LastHitMenu", ":: LastHit Settings");
                {
                    MyLogic.LastHitMenu.Add(new MenuSeperator("FlowersKatarina.LastHitMenu.QSettings", "-- Q Settings"));
                    MyLogic.LastHitMenu.Add(new MenuBool("FlowersKatarina.LastHitMenu.Q", "Use Q"));
                }
                MyLogic.Menu.Add(MyLogic.LastHitMenu);

                MyLogic.FleeMenu = new Menu("FlowersKatarina.FleeMenu", ":: Flee Settings");
                {
                    MyLogic.FleeMenu.Add(new MenuSeperator("FlowersKatarina.FleeMenu.KeySettings", "-- Key Settings"));
                    MyLogic.FleeMenu.Add(new MenuKeyBind("FlowersKatarina.FleeMenu.Key", "Flee Active Key",
                                                         Aimtec.SDK.Util.KeyCode.Z, KeybindType.Press));

                    MyLogic.FleeMenu.Add(new MenuSeperator("FlowersKatarina.FleeMenu.WSettings", "-- W Settings"));
                    MyLogic.FleeMenu.Add(new MenuBool("FlowersKatarina.FleeMenu.W", "Use W"));

                    MyLogic.FleeMenu.Add(new MenuSeperator("FlowersKatarina.FleeMenu.ESettings", "-- E Settings"));
                    MyLogic.FleeMenu.Add(new MenuBool("FlowersKatarina.FleeMenu.E", "Use E"));
                }
                MyLogic.Menu.Add(MyLogic.FleeMenu);

                MyLogic.KillStealMenu = new Menu("FlowersKatarina.KillStealMenu", ":: KillSteal Settings");
                {
                    MyLogic.KillStealMenu.Add(new MenuSeperator("FlowersKatarina.KillStealMenu.QSettings", "-- Q Settings"));
                    MyLogic.KillStealMenu.Add(new MenuBool("FlowersKatarina.KillStealMenu.Q", "Use Q"));

                    MyLogic.KillStealMenu.Add(new MenuSeperator("FlowersKatarina.KillStealMenu.ESettings", "-- E Settings"));
                    MyLogic.KillStealMenu.Add(new MenuBool("FlowersKatarina.KillStealMenu.E", "Use E"));

                    MyLogic.KillStealMenu.Add(new MenuSeperator("FlowersKatarina.KillStealMenu.RSettings", "-- R Settings"));
                    MyLogic.KillStealMenu.Add(new MenuBool("FlowersKatarina.KillStealMenu.R", "Use R"));

                    MyLogic.KillStealMenu.Add(new MenuSeperator("FlowersKatarina.KillStealMenu.OtherSettings", "-- Other Settings"));
                    MyLogic.KillStealMenu.Add(new MenuBool("FlowersKatarina.KillStealMenu.CancelR", "Auto Cancel R to KS"));
                }
                MyLogic.Menu.Add(MyLogic.KillStealMenu);

                MyLogic.MiscMenu = new Menu("FlowersKatarina.MiscMenu", ":: Misc Settings");
                {
                    MyManaManager.AddFarmToMenu(MyLogic.MiscMenu);
                    MyLogic.MiscMenu.Add(new MenuSeperator("FlowersKatarina.MiscMenu.ESettings", "-- E Settings"));
                    MyLogic.MiscMenu.Add(new MenuSliderBool("FlowersKatarina.MiscMenu.EHumanizer",
                                                            "Enabled Humanizer| Delay <= x(ms)", false, 0, 0, 1500));
                    MyLogic.MiscMenu.Add(new MenuList("FlowersKatarina.MiscMenu.ETurret", "Disable E to Enemy Turret",
                                                      new[] { "Always", "Smart", "Off" }, 1));
                    MyLogic.MiscMenu.Add(new MenuSlider("FlowersKatarina.MiscMenu.ETurretHP",
                                                        "Smart Mode: When Player HealthPercent <= x%", 50, 1, 99));

                    MyLogic.MiscMenu.Add(new MenuSeperator("FlowersKatarina.MiscMenu.RSettings", "-- R Settings"));
                    MyLogic.MiscMenu.Add(new MenuBool("FlowersKatarina.MiscMenu.AutoCancelR", "Auto Cancel Ult"));

                    MyLogic.MiscMenu.Add(new MenuSeperator("FlowersKatarina.MiscMenu.OtherSettings", "-- Other Settings"));
                    MyLogic.MiscMenu.Add(new MenuKeyBind("FlowersKatarina.MiscMenu.OneKeyEW", "Semi EW Key",
                                                         Aimtec.SDK.Util.KeyCode.A, KeybindType.Press));
                }
                MyLogic.Menu.Add(MyLogic.MiscMenu);

                MyLogic.DrawMenu = new Menu("FlowersKatarina.DrawMenu", ":: Draw Settings");
                {
                    MyManaManager.AddDrawToMenu(MyLogic.DrawMenu);
                    MyLogic.DrawMenu.Add(new MenuSeperator("FlowersKatarina.DrawMenu.RangeSettings", "-- Spell Range"));
                    MyLogic.DrawMenu.Add(new MenuBool("FlowersKatarina.DrawMenu.Q", "Draw Q Range", false));
                    MyLogic.DrawMenu.Add(new MenuBool("FlowersKatarina.DrawMenu.E", "Draw E Range", false));
                    MyLogic.DrawMenu.Add(new MenuBool("FlowersKatarina.DrawMenu.R", "Draw R Range", false));
                    MyLogic.DrawMenu.Add(new MenuBool("FlowersKatarina.DrawMenu.Dagger", "Draw Dagger Range", false));

                    MyLogic.DrawMenu.Add(new MenuSeperator("FlowersKatarina.DrawMenu.StatusSettings", "-- Logic Status"));
                    MyLogic.DrawMenu.Add(new MenuBool("FlowersKatarina.DrawMenu.ComboE", "Draw Combo E Status"));
                    MyLogic.DrawMenu.Add(new MenuBool("FlowersKatarina.DrawMenu.ComboMode", "Draw Combo Mode"));
                }
                MyLogic.Menu.Add(MyLogic.DrawMenu);

                MyLogic.Menu.Attach();
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyMenuManager.Initializer." + ex);
            }
        }
        public static ValueTask <FilterNode <ClrValue>?> TransformAsync(FilterNode <ClrValue> nodeIn, DomainId appId, ITagService tagService)
        {
            var args = new Args(appId, tagService);

            return(nodeIn.Accept(Instance, args));
        }
        public override async ValueTask <FilterNode <ClrValue>?> Visit(CompareFilter <ClrValue> nodeIn, Args args)
        {
            if (string.Equals(nodeIn.Path[0], nameof(IAssetEntity.Tags), StringComparison.OrdinalIgnoreCase) && nodeIn.Value.Value is string stringValue)
            {
                var tagNames = await args.TagService.GetTagIdsAsync(args.AppId, TagGroups.Assets, HashSet.Of(stringValue));

                if (tagNames.TryGetValue(stringValue, out var normalized))
                {
                    return(new CompareFilter <ClrValue>(nodeIn.Path, nodeIn.Operator, normalized));
                }
            }

            return(nodeIn);
        }
        public static async Task <int> Main(string[] args)
        {
            CancellationTokenSource tokenSource = new CancellationTokenSource();
            var parsedArgs = await Args.ParseAsync <CredentialProviderArgs>(args);

            var multiLogger = new MultiLogger();
            var fileLogger  = GetFileLogger();

            if (fileLogger != null)
            {
                multiLogger.Add(fileLogger);
            }

            // Cancellation listener
            Console.CancelKeyPress += (object sender, ConsoleCancelEventArgs eventArgs) =>
            {
                // ConsoleCancelEventArgs.Cancel defaults to false which terminates the current process.
                multiLogger.Verbose(Resources.CancelMessage);
                tokenSource.Cancel();
            };

            var authUtil                    = new AuthUtil(multiLogger);
            var adalTokenCache              = AdalTokenCacheUtils.GetAdalTokenCache(multiLogger);
            var adalTokenProviderFactory    = new VstsAdalTokenProviderFactory(adalTokenCache);
            var bearerTokenProvidersFactory = new BearerTokenProvidersFactory(multiLogger, adalTokenProviderFactory);
            var vstsSessionTokenProvider    = new VstsSessionTokenFromBearerTokenProvider(authUtil, multiLogger);

            List <ICredentialProvider> credentialProviders = new List <ICredentialProvider>
            {
                new VstsBuildTaskServiceEndpointCredentialProvider(multiLogger),
                new VstsBuildTaskCredentialProvider(multiLogger),
                new VstsCredentialProvider(multiLogger, authUtil, bearerTokenProvidersFactory, vstsSessionTokenProvider),
            };

            try
            {
                IRequestHandlers requestHandlers = new RequestHandlerCollection
                {
                    { MessageMethod.GetAuthenticationCredentials, new GetAuthenticationCredentialsRequestHandler(multiLogger, credentialProviders) },
                    { MessageMethod.GetOperationClaims, new GetOperationClaimsRequestHandler(multiLogger, credentialProviders) },
                    { MessageMethod.Initialize, new InitializeRequestHandler(multiLogger) },
                    { MessageMethod.SetLogLevel, new SetLogLevelRequestHandler(multiLogger) },
                    { MessageMethod.SetCredentials, new SetCredentialsRequestHandler(multiLogger) },
                };

                // Help
                if (parsedArgs.Help)
                {
                    Console.WriteLine(string.Format(Resources.CommandLineArgs, Program.Version, Environment.CommandLine));
                    Console.WriteLine(ArgUsage.GenerateUsageFromTemplate <CredentialProviderArgs>());
                    Console.WriteLine(
                        string.Format(
                            Resources.EnvironmentVariableHelp,
                            EnvUtil.LogPathEnvVar,
                            EnvUtil.SessionTokenCacheEnvVar,
                            EnvUtil.AuthorityEnvVar,
                            EnvUtil.AdalFileCacheEnvVar,
                            EnvUtil.PpeHostsEnvVar,
                            EnvUtil.SupportedHostsEnvVar,
                            EnvUtil.SessionTimeEnvVar,
                            EnvUtil.TokenTypeEnvVar,
                            EnvUtil.BuildTaskUriPrefixes,
                            EnvUtil.BuildTaskAccessToken,
                            EnvUtil.BuildTaskExternalEndpoints,
                            EnvUtil.AdalTokenCacheLocation,
                            EnvUtil.SessionTokenCacheLocation,
                            EnvUtil.WindowsIntegratedAuthenticationEnvVar,
                            EnvUtil.DeviceFlowTimeoutEnvVar,
                            EnvUtil.ForceCanShowDialogEnvVar
                            ));
                    return(0);
                }

                // Plug-in mode
                if (parsedArgs.Plugin)
                {
                    try
                    {
                        using (IPlugin plugin = await PluginFactory.CreateFromCurrentProcessAsync(requestHandlers, ConnectionOptions.CreateDefault(), tokenSource.Token).ConfigureAwait(continueOnCapturedContext: false))
                        {
                            multiLogger.Add(new PluginConnectionLogger(plugin.Connection));
                            multiLogger.Verbose(Resources.RunningInPlugin);
                            multiLogger.Verbose(string.Format(Resources.CommandLineArgs, Program.Version, Environment.CommandLine));

                            await WaitForPluginExitAsync(plugin, multiLogger, TimeSpan.FromMinutes(2)).ConfigureAwait(continueOnCapturedContext: false);
                        }
                    }
                    catch (OperationCanceledException ex)
                    {
                        // When restoring from multiple sources, one of the sources will throw an unhandled TaskCanceledException
                        // if it has been restored successfully from a different source.

                        // This is probably more confusing than interesting to users, but may be helpful in debugging,
                        // so log the exception but not to the console.
                        multiLogger.Log(LogLevel.Verbose, allowOnConsole: false, ex.ToString());
                    }

                    return(0);
                }

                // Stand-alone mode
                if (requestHandlers.TryGet(MessageMethod.GetAuthenticationCredentials, out IRequestHandler requestHandler) && requestHandler is GetAuthenticationCredentialsRequestHandler getAuthenticationCredentialsRequestHandler)
                {
                    // When emitting machine-readable output to standard out, logging (including Device Code prompts) must be emitted to standard error
                    if (parsedArgs.OutputFormat == OutputFormat.Json)
                    {
                        multiLogger.Add(new StandardErrorLogger());
                    }
                    else
                    {
                        multiLogger.Add(new StandardOutputLogger());
                    }

                    multiLogger.SetLogLevel(parsedArgs.Verbosity);
                    multiLogger.Verbose(Resources.RunningInStandAlone);
                    multiLogger.Verbose(string.Format(Resources.CommandLineArgs, Program.Version, Environment.CommandLine));

                    if (parsedArgs.Uri == null)
                    {
                        Console.WriteLine(ArgUsage.GenerateUsageFromTemplate <CredentialProviderArgs>());
                        return(1);
                    }

                    GetAuthenticationCredentialsRequest  request  = new GetAuthenticationCredentialsRequest(parsedArgs.Uri, isRetry: parsedArgs.IsRetry, isNonInteractive: parsedArgs.NonInteractive, parsedArgs.CanShowDialog);
                    GetAuthenticationCredentialsResponse response = await getAuthenticationCredentialsRequestHandler.HandleRequestAsync(request).ConfigureAwait(continueOnCapturedContext: false);

                    // Fail if credentials are not found
                    if (response?.ResponseCode != MessageResponseCode.Success)
                    {
                        return(2);
                    }

                    string resultUsername = response?.Username;
                    string resultPassword = parsedArgs.RedactPassword ? Resources.Redacted : response?.Password;
                    if (parsedArgs.OutputFormat == OutputFormat.Json)
                    {
                        // Manually write the JSON output, since we don't use ConsoleLogger in JSON mode (see above)
                        Console.WriteLine(JsonConvert.SerializeObject(new CredentialResult(resultUsername, resultPassword)));
                    }
                    else
                    {
                        multiLogger.Info($"{Resources.Username}: {resultUsername}");
                        multiLogger.Info($"{Resources.Password}: {resultPassword}");
                    }
                    return(0);
                }

                return(-1);
            }
            finally
            {
                foreach (ICredentialProvider credentialProvider in credentialProviders)
                {
                    credentialProvider.Dispose();
                }
            }
        }
Beispiel #39
0
 protected CoreActorBase(ActorService actorService, ActorId actorId)
     : base(actorService, actorId)
 {
     Args.NotNull(actorService, nameof(actorService));
     Args.NotNull(actorId, nameof(actorId));
 }
Beispiel #40
0
 public Menu <TAction, TArgs> AddArgs(List <TArgs> args)
 {
     Args.AddRange(args);
     return(this);
 }
Beispiel #41
0
 public IJsonValue Visit(JsonFieldProperties properties, Args args)
 {
     return(JsonValue.Null);
 }
Beispiel #42
0
        /// <summary>
        /// The core execution of the tool.
        /// </summary>
        /// <remarks>
        /// If you discover boilerplate in multiple implementations, add it to MainImpl, or add another inheritance hierarchy.
        /// </remarks>
        public int Run()
        {
            // We may have been started to be an app server. See StartAppServerProcess. If so, run as an app server (and expect no args).
            string startupParamsSerialized = Environment.GetEnvironmentVariable(BuildXlAppServerConfigVariable);

            if (startupParamsSerialized != null)
            {
                if (RawArgs.Length > 0)
                {
                    // TODO: Message
                    return(ExitCode.FromExitKind(ExitKind.InvalidCommandLine));
                }

                AppServer.StartupParameters startupParameters = AppServer.StartupParameters.TryParse(startupParamsSerialized);
                if (startupParameters == null)
                {
                    return(ExitCode.FromExitKind(ExitKind.InvalidCommandLine));
                }

                return(ExitCode.FromExitKind(RunAppServer(startupParameters)));
            }

            LightConfig lightConfig;

            if (!LightConfig.TryParse(RawArgs, out lightConfig) && lightConfig.Help == HelpLevel.None)
            {
                // If light config parsing failed, go through the full argument parser to collect & print the errors
                // it would catch.
                ICommandLineConfiguration config;
                Analysis.IgnoreResult(Args.TryParseArguments(RawArgs, new PathTable(), null, out config));
                HelpText.DisplayHelp(BuildXL.ToolSupport.HelpLevel.Verbose);
                return(ExitCode.FromExitKind(ExitKind.InvalidCommandLine));
            }

            // Not an app server; will either run fully within this process ('single instance') or start / connect to an app server.
            if (!lightConfig.NoLogo)
            {
                HelpText.DisplayLogo();
            }

            if (lightConfig.Help != HelpLevel.None)
            {
                if (lightConfig.Help == HelpLevel.DxCode)
                {
                    System.Diagnostics.Process.Start(Strings.DX_Help_Link);
                }
                else
                {
                    // Need to cast here to convert from the configuration enum to the ToolSupoort enum. Their values
                    // are manually kept in sync to avoid the additional dependency.
                    HelpText.DisplayHelp((BuildXL.ToolSupport.HelpLevel)lightConfig.Help);
                }

                return(ExitCode.FromExitKind(ExitKind.BuildNotRequested));
            }

            // Optionally perform some special tasks related to server mode
            switch (lightConfig.Server)
            {
            case ServerMode.Kill:
                ServerDeployment.KillServer(ServerDeployment.ComputeDeploymentDir(lightConfig.ServerDeploymentDirectory));
                Console.WriteLine(Strings.App_ServerKilled);
                return(ExitCode.FromExitKind(ExitKind.BuildNotRequested));

            case ServerMode.Reset:
                ServerDeployment.PoisonServerDeployment(lightConfig.ServerDeploymentDirectory);
                break;
            }

            ExitKind exitKind = lightConfig.Server != ServerMode.Disabled
                ? ConnectToAppServerAndRun(lightConfig, RawArgs)
                : RunSingleInstance(RawArgs);

            return(ExitCode.FromExitKind(exitKind));
        }
Beispiel #43
0
        /// <summary>
        /// The given IHandle&lt;<typeparamref name="TEventType"/>&gt; subscribes to the specified event type. Manual unsubscribing is not necessary if <paramref name="handleOnce"/> is true.
        /// </summary>
        /// <typeparam name="TEventType">The type of event to subscribe to</typeparam>
        /// <param name="handler">The subscriber</param>
        /// <param name="handleOnce">Determines whether the handler should be called only once during publishing. <b>True</b> means the handler should be called only once</param>
        public void Sub <TEventType>(IHandle <TEventType> handler, bool handleOnce)
        {
            Args.IsNotNull(() => handler);

            this.InternalAggregator.InternalSub(handler, handleOnce);
        }
Beispiel #44
0
 public IJsonValue Visit(IField <ReferencesFieldProperties> field, Args args)
 {
     return(CleanIds(args));
 }
 public void WaitTimer(Args args)
 {
     StartCoroutine(WaitDeathTimerCoroutine());
 }
Beispiel #46
0
        public static IJsonValue Cleanup(IField field, IJsonValue?value, HashSet <DomainId> validIds)
        {
            var args = new Args(value ?? JsonValue.Null, validIds);

            return(field.Accept(Instance, args));
        }
Beispiel #47
0
 private static bool IsValidReference(IJsonValue item, Args args)
 {
     return(item is JsonString s && args.ValidIds.Contains(DomainId.Create(s.Value)));
 }
 protected string GetCurrentArg() => Args.ElementAtOrDefault(CurrentArg);
        // see interface ConnectionReuseStrategy
        public virtual bool KeepAlive(HttpResponse response, HttpContext context)
        {
            Args.NotNull(response, "HTTP response");
            Args.NotNull(context, "HTTP context");
            // Check for a self-terminating entity. If the end of the entity will
            // be indicated by closing the connection, there is no keep-alive.
            ProtocolVersion ver = response.GetStatusLine().GetProtocolVersion();
            Header          teh = response.GetFirstHeader(HTTP.TransferEncoding);

            if (teh != null)
            {
                if (!Sharpen.Runtime.EqualsIgnoreCase(HTTP.ChunkCoding, teh.GetValue()))
                {
                    return(false);
                }
            }
            else
            {
                if (CanResponseHaveBody(response))
                {
                    Header[] clhs = response.GetHeaders(HTTP.ContentLen);
                    // Do not reuse if not properly content-length delimited
                    if (clhs.Length == 1)
                    {
                        Header clh = clhs[0];
                        try
                        {
                            int contentLen = System.Convert.ToInt32(clh.GetValue());
                            if (contentLen < 0)
                            {
                                return(false);
                            }
                        }
                        catch (FormatException)
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
            // Check for the "Connection" header. If that is absent, check for
            // the "Proxy-Connection" header. The latter is an unspecified and
            // broken but unfortunately common extension of HTTP.
            HeaderIterator hit = response.HeaderIterator(HTTP.ConnDirective);

            if (!hit.HasNext())
            {
                hit = response.HeaderIterator("Proxy-Connection");
            }
            // Experimental usage of the "Connection" header in HTTP/1.0 is
            // documented in RFC 2068, section 19.7.1. A token "keep-alive" is
            // used to indicate that the connection should be persistent.
            // Note that the final specification of HTTP/1.1 in RFC 2616 does not
            // include this information. Neither is the "Connection" header
            // mentioned in RFC 1945, which informally describes HTTP/1.0.
            //
            // RFC 2616 specifies "close" as the only connection token with a
            // specific meaning: it disables persistent connections.
            //
            // The "Proxy-Connection" header is not formally specified anywhere,
            // but is commonly used to carry one token, "close" or "keep-alive".
            // The "Connection" header, on the other hand, is defined as a
            // sequence of tokens, where each token is a header name, and the
            // token "close" has the above-mentioned additional meaning.
            //
            // To get through this mess, we treat the "Proxy-Connection" header
            // in exactly the same way as the "Connection" header, but only if
            // the latter is missing. We scan the sequence of tokens for both
            // "close" and "keep-alive". As "close" is specified by RFC 2068,
            // it takes precedence and indicates a non-persistent connection.
            // If there is no "close" but a "keep-alive", we take the hint.
            if (hit.HasNext())
            {
                try
                {
                    TokenIterator ti        = CreateTokenIterator(hit);
                    bool          keepalive = false;
                    while (ti.HasNext())
                    {
                        string token = ti.NextToken();
                        if (Sharpen.Runtime.EqualsIgnoreCase(HTTP.ConnClose, token))
                        {
                            return(false);
                        }
                        else
                        {
                            if (Sharpen.Runtime.EqualsIgnoreCase(HTTP.ConnKeepAlive, token))
                            {
                                // continue the loop, there may be a "close" afterwards
                                keepalive = true;
                            }
                        }
                    }
                    if (keepalive)
                    {
                        return(true);
                    }
                }
                catch (ParseException)
                {
                    // neither "close" nor "keep-alive", use default policy
                    // invalid connection header means no persistent connection
                    // we don't have logging in HttpCore, so the exception is lost
                    return(false);
                }
            }
            // default since HTTP/1.1 is persistent, before it was non-persistent
            return(!ver.LessEquals(HttpVersion.Http10));
        }
Beispiel #50
0
 static void Main(string[] args) => Args.InvokeMain <Program>(args);
Beispiel #51
0
        private static EvaluationResult HasVariable(Context context, ModuleLiteral env, EvaluationStackFrame args)
        {
            var name = Args.AsString(args, 0);

            return(EvaluationResult.Create(GetRawValue(context, name) != null));
        }
Beispiel #52
0
 private static void EnsureCredentials(Vault credentialContainer)
 {
     Args.ThrowIfNullOrEmpty(credentialContainer["SmtpHost"]);
     Args.ThrowIfNullOrEmpty(credentialContainer["UserName"]);
     Args.ThrowIfNullOrEmpty(credentialContainer["Password"]);
 }
Beispiel #53
0
        public string Run(string filePath)
        {
            if (!string.IsNullOrEmpty(filePath) && CheckExtensions(filePath) && !string.IsNullOrEmpty(Path) && File.Exists(Path))
            {
                filePath = filePath.Trim('"');

                try
                {
                    string newFilePath = "";

                    using (Process process = new Process())
                    {
                        ProcessStartInfo psi = new ProcessStartInfo(Path);

                        if (string.IsNullOrEmpty(Args))
                        {
                            psi.Arguments = '"' + filePath + '"';
                        }
                        else
                        {
                            string args = Args.Replace("%filepath%", '"' + filePath + '"').Replace("%input", '"' + filePath + '"');

                            if (!string.IsNullOrEmpty(OutputExtension))
                            {
                                newFilePath = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(filePath), System.IO.Path.GetFileNameWithoutExtension(filePath));

                                if (!OutputExtension.Contains("."))
                                {
                                    OutputExtension = "." + OutputExtension;
                                }

                                newFilePath += OutputExtension;
                                args         = args.Replace("%output", '"' + newFilePath + '"');
                            }

                            psi.Arguments = args;
                        }

                        process.StartInfo = psi;

                        DebugHelper.WriteLine(string.Format("Running {0} with arguments: {1}", Path, psi.Arguments));

                        process.Start();
                        process.WaitForExit();
                    }

                    if (!string.IsNullOrEmpty(newFilePath) && File.Exists(newFilePath))
                    {
                        return(newFilePath);
                    }

                    return(filePath);
                }
                catch (Exception e)
                {
                    DebugHelper.WriteException(e);
                }
            }

            return(filePath);
        }
 public abstract ref readonly DataModelValue  GetValueByIndex(ref Args args);
 protected UserLoader(ActorService actorService, ActorId actorId, IServiceFabricToolbox toolbox)
     : base(actorService, actorId)
 {
     Args.NotNull(toolbox, nameof(toolbox));
     _toolbox = toolbox;
 }
 public abstract DataModelAccess GetAccessByIndex(ref Args args);
Beispiel #57
0
        public IJsonValue Visit(TagsFieldProperties properties, Args args)
        {
            var value = GetDefaultValue(properties.DefaultValue, properties.DefaultValues, args.Partition);

            return(Array(value));
        }
Beispiel #58
0
 public IJsonValue Visit(IArrayField field, Args args)
 {
     return(args.Value);
 }
Beispiel #59
0
        public IJsonValue Visit(StringFieldProperties properties, Args args)
        {
            var value = GetDefaultValue(properties.DefaultValue, properties.DefaultValues, args.Partition);

            return(JsonValue.Create(value));
        }
Beispiel #60
0
        public override bool Equals(object obj)
        {
            if (!(obj is KDLNode other))
            {
                return(false);
            }

            return(Identifier == other.Identifier && Props.SequenceEqual(other.Props) && Args.SequenceEqual(other.Args) && Equals(Child, other.Child));
        }