private void PerformAdditionalDisposal() { if (_component != null) { _component.PropertyChanged -= Component_PropertyChanged; _component.LogUpdated -= Component_LogUpdated; _component = null; } }
public DesktopLogComponentPanel(DesktopLogComponent component) : this() { _component = component; _component.PropertyChanged += Component_PropertyChanged; _component.LogUpdated += Component_LogUpdated; try { _autoScrollToEnd = ViewSettings.Default.AutoScrollToEnd; } catch (Exception) {} // note: we don't bind directly to the component because the search and auto scroll features are control-specific, and the window size // on the component is specified in bytes (so we have to convert them ourselves) txtWindowSize.DataBindings.Add("Text", this, "WindowSizeKB", false, DataSourceUpdateMode.OnPropertyChanged); txtSearch.DataBindings.Add("Text", this, "SearchText", false, DataSourceUpdateMode.OnPropertyChanged); chkAutoScrollToEnd.DataBindings.Add("Checked", this, "AutoScrollToEnd", false, DataSourceUpdateMode.OnPropertyChanged); UpdateLogContents(); }
/// <summary> /// Called by the application framework to set the component the view is for. /// </summary> /// <param name="component"></param> public void SetComponent(IApplicationComponent component) { _component = (DesktopLogComponent) component; }
/// <summary> /// Called by the application framework to set the component the view is for. /// </summary> /// <param name="component"></param> public void SetComponent(IApplicationComponent component) { _component = (DesktopLogComponent)component; }