public void Build(Dictionary <PieceCoordinates, MapNode> coordinateMap, GameObject rootParentGameObject, int depth) { if (depth <= 0) { return; } List <EConnectionPoints> successfulConnectionsMade = new List <EConnectionPoints>(); foreach (var connection in ConnectionPoints) { if (!CanPlacePieceInConnection(connection, coordinateMap)) { DevTools.Log($"Cannot place piece to the {connection} of piece {gameObject.name}."); continue; } GameObject newPiece = InstantiateRandomPieceAtConnection(connection, rootParentGameObject); coordinateMap.Add(newPiece.GetComponent <MapNode>().Coordinates, newPiece.GetComponent <MapNode>()); successfulConnectionsMade.Add(connection); StartCoroutine(WaitThenBuildAtNode(newPiece.GetComponent <MapNode>(), coordinateMap, rootParentGameObject, depth)); } foreach (var successfulConnection in successfulConnectionsMade) { ConnectionPoints.Remove(successfulConnection); } //TODO: Fix this DevTools.Log($"{gameObject.name} has {ConnectionPoints.Count} connections left"); ContainsEndpoint = ConnectionPoints.Count > 0; }
/// <summary> /// Initializes a new instance of the <see cref="MainWindow" /> class. /// </summary> public MainWindow() { InitializeComponent(); ListBox.Items = this.Examples = this.GetExamples(this.GetType().Assembly).OrderBy(e => e.Title).ToArray(); this.DataContext = this; DevTools.Attach(this); }
private void userSearch_Load(object sender, EventArgs e) { getUserInfo(); button_modify.Visible = false; button_save.Visible = false; comboBox_queryCol.Items.Add("编号"); comboBox_queryCol.Items.Add("用户名"); comboBox_queryCol.Items.Add("姓名"); comboBox_queryCol.SelectedIndex = 0; //给combobox赋值并绑定id string strQuery = @" select * from department where categroyID = " + DevTools.getDepartmentId(); ADOHelper db = new ADOHelper(); comboBox_dep.DataSource = db.ExecuteGet(strQuery).Tables[0]; comboBox_dep.DisplayMember = "depName"; comboBox_dep.ValueMember = "depID"; strQuery = @" select * from role where id > 2"; comboBox_role.DataSource = db.ExecuteGet(strQuery).Tables[0]; comboBox_role.DisplayMember = "roleName"; comboBox_role.ValueMember = "ID"; }
public async Task <string> Disconnect(CancellationToken cancellationToken = default(CancellationToken)) { await Task.Run(() => DevTools.Disconnect()); isConnected = false; DoConnectWhenCheckConnected = true; return("ok"); }
public static void AttachDevTools(Window window) { #if DEBUG #pragma warning disable GU0011 DevTools.Attach(window); #pragma warning restore GU0011 #endif }
//removing a control [fightboard] from the area panel: private void button1_Click(object sender, EventArgs e) { DevTools myform = new DevTools(myGameScr); myform.Show(); Point p = new Point(1375, 300); myform.Location = p; }
private void FormUploadFile_Load(object sender, EventArgs e) { //给combobox赋值并绑定id string strQuery = @" select * from userInfo where depCID = " + DevTools.getDepartmentId(); ADOHelper db = new ADOHelper(); comboBox_uid1.DataSource = db.ExecuteGet(strQuery).Tables[0]; comboBox_uid1.DisplayMember = "cName"; comboBox_uid1.ValueMember = "userNumber"; }
public ToolCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global) { Global = global.Global; var walletManagerCommand = ReactiveCommand.Create(OnWalletManager); var settingsCommand = ReactiveCommand.Create(() => { IoC.Get <IShell>().AddOrSelectDocument(() => new SettingsViewModel(Global)); }); #if DEBUG var devToolsCommand = ReactiveCommand.Create(() => { var devTools = new DevTools(Application.Current.Windows.FirstOrDefault()); var devToolsWindow = new Window { Width = 1024, Height = 512, Content = devTools, DataTemplates = { new ViewLocator <Avalonia.Diagnostics.ViewModels.ViewModelBase>() } }; devToolsWindow.Show(); }); #endif Observable .Merge(walletManagerCommand.ThrownExceptions) .Merge(settingsCommand.ThrownExceptions) #if DEBUG .Merge(devToolsCommand.ThrownExceptions) #endif .Subscribe(OnException); WalletManagerCommand = new CommandDefinition( "Wallet Manager", commandIconService.GetCompletionKindImage("WalletManager"), walletManagerCommand); SettingsCommand = new CommandDefinition( "Settings", commandIconService.GetCompletionKindImage("Settings"), settingsCommand); #if DEBUG DevToolsCommand = new CommandDefinition( "Dev Tools", commandIconService.GetCompletionKindImage("DevTools"), devToolsCommand); #endif }
void Start() { if (main == null) { main = this; } else { Destroy(this); } }
public ActionResult Edit(VendorModel vendormodel) { if (ModelState.IsValid) { vendormodel.ModifyTime = DevTools.GetNowDateTime(); db.Entry(vendormodel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vendormodel)); }
public ActionResult Edit(DeviceType devicetype) { if (ModelState.IsValid) { devicetype.ModifyTime = DevTools.GetNowDateTime(); db.Entry(devicetype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(devicetype)); }
private static void Main(string[] args) { // The version of ReactiveUI currently included is for WPF and so expects a WPF // dispatcher. This makes sure it's initialized. System.Windows.Threading.Dispatcher foo = System.Windows.Threading.Dispatcher.CurrentDispatcher; new App(); MainWindow.RootNamespace = "TestApplication"; var wnd = MainWindow.Create(); DevTools.Attach(wnd); Application.Current.Run(wnd); }
//添加用户 private void button_add_Click(object sender, EventArgs e) { if (!checkValide()) { return; } //格式化数据 string sid = textBox_id.Text; string admName = textBox_name.Text; string cName = textBox_cname.Text; int roleID = int.Parse(comboBox_role.SelectedValue.ToString()); int depID = int.Parse(comboBox_dep.SelectedValue.ToString()); //查询记录中是否已经有相同记录 string queryString = "select * from userInfo where userNumber = '#user1' or AdmName = '#aname' "; string str1 = queryString.Replace("#user1", sid); str1 = str1.Replace("#aname", admName); ADOHelper db = new ADOHelper(); if (db.ExecuteRead(str1).HasRows) { MessageBox.Show("编号或用户名已存在", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } //插入新用户 string insertString = "insert into userInfo (admname,usernumber,admpwd,roleid,depcid,depid,cname) values( '#admName', '#userNum', '#pwd', #roleID, #depCID, #depID, '#cName' )"; string str = insertString.Replace("#admName", admName); str = str.Replace("#userNum", sid); str = str.Replace("#pwd", "888888"); str = str.Replace("#userNum", sid); str = str.Replace("#roleID", roleID.ToString()); str = str.Replace("#depCID", DevTools.getDepartmentId());//默认用2,2为交管局,1为公安局 str = str.Replace("#depID", depID.ToString()); str = str.Replace("#cName", cName); if (db.ExecuteUpdate(str)) { CValidateTools.showOK("添加用户成功"); clearControlData();//清除录入数据 } else { CValidateTools.showError("添加用户失败"); } }
private static async Task LoadDbAsync() { List <Task> tasksList = new List <Task>(); tasksList.Add(Task.Run(() => DevTools.LoadDtDb())); tasksList.Add(Task.Run(() => OrdersList.LoadOrders())); tasksList.Add(Task.Run(() => LedCollectiveDb.LoadDb())); tasksList.Add(Task.Run(() => OrdersList.LoadTestersDict())); await Task.WhenAll(tasksList); OrdersList.FillOutOrdersListGrid(); }
public ActionResult Create(DeviceType devicetype) { if (ModelState.IsValid) { devicetype.CreateTime = DevTools.GetNowDateTime(); devicetype.ModifyTime = devicetype.CreateTime; db.DeviceTypes.Add(devicetype); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(devicetype)); }
public ActionResult Create(VendorModel vendormodel) { if (ModelState.IsValid) { vendormodel.CreateTime = DevTools.GetNowDateTime(); vendormodel.ModifyTime = vendormodel.CreateTime; db.VendorModels.Add(vendormodel); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(vendormodel)); }
public Client() { Menu = new MenuController(this); Tools = new DevTools(this); NoClip = new NoclipController(this); Debugger = new EntityDebugger(this); RegisterEventHandler("playerSpawned", new Action(OnSpawn)); if (Game.PlayerPed.Position != default(Vector3)) { OnSpawn(); } }
public ActionResult Create(MenuModel menu) { if (ModelState.IsValid) { //新建菜单的创建日期和修改日期为当前日期 menu.CreateDate = DevTools.GetNowDateTime(); menu.ModifyDate = menu.CreateDate; db.Menus.Add(menu); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(menu)); }
public virtual async Task <string> Connect(CancellationToken cancellationToken = default(CancellationToken)) { UnsubscribeDevToolsSessionEvent(); DoConnectWhenCheckConnected = false; if (!string.IsNullOrWhiteSpace(UserDir)) { chromeProcess = await OpenChromeProfile(UserDir); } await DevTools.Connect(); SubscribeToDevToolsSessionEvent(); await FrameTracker.Enable(); return($"Connected to Chrome port {Port}"); }
/// <summary> /// Gets the rules that match the current state of the session. /// </summary> /// <returns></returns> public async Task <IEnumerable <ISkraprRule> > GetMatchingRules() { var frameState = await DevTools.GetCurrentFrameState(); var matchingRules = new List <ISkraprRule>(); var availableRules = Definition.Rules .Where(r => r.Max.HasValue == false || r.Max.Value > 0); foreach (var rule in availableRules) { var ruleResult = await rule.IsMatch(frameState); if (ruleResult == true) { matchingRules.Add(rule); } } return(matchingRules); }
private void Start() { DevTools.SetDebugOutputs(false, false); Random.InitState((int)System.DateTime.Now.Ticks); Map = new Dictionary <PieceCoordinates, MapNode>(); OriginNode.Coordinates = new PieceCoordinates(0, 0); Map.Add(OriginNode.Coordinates, OriginNode); OriginNode.Build(Map, gameObject, Depth); if (!UseMaterialColors) { Material newMat = new Material(Shader.Find("Standard")); foreach (MeshRenderer mr in GetComponentsInChildren <MeshRenderer>()) { mr.material = newMat; } } }
public ActionResult Edit(MenuModel menu) { if (ModelState.IsValid) { //修改日期为当前日期 menu.ModifyDate = DevTools.GetNowDateTime(); db.Entry(menu).State = EntityState.Modified; db.SaveChanges(); if (!savePath(menu))//保存path字段,路径如 0,1,2 { return(View(menu)); } return(RedirectToAction("Index")); } ViewBag.ParentId = getParentSelectList(menu); //暂时不做缓存 OutputCacheAttribute.ChildActionCache = new MemoryCache("MyMenus"); return(View(menu)); }
static int MergeResourceHeader(ConsoleService c, string cmdName, string str) { string baseFile = @"C:\git\IPA-DNP-DeskVPN\src\PenCore\resource.h"; string targetFile = @"C:\sec\Desk\current\Desk\DeskVPN\PenCore\resource.h"; string destFile = @"c:\tmp\200404\resource.h"; int minId = 2500; var baseDict = DevTools.ParseHeaderConstants(Lfs.ReadStringFromFile(baseFile)); var targetDict = DevTools.ParseHeaderConstants(Lfs.ReadStringFromFile(targetFile)); KeyValueList <string, int> adding = new KeyValueList <string, int>(); // 利用可能な ID の最小値 int newId = Math.Max(baseDict.Values.Where(x => x < 40000).Max(), minId); foreach (var kv in targetDict.OrderBy(x => x.Value)) { if (baseDict.ContainsKey(kv.Key) == false) { adding.Add(kv.Key, ++newId); } } // 結果を出力 StringWriter w = new StringWriter(); foreach (var kv in adding) { int paddingCount = Math.Max(31 - kv.Key.Length, 0); w.WriteLine($"#define {kv.Key}{Str.MakeCharArray(' ', paddingCount)} {kv.Value}"); } Lfs.WriteStringToFile(destFile, w.ToString(), FileFlags.AutoCreateDirectory); return(0); }
/// <summary> /// Attaches DevTools to a Application, to be opened with the specified options. /// </summary> /// <param name="application">The Application to attach DevTools to.</param> /// <param name="options">Additional settings of DevTools.</param> /// <remarks> /// Attach DevTools should only be called after application initialization is complete. A good point is <see cref="Application.OnFrameworkInitializationCompleted"/> /// </remarks> /// <example> /// <code> /// public class App : Application /// { /// public override void OnFrameworkInitializationCompleted() /// { /// if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktopLifetime) /// { /// desktopLifetime.MainWindow = new MainWindow(); /// } /// else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewLifetime) /// singleViewLifetime.MainView = new MainView(); /// /// base.OnFrameworkInitializationCompleted(); /// this.AttachDevTools(new Avalonia.Diagnostics.DevToolsOptions() /// { /// StartupScreenIndex = 1, /// }); /// } /// } /// </code> /// </example> public static void AttachDevTools(this Application application, DevToolsOptions options) { DevTools.Attach(application, options); }
/// <summary> /// Attaches DevTools to a Application, to be opened with the specified options. /// </summary> /// <param name="application">The Application to attach DevTools to.</param> public static void AttachDevTools(this Application application) { DevTools.Attach(application, new DevToolsOptions()); }
/// <summary> /// Attaches DevTools to a window, to be opened with the specified options. /// </summary> /// <param name="root">The window to attach DevTools to.</param> /// <param name="options">Additional settings of DevTools.</param> public static void AttachDevTools(this TopLevel root, DevToolsOptions options) { DevTools.Attach(root, options); }
/// <summary> /// Attaches DevTools to a window, to be opened with the specified key gesture. /// </summary> /// <param name="root">The window to attach DevTools to.</param> /// <param name="gesture">The key gesture to open DevTools.</param> public static void AttachDevTools(this TopLevel root, KeyGesture gesture) { DevTools.Attach(root, gesture); }
/// <summary> /// Attaches DevTools to a window, to be opened with the F12 key. /// </summary> /// <param name="root">The window to attach DevTools to.</param> public static void AttachDevTools(this TopLevel root) { DevTools.Attach(root, new DevToolsOptions()); }
public HelpCommands(CommandIconService commandIconService, AvaloniaGlobalComponent global) { Global = global.Global; AboutCommand = new CommandDefinition( "About", commandIconService.GetCompletionKindImage("About"), ReactiveCommand.Create(() => { IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global)); })); CustomerSupportCommand = new CommandDefinition( "Customer Support", commandIconService.GetCompletionKindImage("CustomerSupport"), ReactiveCommand.Create(() => { try { IoHelpers.OpenBrowser("https://www.reddit.com/r/WasabiWallet/"); } catch (Exception ex) { Logging.Logger.LogWarning <HelpCommands>(ex); IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global)); } })); ReportBugCommand = new CommandDefinition( "Report Bug", commandIconService.GetCompletionKindImage("ReportBug"), ReactiveCommand.Create(() => { try { IoHelpers.OpenBrowser("https://github.com/zkSNACKs/WalletWasabi/issues"); } catch (Exception ex) { Logging.Logger.LogWarning <HelpCommands>(ex); IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global)); } })); FaqCommand = new CommandDefinition( "FAQ", commandIconService.GetCompletionKindImage("Faq"), ReactiveCommand.Create(() => { try { IoHelpers.OpenBrowser("https://github.com/zkSNACKs/WalletWasabi/blob/master/WalletWasabi.Documentation/FAQ.md"); } catch (Exception ex) { Logging.Logger.LogWarning <HelpCommands>(ex); IoC.Get <IShell>().AddOrSelectDocument(() => new AboutViewModel(Global)); } })); PrivacyPolicyCommand = new CommandDefinition( "Privacy Policy", commandIconService.GetCompletionKindImage("PrivacyPolicy"), ReactiveCommand.Create(() => { IoC.Get <IShell>().AddOrSelectDocument(() => new PrivacyPolicyViewModel(Global)); })); TermsAndConditionsCommand = new CommandDefinition( "Terms and Conditions", commandIconService.GetCompletionKindImage("TermsAndConditions"), ReactiveCommand.Create(() => { IoC.Get <IShell>().AddOrSelectDocument(() => new TermsAndConditionsViewModel(Global)); })); LegalIssuesCommand = new CommandDefinition( "Legal Issues", commandIconService.GetCompletionKindImage("LegalIssues"), ReactiveCommand.Create(() => { IoC.Get <IShell>().AddOrSelectDocument(() => new LegalIssuesViewModel(Global)); })); #if DEBUG DevToolsCommand = new CommandDefinition( "Dev Tools", commandIconService.GetCompletionKindImage("DevTools"), ReactiveCommand.Create(() => { var devTools = new DevTools(Application.Current.Windows.FirstOrDefault()); var devToolsWindow = new Window { Width = 1024, Height = 512, Content = devTools, DataTemplates = { new ViewLocator <Avalonia.Diagnostics.ViewModels.ViewModelBase>(), } }; devToolsWindow.Show(); })); #endif }
public static void AttachDevTools(Window window) { #if DEBUG DevTools.Attach(window); #endif }