public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var first = user.ReadInput("Enter First as int").AsInt; var tagIds = new List <string>(user.ReadInputWhileBreakAsString("Enter Tag Id")); string cursor = null; while (true) { var tags = handler.API.New.Tags.GetAllStreamTags(cursor, first, tagIds); foreach (var tag in tags.Tags) { user.SendMessage(); user.SendMessage($"Id={tag.Id}"); user.SendMessage($" IsAuto={tag.IsAuto}"); user.SendMessage($" Name={(tag.LocalizationNames.TryGetValue("ko-kr", out var name) ? name : null)}"); user.SendMessage($" Description={(tag.LocalizationDescriptions.TryGetValue("ko-kr", out var description) ? description : null)}"); } cursor = tags.Pagination.Cursor; if (string.IsNullOrWhiteSpace(cursor) == true) { break; } Thread.Sleep(1000); } }
// Update is called once per frame void Update() { float scroll = Input.GetAxis("Mouse ScrollWheel"); if (scroll != 0) { if (scroll > 0) { if (TestMain.GetCamera().orthographicSize > 25) { TestMain.GetCamera().orthographicSize -= 5; } } else { if (TestMain.GetCamera().orthographicSize < 200) { TestMain.GetCamera().orthographicSize += 5; } } } bool[] currMouseDown = new bool[] { Input.GetMouseButtonDown(0), Input.GetMouseButtonDown(1) }; if (currMouseDown[0] || currMouseDown[1]) { m_mode[(int)currMode].OnClick(currMouseDown); } else { m_mode[(int)currMode].OnHover(); } if (!mapLoaded) { mapLoaded = TestMain.GetMap().ExtendBound(ref bottomLeft, ref topRight); } }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var options = new TwitchGetTopClipsOptions(); options.Channel = user.ReadInput("Enter Channel").AsString; options.Game = user.ReadInput("Enter Game").AsString; options.Languages.AddRange(user.ReadInputWhileBreakAsString("Enter Language")); options.Limit = user.ReadInput("Enter Limit as long").AsLong; options.Period = user.QueryInput("Enter Channel", TopClipsPeriod.Register, null, true).Value; options.Trending = user.ReadInput("Enter Trending as bool").AsBool; while (true) { var clips = handler.API.V5.Clips.GetTopClips(options); options.Cursor = clips.Cursor; user.SendMessageAsReflection("TopClips", clips); if (string.IsNullOrWhiteSpace(options.Cursor) == true) { break; } else if (user.ReadBreak() == true) { break; } } }
/// <summary> /// Инициализирует новый экземпляр класса <see cref="N15InsideForm"/> /// </summary> public N15InsideForm() { this.InitializeComponent(); N15InsideParameters.ParameterChanged += RefreshFormElements; RefreshFormElements(); if (ParametersConfig.IsTesting) { N15InsideParameters.TestModuleRef = this; N15InsideParameters.Action += TestMain.Action; } LearnMain.form = this; switch (LearnMain.getIntent()) { case ModulesEnum.H15Inside_open_from_H15: if (LearnMain.globalIntent == GlobalIntentEnum.OneChannel) { LearnMain.setIntent(ModulesEnum.H15Inside_power); } break; } switch (TestMain.getIntent()) { case ModulesEnum.H15Inside_open_from_H15: //if (TestMain.globalIntent == GlobalIntentEnum.OneChannel) //{ TestMain.setIntent(ModulesEnum.H15Inside_power); //} break; } }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var channelId = user.ReadInput("Enter Channel Id").AsString; var limit = user.ReadInput("Enter Limit as int").AsInt; var offset = user.ReadInput("Enter Offset as int").AsInt; var direction = user.QueryInput("Enter Direction", SortDirection.Tags, null, true).Value; string cursor = null; while (true) { var channelFollowers = handler.API.V5.Channels.GetChannelFollowers(channelId, limit, offset, cursor, direction); user.SendMessageAsReflection("ChannelFollowers", channelFollowers); offset = null; cursor = channelFollowers.Cursor; if (string.IsNullOrWhiteSpace(cursor) == true) { break; } Thread.Sleep(1000); } }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var requests = new List <UserRequest>(); while (true) { var typeInput = user.QueryInput("Enter UserType", UserRequestType.Tags, null, true); if (typeInput.Breaked == true) { break; } var request = new UserRequest(); request.Type = typeInput.Value; request.Value = user.ReadInput($"Enter User{request.Type}").AsString; requests.Add(request); } var api = handler.API; var tusers = api.New.Users.GetUsers(requests); user.SendMessageAsReflection("Users", tusers); }
/// <summary> /// Инициализирует новый экземпляр класса <see cref="PowerCabelForm"/> /// </summary> public PowerCabelForm() { InitializeComponent(); PowerCabelParameters.ParameterChanged += RefreshFormElements; PowerCabelParameters.СтанцияСгорела += ВыводСообщенияСтанцияСгорела; if (ParametersConfig.IsTesting) { PowerCabelParameters.TestModuleRef = this; PowerCabelParameters.Action += TestMain.Action; } this.RefreshFormElements(); if (LearnMain.getIntent() == ModulesEnum.openPowerCabeltoPower) { LearnMain.setIntent(ModulesEnum.PowerCabelConnect); LearnMain.form = this; LearnMain.Action(); } if (TestMain.getIntent() == ModulesEnum.openPowerCabeltoPower) { TestMain.setIntent(ModulesEnum.PowerCabelConnect); IsExactModule = true; } }
/// <summary> /// Закрытие формы внутренней части блока /// </summary> /// <param name="sender">Объет вызвавший событие</param> /// <param name="e">Событие закрытия формы</param> private void N15InsideForm_FormClosed(object sender, FormClosedEventArgs e) { N15InsideParameters.ParameterChanged -= RefreshFormElements; if (ParametersConfig.IsTesting) { N15InsideParameters.Action -= TestMain.Action; } switch (TestMain.getIntent()) { case ModulesEnum.H15Inside_power: if (N15InsideParameters.ПереключательПУЛ480ПРМ_1 == 3 && N15InsideParameters.ПереключательПУЛ480ПРМ_2 == 3 && N15InsideParameters.ПереключательПУЛ48ПРД_1 == 3 && N15InsideParameters.ПереключательПУЛ48ПРД_2 == 3 && N15InsideParameters.ТумблерПУЛ480ПРМ_1 == Модуляция.ОФТ && N15InsideParameters.ТумблерПУЛ480ПРМ_2 == Модуляция.ОФТ && N15InsideParameters.ТумблерПУЛ48ПРД_1 == Модуляция.ОФТ && N15InsideParameters.ТумблерПУЛ48ПРД_2 == Модуляция.ОФТ) { //TestMain.setIntent(ModulesEnum.N15); //TODO: доделать переход на н15 } break; } Owner.Show(); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var options = new TwitchGetClipsOptions(); options.BroadcasterId = user.ReadInput("Enter BroadcasterId").AsString; options.GameId = user.ReadInput("Enter GameId").AsString; options.Ids.AddRange(user.ReadInputWhileBreakAsString("Enter Id")); options.First = user.ReadInput("Enter First as int").AsInt; options.StartedAt = TwitchDateTimeUtils.ToDatetime(user.ReadInput("Enter StartedAt as TwtichDateTime").AsString); options.EndedAt = TwitchDateTimeUtils.ToDatetime(user.ReadInput("Enter EndedAt as TwtichDateTime").AsString); string cursor = null; while (true) { options.After = cursor; var clips = handler.API.New.Clips.GetClips(options); user.SendMessageAsReflection("Clips", clips); cursor = clips.Pagination.Cursor; if (string.IsNullOrWhiteSpace(cursor) == true) { break; } Thread.Sleep(1000); } }
protected virtual void Initialise() { Canvas canvas = TestMain.GetCanvas(); GameObject canvasObj = new GameObject(); m_item = new MenuItem[0]; }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var first = user.ReadInput("Enter First as int").AsInt; string after = null; string before = null; while (true) { var topGames = handler.API.New.Games.GetTopGames(after, before, first); user.SendMessageAsReflection("TopGames", topGames); after = null; before = null; var index = user.QueryInput("Select Direction", new string[] { "after", "before" }, null, true).Index; if (index == -1) { break; } else if (index == 0) { after = topGames.Pagination.Cursor; } else { before = topGames.Pagination.Cursor; } } }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var first = user.ReadInput("Enter First as int").AsInt; var fromId = user.ReadInput("Enter From Id, show followings").AsString; var toId = user.ReadInput("Enter To Id, show followers").AsString; var api = handler.API; string cursor = null; while (true) { var userFollows = api.New.Users.GetUserFollows(cursor, first, fromId, toId); user.SendMessageAsReflection("UserFollows", userFollows); cursor = userFollows.Pagination.Cursor; if (string.IsNullOrWhiteSpace(cursor) == true) { break; } //Thread.Sleep(1000); } }
private void VoltageStabilizerForm_FormClosed(object sender, FormClosedEventArgs e) { VoltageStabilizerParameters.ParameterChanged -= RefreshFormElements; VoltageStabilizerParameters.ОператорСтанцииПораженТоком -= ВыводСообщенияОператорСтанцииПоражёнТоком; if (ParametersConfig.IsTesting) { VoltageStabilizerParameters.Action -= TestMain.Action; } if ((LearnMain.getIntent() == ModulesEnum.VoltageStabilizerSetUp) && (VoltageStabilizerParameters.КабельВход > 0)) { LearnMain.setIntent(ModulesEnum.openN502BtoPower); } else { LearnMain.setIntent(ModulesEnum.openVoltageStabilizer); } if ((TestMain.getIntent() == ModulesEnum.VoltageStabilizerSetUp) && (VoltageStabilizerParameters.КабельВход > 0)) { TestMain.setIntent(ModulesEnum.openN502BtoPower); } else { TestMain.setIntent(ModulesEnum.openVoltageStabilizer); } }
public void Class_DBlink() { var dblink = new TestMain(); var dblinkexpected = "ture"; var dblinkfunction = dblink.Dblinkmethod(); Assert.AreEqual(dblinkexpected, dblinkfunction); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var tuser = handler.API.V5.Users.GetUser(); user.SendMessageAsReflection("User", tuser); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var set = handler.API.Other.BadgesTwitchTV.GetGlobalBadges(); user.SendMessageAsReflection("Badges", set); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var followedStreams = handler.API.V5.Streams.GetFollowedStreams(); user.SendMessageAsReflection("FollowedStreams", followedStreams); }
public MainForm() { InitializeComponent(); tm = new TestMain(); tm.MainForm = this; this.toolStripMenuItem1.PerformClick(); }
private void ВыводСообщенияНекорректноеДействие() { MessageBox.Show("Некорректное действие!", "ОШИБКА"); if (ParametersConfig.IsTesting) { TestMain.MakeSoftMistake(); } }
private void ВыводСообщенияСтанцияСгорела() { MessageBox.Show("Станция сгорела!", "ОШИБКА"); if (ParametersConfig.IsTesting) { TestMain.MakeBlunderMistake(); } }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var channelId = user.ReadInput("Enter Channel Id").AsString; var teams = handler.API.V5.Channels.GetChannelTeams(channelId); user.SendMessageAsReflection("Teams", teams); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var teamName = user.ReadInput("Enter TeamName").AsString; var teamAndChannels = handler.API.V5.Teams.GetTeam(teamName); user.SendMessageAsReflection("TeamAndChannels", teamAndChannels); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var channelId = user.ReadInput("Channel Id").AsString; var set = handler.API.Other.BadgesTwitchTV.GetChannelBadges(channelId); user.SendMessageAsReflection("Badges", set); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var channelId = user.ReadInput("Enter ChannelId (Empty is global)").AsString; var actions = handler.API.V5.Bits.GetCheermotes(channelId); user.SendMessageAsReflection("Actions", actions); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var slug = user.ReadInput("Enter Slug").AsString; var clip = handler.API.V5.Clips.GetClip(slug); user.SendMessageAsReflection("Clip", clip); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var broadcasterId = user.ReadInput("Enter Broadcaster Id").AsString; var tagsId = user.ReadInputWhileBreakAsString("Enter Tag Id"); handler.API.New.Tags.ReplaceStreamTags(broadcasterId, tagsId); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var userId = user.ReadInput("Enter UserId").AsString; var set = handler.API.V5.Users.GetUserEmotes(userId); user.SendMessageAsReflection("EmoticonSet", set); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var emoteIds = user.ReadInputWhileBreakAsString("Enter Emote Id"); var emotes = handler.API.Other.TwitchEmotesAPI.GetEmotes(emoteIds); user.SendMessageAsReflection("Emotes", emotes); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var channelName = user.ReadInput("Enter Channel Name").AsString; var set = handler.API.Other.CbenniAPI.GetBadges(channelName); user.SendMessageAsReflection("Badges", set); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var description = user.ReadInput("Enter Descrption").AsString; var tuser = handler.API.New.Users.UpdateUser(description); user.SendMessageAsReflection("User", tuser); }
public override void Run(TestMain main) { var user = main.User; var handler = main.TwitchAPIHandler; var userId = user.ReadInput("Enter User Id").AsString; var tuser = handler.API.V5.Users.GetUserByID(userId); user.SendMessageAsReflection("User", tuser); }
/// <summary> /// Linq2SQL 基本功能测试 /// /// 基本的 查询 / 插入 / 更新 / 删除 处理. /// /// </summary> private static void BaseTest() { Test context = new Test(connString); // 单表查询 var query = from testMain in context.TestMain select testMain; foreach (TestMain main in query) { Console.WriteLine("Main[{0}, {1}]", main.Id, main.Value); } // 关联查询 var query2 = from testSub in context.TestSub where testSub.TestMain.Value == "ONE" select testSub; foreach (TestSub sub in query2) { Console.WriteLine("Sub[{0}, {1}]", sub.Id, sub.Value); } // 插入. TestMain main3 = new TestMain(); main3.Id = 3; main3.Value = "Three"; context.TestMain.InsertOnSubmit(main3); context.SubmitChanges(); Console.WriteLine("INSERT FINISH! --- Please Press Enter Ket"); Console.ReadLine(); // 更新. var newTestMain = (from testMain in context.TestMain where testMain.Id == 3 select testMain).First(); newTestMain.Value = "Three3"; context.SubmitChanges(); Console.WriteLine("UPDATE FINISH! --- Please Press Enter Ket"); Console.ReadLine(); // 单表查询 TOP 2 var queryTop2 = (from testMain in context.TestMain orderby testMain.Id descending select testMain).Take(2); foreach (TestMain main in queryTop2) { Console.WriteLine("Main[{0}, {1}]", main.Id, main.Value); } // 删除. context.TestMain.DeleteOnSubmit(newTestMain); context.SubmitChanges(); Console.WriteLine("DELETE FINISH! --- Please Press Enter Ket"); Console.ReadLine(); }
/// <summary> /// 事务处理的测试. /// /// 隐式创建事务 /// /// </summary> private static void TransactionTest() { // 在我们没有显式的开启事务时, // DataContext.SubmitChanges在提交时会隐式创建事务 Test context = new Test(connString); try { // 插入. TestMain main3 = new TestMain(); main3.Id = 3; main3.Value = "Three"; context.TestMain.InsertOnSubmit(main3); TestMain main3x = new TestMain(); main3x.Id = 3; main3x.Value = "Three Err"; context.TestMain.InsertOnSubmit(main3x); context.SubmitChanges(); } catch (Exception err) { Console.WriteLine(err.ToString()); } var query = from testMain in context.TestMain where testMain.Id == 3 select testMain; Console.WriteLine("TestMain 表中, id=3 的记录有{0}条 ", query.Count()); }