public void FusionWithCloseHandle() { if (CloseHandle == null) { return; } OnFusion.Invoke(this); CloseHandle.OnMoved.Invoke(CloseHandle); foreach (UnityAction <LowPolyPointHandle> action in moveActions) { CloseHandle.AddMoveAction(action); } foreach (UnityAction <LowPolyPointHandle> action in destroyActions) { CloseHandle.AddDestroyAction(action); } foreach (UnityAction <LowPolyPointHandle> action in fusionActions) { CloseHandle.AddFusionAction(action); } RemoveAllListeners(); DestroyImmediate(gameObject); }
private void EnqueueCloseHandle(Action<IntPtr> callback, IntPtr handle) { var closeHandle = new CloseHandle { Callback = callback, Handle = handle }; lock (_closeHandleSync) { _closeHandleAdding.Enqueue(closeHandle); } }
private void generateSubForm(TreeNode treeNode) { isGeneratingSubForm = true; try { TabPage tabPage = (TabPage)treeNode.Tag; if (tabPage != null) { tabControl1.SelectedTab = tabPage; if (!tabControl1.TabPages.Contains(tabPage)) { tabControl1.TabPages.Add(tabPage); } } else { tabPage = new TabPage(); tabPage.Name = treeNode.Name; tabPage.Text = treeNode.Text; treeNode.Tag = tabPage; //Form fm = (SubForm)System.Reflection.Assembly.GetExecutingAssembly().CreateInstance(GetType().Namespace + "." + "SubForm"); SubForm fm = new SubForm(); fm.FormBorderStyle = FormBorderStyle.None; fm.TopLevel = false; fm.ControlBox = false; fm.Parent = tabPage; fm.Dock = DockStyle.Fill; fm.Name = treeNode.Name; fm.Text = treeNode.Text; tabPage.Tag = fm; tabControl1.TabPages.Add(tabPage); tabControl1.SelectedTab = tabPage; fm.Tag = treeNode; fm.CloseForm += (a) => { CloseHandle _handle = new CloseHandle(CloseForm); this.BeginInvoke(_handle, a); }; fm.Show(); fm.Focus(); } } catch (Exception e) { MessageBox.Show(e.Message); } finally { isGeneratingSubForm = false; } }
public Ring(int entries, RingOptions?ringOptions = default) { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { throw new PlatformNotSupportedException(); } if (entries < 1) { throw new ArgumentOutOfRangeException(nameof(entries), "must be non-zero positive value"); } io_uring_params p = default; int fd = Setup((uint)entries, &p, ringOptions); _ringFd = new CloseHandle(); _ringFd.SetHandle(fd); _flags = p.flags; _features = p.features; var(sqSize, cqSize) = GetSize(&p); try { _sq = MapSq(fd, sqSize, &p, out _sqHandle, out _sqeHandle); _cq = MapCq(fd, cqSize, &p, _sqHandle, out _cqHandle); } catch (ErrnoException) { // Ensure we don't leak file handles on error Dispose(); throw; } SubmissionQueueSize = (int)sqSize; CompletionQueueSize = (int)cqSize; }
Ring(int entries, object?hack, RingOptions? ringOptions = default) #endif { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || !KernelVersion.Supports.IoUring) { ThrowPlatformNotSupportedException(); } if (entries < 1) { ThrowArgumentOutOfRangeException(ExceptionArgument.entries); } io_uring_params p = default; int fd = Setup((uint)entries, &p, ringOptions); _ringFd = new CloseHandle(); _ringFd.SetHandle(fd); _flags = p.flags; _features = p.features; var(sqSize, cqSize) = GetSize(&p); try { _sq = MapSq(fd, sqSize, &p, SubmissionPollingEnabled, IoPollingEnabled, out _sqHandle, out _sqeHandle); _cq = MapCq(fd, cqSize, &p, _sqHandle, IoPollingEnabled, out _cqHandle); _supportedOperations = FetchSupportedOperations(fd); } catch (ErrnoException) { // Ensure we don't leak file handles on error Dispose(); throw; } }
public void CloseHan(IntPtr handle) { CloseHandle.Invoke(null, new object[] { handle }); }