public void Dispose() { _errorProvider?.Dispose(); _control2?.Dispose(); _control1?.Dispose(); _form?.Dispose(); }
public void Dispose() { // Do not change this code. Put cleanup code in 'Dispose(bool disposing)' method _ctrl?.Dispose(); _unitOfWork?.Dispose(); }
private void CreateView() { if (_isFirstInitialization) { Element.CheckConsistency(); _isFirstInitialization = false; } Control?.DataSource?.Dispose(); Control?.CollectionViewLayout?.Dispose(); Control?.Dispose(); var layout = BuildListLayout(); // Otherwise the UICollectionView doesn't seem to take enough space if (Element.ItemHeight > 0) { Element.HeightRequest = Element.ItemHeight + Element.CollectionPadding.VerticalThickness + Element.Margin.VerticalThickness; } var rect = new CGRect(0, 0, 100, Element.HeightRequest); _collectionView = new UICollectionView(rect, layout) { DecelerationRate = Element.ScrollSpeed == ScrollSpeed.Normal ? UIScrollView.DecelerationRateNormal : UIScrollView.DecelerationRateFast, BackgroundColor = Element?.BackgroundColor.ToUIColor(), ShowsHorizontalScrollIndicator = false, ContentInset = new UIEdgeInsets(0, 0, 0, 0), }; }
public void LoadBindings(List <Hotkey> binds) { if (binds == null) { return; } m_selectedItem = null; int c = panel1.Controls.Count; for (int i = 0; i < c; i++) { Control ct = panel1.Controls[0]; panel1.Controls.RemoveAt(0); ct?.Dispose(); } foreach (Hotkey kb in binds) { KeyRebind krb = new KeyRebind(); krb.Function = kb.Function; krb.KeyBind = new Misc.Hotkey(kb.Keys); AddRebind(krb); krb.UpdateText(); } }
private void InternalDispose(bool disposing) { if (disposing) { Interlocked.Exchange(ref browserInitialized, 0); CanExecuteJavascriptInMainFrame = false; // Don't maintain a reference to event listeners anylonger: AddressChanged = null; ConsoleMessage = null; FrameLoadEnd = null; FrameLoadStart = null; IsBrowserInitializedChanged = null; LoadError = null; LoadingStateChanged = null; StatusMessage = null; TitleChanged = null; JavascriptMessageReceived = null; // Release reference to handlers, except LifeSpanHandler which is done after Disposing // ManagedCefBrowserAdapter otherwise the ILifeSpanHandler.DoClose will not be invoked. // We also leave FocusHandler and override with a NoFocusHandler implementation as // it so we can block taking Focus (we're dispoing afterall). Issue #3715 FreeHandlersExceptLifeSpanAndFocus(); FocusHandler = new NoFocusHandler(); browser = null; if (parentFormMessageInterceptor != null) { parentFormMessageInterceptor.Dispose(); parentFormMessageInterceptor = null; } if (managedCefBrowserAdapter != null) { managedCefBrowserAdapter.Dispose(); managedCefBrowserAdapter = null; } //Dispose of BrowserSettings if we created it, if user created then they're responsible if (browserSettings != null && browserSettings.AutoDispose) { browserSettings.Dispose(); } browserSettings = null; parkingControl?.Dispose(); parkingControl = null; // LifeSpanHandler is set to null after managedCefBrowserAdapter.Dispose so ILifeSpanHandler.DoClose // is called. LifeSpanHandler = null; } Cef.RemoveDisposable(this); }
private void CreateView() { if (_isFirstInitialization) { Element.CheckConsistency(); _isFirstInitialization = false; } Control?.DataSource?.Dispose(); Control?.CollectionViewLayout?.Dispose(); Control?.Dispose(); var sectionInset = new UIEdgeInsets( (nfloat)Element.CollectionPadding.Top, (nfloat)Element.CollectionPadding.Left, (nfloat)Element.CollectionPadding.Bottom, (nfloat)Element.CollectionPadding.Right); var layout = Element.ListLayout == HorizontalListViewLayout.Grid ? new UICollectionViewFlowLayout { ScrollDirection = UICollectionViewScrollDirection.Vertical, ItemSize = new CGSize(Element.ItemWidth, Element.ItemHeight), MinimumInteritemSpacing = Element.ItemSpacing, MinimumLineSpacing = Element.ItemSpacing, SectionInset = sectionInset, } : new SnappingCollectionViewLayout(Element.SnapStyle) { ScrollDirection = UICollectionViewScrollDirection.Horizontal, ItemSize = new CGSize(Element.ItemWidth, Element.ItemHeight), MinimumInteritemSpacing = Element.ItemSpacing, MinimumLineSpacing = Element.ItemSpacing, SectionInset = sectionInset, }; // Otherwise the UICollectionView doesn't seem to take enough space if (Element.ItemHeight > 0) { Element.HeightRequest = Element.ItemHeight + Element.CollectionPadding.VerticalThickness + Element.Margin.VerticalThickness; } var rect = new CGRect(0, 0, 100, Element.HeightRequest); _collectionView = new UICollectionView(rect, layout) { DecelerationRate = Element.ScrollSpeed == ScrollSpeed.Normal ? UIScrollView.DecelerationRateNormal : UIScrollView.DecelerationRateFast, BackgroundColor = Element?.BackgroundColor.ToUIColor(), ShowsHorizontalScrollIndicator = false, ContentInset = new UIEdgeInsets(0, 0, 0, 0), }; }
protected override void Dispose(bool disposing) { if (disposing) { _textbox?.Dispose(); _upDownButtons?.Dispose(); } base.Dispose(disposing); }
protected void Play() { _object?.Dispose(); InitializeObject(); _timer.Stop(); _timer.Start(); System.Windows.Forms.Form.ActiveForm?.Controls.Add(_object); }
private void InternalDispose(bool disposing) { if (disposing) { CanExecuteJavascriptInMainFrame = false; IsBrowserInitialized = false; // Don't maintain a reference to event listeners anylonger: AddressChanged = null; ConsoleMessage = null; FrameLoadEnd = null; FrameLoadStart = null; IsBrowserInitializedChanged = null; LoadError = null; LoadingStateChanged = null; StatusMessage = null; TitleChanged = null; JavascriptMessageReceived = null; // Release reference to handlers, except LifeSpanHandler which is done after Disposing // ManagedCefBrowserAdapter otherwise the ILifeSpanHandler.DoClose will not be invoked. this.SetHandlersToNullExceptLifeSpan(); browser = null; if (parentFormMessageInterceptor != null) { parentFormMessageInterceptor.Dispose(); parentFormMessageInterceptor = null; } if (managedCefBrowserAdapter != null) { managedCefBrowserAdapter.Dispose(); managedCefBrowserAdapter = null; } //Dispose of BrowserSettings if we created it, if user created then they're responsible if (browserSettings.FrameworkCreated) { browserSettings.Dispose(); } browserSettings = null; parkingControl?.Dispose(); parkingControl = null; // LifeSpanHandler is set to null after managedCefBrowserAdapter.Dispose so ILifeSpanHandler.DoClose // is called. LifeSpanHandler = null; } Cef.RemoveDisposable(this); }
protected override void Dispose(bool disposing) { if (disposed) { return; } disposed = true; Control?.Dispose(); base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (Control != null) { Control.Busy -= OnBusy; Control.Available -= OnAvailability; Control.FinishCapture -= FinishCapture; Control.FrameAvailable -= FrameAvailable; } Control?.Dispose(); base.Dispose(disposing); }
public static string ParseGroup(string zenSyntax) { if (!IsValid(zenSyntax)) { return(string.Empty); } Control root = null; try { root = new Control(); List <string> parts = GetSubParts(zenSyntax, _elem); //AdjustImplicitTagNames(parts); foreach (var s in _shorts) { for (int index = 0; index < parts.Count; index++) { string p = parts[index]; p = _strips.Aggregate(p, (current1, strip) => StripToFirst(current1, strip.ToString())); string pLow = p.ToLower(); //.Replace(">", string.Empty); if (pLow == s.Key) { int length = parts[index].StartsWith(">") ? p.Length + 1 : p.Length; //length = parts[index].StartsWith("^+") ? p.Length + 2 : length; string firstPart = parts[index].Substring(0, length).Replace(p, s.Value); string secondPart = parts[index].Substring(length); parts[index] = firstPart + secondPart; } } } // TODO: Add option to omit //if (!IsValidHtmlElements(parts)) // return string.Empty; IEnumerable <Control> current = new[] { root }; BuildControlTree(CloneStack(parts), current.First(), -1); return(RenderControl(root)); } finally { root?.Dispose(); } }
private void RemoveCurrentPopulation() { foreach (var item in picturesLayoutPanel.Controls) { Control c = item as Control; c?.Dispose(); } picturesLayoutPanel.Controls.Clear(); if (population != null) { population.Clear(); } Invalidate(); }
public override bool Initialize() { base.Initialize(); try { Control.CreateControl(); _connectionInfo = InterfaceControl.Info; try { while (!Control.Created) { Thread.Sleep(0); Application.DoEvents(); } _rdpClient = (MsRdpClient8NotSafeForScripting)((AxMsRdpClient8NotSafeForScripting)Control).GetOcx(); } catch (System.Runtime.InteropServices.COMException ex) { Runtime.MessageCollector.AddExceptionMessage(Language.strRdpControlCreationFailed, ex); Control.Dispose(); return(false); } _rdpVersion = new Version(_rdpClient.Version); _rdpClient.Server = _connectionInfo.Hostname; SetCredentials(); SetResolution(); _rdpClient.FullScreenTitle = _connectionInfo.Name; //not user changeable _rdpClient.AdvancedSettings2.GrabFocusOnConnect = true; _rdpClient.AdvancedSettings3.EnableAutoReconnect = true; _rdpClient.AdvancedSettings3.MaxReconnectAttempts = Settings.Default.RdpReconnectionCount; _rdpClient.AdvancedSettings2.keepAliveInterval = 60000; //in milliseconds (10.000 = 10 seconds) _rdpClient.AdvancedSettings5.AuthenticationLevel = 0; _rdpClient.AdvancedSettings2.EncryptionEnabled = 1; _rdpClient.AdvancedSettings2.overallConnectionTimeout = Settings.Default.ConRDPOverallConnectionTimeout; _rdpClient.AdvancedSettings2.BitmapPeristence = Convert.ToInt32(_connectionInfo.CacheBitmaps); if (_rdpVersion >= Versions.RDC61) { _rdpClient.AdvancedSettings7.EnableCredSspSupport = _connectionInfo.UseCredSsp; } SetUseConsoleSession(); SetPort(); RedirectKeys = _connectionInfo.RedirectKeys; SetRedirection(); SetAuthenticationLevel(); SetLoadBalanceInfo(); SetRdGateway(); _rdpClient.ColorDepth = (int)_connectionInfo.Colors; SetPerformanceFlags(); _rdpClient.ConnectingText = Language.strConnecting; Control.Anchor = AnchorStyles.None; return(true); } catch (Exception ex) { Runtime.MessageCollector.AddExceptionStackTrace(Language.strRdpSetPropsFailed, ex); return(false); } }
public void Dispose() { _ctrl?.Dispose(); _uow?.Dispose(); }
/// <summary> /// Dispose /// </summary> public override void Dispose() { base.Dispose(); control.Dispose(); }
public override void DestroyControlPane(Control pane) { pane?.Dispose(); }
public void Remove(Control building) { base.Controls.Remove(building); building.Dispose(); Arrange(); }
public override void DestroyControlPane(Control pane) { ns.mainPan.onClosing(null); pane.Dispose(); }
GraphicsContextFlags GetUsableContextFlags(GraphicsContextFlags flags) { Control temp_control = null; IGraphicsContext temp_context = null; IGLControl temp_implementation = null; Exception exc = null; switch (flags) { default: { return(GetUsableContextFlags(GraphicsContextFlags.Default)); } case GraphicsContextFlags.Angle: { return(GetUsableContextFlags(GraphicsContextFlags.AngleD3D9)); } case GraphicsContextFlags.Default: case GraphicsContextFlags.AngleD3D11: case GraphicsContextFlags.AngleD3D9: { try { temp_control = new Control(); temp_control.CreateControl(); if (flags == GraphicsContextFlags.AngleD3D11) { major = 3; } if (flags == GraphicsContextFlags.AngleD3D9) { major = 2; } temp_implementation = design_mode ? new DummyGLControl() : new GLControlFactory().CreateGLControl(format, temp_control, flags); temp_context = temp_implementation.CreateContext(major, minor, flags); temp_context.MakeCurrent(temp_implementation.WindowInfo); if (!design_mode) { ((IGraphicsContextInternal)temp_context).LoadAll(); } // Enforce a minimum version for default renderer for maximum compatibility if (flags == GraphicsContextFlags.Default && new Version(GL.GetString(StringName.Version).Split(' ')[0]) < new Version(major, minor)) { throw new Exception("Unsupported version, using ANGLE."); } } catch (Exception e) { exc = e; } } break; } temp_control?.Dispose(); temp_context?.Dispose(); temp_implementation?.WindowInfo?.Dispose(); if (exc != null) { switch (flags) { case GraphicsContextFlags.Default: return(GetUsableContextFlags(GraphicsContextFlags.Angle)); case GraphicsContextFlags.AngleD3D11: return(GetUsableContextFlags(GraphicsContextFlags.AngleD3D9)); case GraphicsContextFlags.AngleD3D9: throw new NoGLContextAvailable(exc); } } return(flags); }
public void Dispose() { _ctrl?.Dispose(); //control null değilse dispose ediyoruz _uow?.Dispose(); //aynı şekilde unitofwork null değilse dispose ediyoruz. }
public void Dispose() { _ctrl?.Dispose(); _uow?.Dispose(); //GC.SuppressFinalize(this); }
/// <summary> /// Removes a control from the GUI /// </summary> /// <param name="control">The control to remove</param> public static void RemoveControl(Control control) { CustomUI.Controls.Remove(control); if (OnControlRemoved != null) OnControlRemoved(control); if (control.OnRemoved != null) control.OnRemoved(control, null); if (Control.GlobalRemoved != null) Control.GlobalRemoved(control, null); control.Dispose(); }
public void Dispose() { //komple bll i dispose edersek hata alırız sadece unitofwork u dispose edeceğiz. _ctrl?.Dispose(); _uow.Dispose(); }
public void RemoveControl(Control control) { Controls.Remove(control); if (OnRemoveControl != null) OnRemoveControl(this, control); if (GlobalRemoveControl != null) GlobalRemoveControl(this, control); if (control.OnRemoved != null) control.OnRemoved(control, null); if (Control.GlobalRemoved != null) Control.GlobalRemoved(control, null); control.Dispose(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); Control?.Dispose(); }
public void Dispose() { _control?.Dispose(); }
public void Dispose() { ParentTab?.Dispose(); Control?.Dispose(); Control?.Client?.ConnectedSocket?.ShutdownAndClose(); }
public void Unload() { files.Clear(); Control?.Dispose(); }
public void Dispose() { _ctrl?.Dispose(); _unitOfWork?.Dispose(); }
private void CreateView() { if (Control == null && !Element.IsVisible) { return; } if (Control != null && !Element.IsVisible) { Control.Hidden = true; return; } Control?.DataSource?.Dispose(); Control?.CollectionViewLayout?.Dispose(); Control?.Dispose(); var sectionInset = new UIEdgeInsets( (nfloat)Element.CollectionPadding.Top, (nfloat)Element.CollectionPadding.Left, (nfloat)Element.CollectionPadding.Bottom, (nfloat)Element.CollectionPadding.Right); var layout = Element.ListLayout == HorizontalListViewLayout.Grid ? new UICollectionViewFlowLayout { ScrollDirection = UICollectionViewScrollDirection.Vertical, ItemSize = new CGSize(Element.ItemWidth, Element.ItemHeight), MinimumInteritemSpacing = Element.ItemSpacing, MinimumLineSpacing = Element.ItemSpacing, SectionInset = sectionInset, } : new SnappingCollectionViewLayout(Element.SnapStyle) { ScrollDirection = UICollectionViewScrollDirection.Horizontal, ItemSize = new CGSize(Element.ItemWidth, Element.ItemHeight), MinimumInteritemSpacing = Element.ItemSpacing, MinimumLineSpacing = Element.ItemSpacing, SectionInset = sectionInset, }; var rect = new CGRect(0, 0, Element.ItemWidth, Element.ItemHeight); var collectionView = new UICollectionView(rect, layout) { DecelerationRate = UIScrollView.DecelerationRateFast, BackgroundColor = Element?.BackgroundColor.ToUIColor(), ShowsHorizontalScrollIndicator = false, ContentInset = new UIEdgeInsets(0, 0, 0, 0), }; // Otherwise the UICollectionView doesn't seem to take enough space Element.HeightRequest = Element.ItemHeight + Element.CollectionPadding.VerticalThickness + Element.Margin.VerticalThickness; SetNativeControl(collectionView); UpdateItemsSource(); if (Element.SnapStyle == SnapStyle.Center) { Control.DraggingEnded += OnDraggingEnded; Control.DecelerationEnded += OnDecelerationEnded; } Control.Scrolled += OnScrolled; Control.ScrollAnimationEnded += OnStopScrolling; Control.DecelerationEnded += OnStopScrolling; if (Element.EnableDragAndDrop) { EnableDragAndDrop(); } ScrollToCurrentItem(); ProcessDisableScroll(); }
public override void Dispose() { base.Dispose(); control?.Dispose(); control = null; }