/// <summary>
        /// Does cleanup when the main widget is destroyed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void _mainWidget_Destroyed(object sender, EventArgs e)
        {
            if (numberLockedCols > 0)
            {
                Grid.Vadjustment.ValueChanged         -= Gridview_Vadjustment_Changed;
                Grid.Selection.Changed                -= Gridview_CursorChanged;
                Fixedcolview.Vadjustment.ValueChanged -= Fixedcolview_Vadjustment_Changed1;
                Fixedcolview.Selection.Changed        -= Fixedcolview_CursorChanged;
            }
            // It's good practice to disconnect the event handlers, as it makes memory leaks
            // less likely. However, we may not "own" the event handlers, so how do we
            // know what to disconnect?
            // We can do this via reflection. Here's how it currently can be done in Gtk#.
            // Windows.Forms would do it differently.
            // This may break if Gtk# changes the way they implement event handlers.
            ClearGridColumns();
            gridmodel.Dispose();
            if (imagePixbuf != null)
            {
                imagePixbuf.Dispose();
            }

            if (image1 != null)
            {
                image1.Dispose();
            }

            if (table != null)
            {
                table.Dispose();
            }

            mainWidget.Destroyed -= _mainWidget_Destroyed;
            owner = null;
        }
Beispiel #2
0
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     heightModel.Dispose();
     gridModel.Dispose();
     _mainWidget.Destroyed -= _mainWidget_Destroyed;
     _owner = null;
 }
Beispiel #3
0
 public override void Destroy()
 {
     teamsStore.Dispose();
     teamtemplateeditor1.Destroy();
     teamseditortreeview.Destroy();
     base.Destroy();
 }
Beispiel #4
0
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     comboModel.Dispose();
     comboRender.Destroy();
     _mainWidget.Destroyed -= _mainWidget_Destroyed;
     _owner = null;
 }
Beispiel #5
0
        void InitializeProjectsListView()
        {
            projectStore?.Clear();

            // Recreate the list view each time. This is a workaround for the
            // list view not displaying items on re-populating if it has been sorted.
            if (projectsListView != null)
            {
                projectsListViewVBox.Remove(projectsListView);
                projectsListView.Dispose();
            }

            projectStore?.Dispose();

            projectCheckedField = new DataField <bool> ();
            projectNameField    = new DataField <string> ();
            packageVersionField = new DataField <string> ();
            projectField        = new DataField <ManageProjectViewModel> ();
            projectStore        = new ListStore(projectCheckedField, projectNameField, packageVersionField, projectField);

            projectsListView            = new ListView();
            projectsListView.DataSource = projectStore;

            // Selected project check box column.
            if (projectCheckBoxCellView != null)
            {
                projectCheckBoxCellView.Toggled -= ProjectCheckBoxCellViewToggled;
            }
            projectCheckBoxCellView             = new CheckBoxCellView();
            projectCheckBoxCellView.ActiveField = projectCheckedField;
            projectCheckBoxCellView.Editable    = true;
            projectCheckBoxCellView.Toggled    += ProjectCheckBoxCellViewToggled;
            var column = new ListViewColumn(string.Empty, projectCheckBoxCellView);

            projectsListView.Columns.Add(column);

            // Project column.
            var textCellView = new TextCellView();

            textCellView.TextField = projectNameField;
            column = new ListViewColumn(GettextCatalog.GetString("Project"), textCellView)
            {
                CanResize     = true,
                SortDataField = projectNameField
            };
            projectsListView.Columns.Add(column);

            // Package version column
            textCellView           = new TextCellView();
            textCellView.TextField = packageVersionField;
            column = new ListViewColumn(GettextCatalog.GetString("Version"), textCellView)
            {
                CanResize     = true,
                SortDataField = packageVersionField
            };
            projectsListView.Columns.Add(column);

            // Add list view to dialog.
            projectsListViewVBox.PackStart(projectsListView, true, true);
        }
 private void OnClose(object sender, EventArgs args)
 {
     try
     {
         if (tree != null)
         {
             tree.CursorChanged -= OnSelectionChanged;
             tree.Dispose();
             tree = null;
         }
         if (data != null)
         {
             data.Clear();
             data.Dispose();
             data = null;
         }
         if (window != null)
         {
             window.DeleteEvent -= OnClose;
             window.Destroyed   -= OnClose;
             window.Dispose();
             window = null;
         }
     }
     catch (Exception err)
     {
         explorerPresenter.MainPresenter.ShowError(err);
     }
 }
Beispiel #7
0
 /// <summary>
 /// Cleanup the events
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     combobox1.Changed -= OnSelectionChanged;
     comboModel.Dispose();
     comboRender.Destroy();
     mainWidget.Destroyed -= _mainWidget_Destroyed;
     owner = null;
 }
Beispiel #8
0
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     combobox1.Changed -= OnChanged;
     combobox1.SetCellDataFunc(comboRender, null);
     comboModel.Dispose();
     comboRender.Destroy();
     _mainWidget.Destroyed -= _mainWidget_Destroyed;
     _owner = null;
 }
Beispiel #9
0
 protected override void OnDestroyed()
 {
     ctx.Dispose();
     OnUnload();
     dashboardsStore.Dispose();
     dashboardwidget.Destroy();
     dashboardseditortreeview.Destroy();
     base.OnDestroyed();
 }
Beispiel #10
0
 protected override void OnDestroyed()
 {
     if (classListStore != null)
     {
         classListStore.Dispose();
         classListStore = null;
     }
     base.OnDestroyed();
 }
        public static void Clear()
        {
            if (games_store != null)
            {
                games_store.Dispose();
            }

            games_store = null;
        }
 protected override void OnDestroyed()
 {
     if (styleStore != null)
     {
         styleStore.Dispose();
         styleStore = null;
     }
     base.OnDestroyed();
 }
Beispiel #13
0
/*		void FileSelectionChanged (object sender, EventArgs e)
 *              {
 *                      Revision rev = SelectedRevision;
 *                      if (rev == null) {
 *                              diffWidget.ComparisonWidget.OriginalEditor.Text = "";
 *                              diffWidget.ComparisonWidget.DiffEditor.Text = "";
 *                              return;
 *                      }
 *                      TreeIter iter;
 *                      if (!treeviewFiles.Selection.GetSelected (out iter))
 *                              return;
 *                      string path = (string)changedpathstore.GetValue (iter, 5);
 *                      ThreadPool.QueueUserWorkItem (delegate {
 *                              string text = info.Repository.GetTextAtRevision (path, rev);
 *                              string prevRevision = text; // info.Repository.GetTextAtRevision (path, rev.GetPrevious ());
 *
 *                              Application.Invoke (delegate {
 *                                      diffWidget.ComparisonWidget.MimeType = DesktopService.GetMimeTypeForUri (path);
 *                                      diffWidget.ComparisonWidget.OriginalEditor.Text = prevRevision;
 *                                      diffWidget.ComparisonWidget.DiffEditor.Text = text;
 *                                      diffWidget.ComparisonWidget.CreateDiff ();
 *                              });
 *                      });
 *              }*/

        public override void Destroy()
        {
            base.Destroy();
            logstore.Dispose();
            changedpathstore.Dispose();

            diffRenderer.Dispose();
            messageRenderer.Dispose();
            textRenderer.Dispose();
        }
        protected override void OnDestroyed()
        {
            DefaultSourceEditorOptions.Instance.ColorScheme = schemeName;

            if (styleStore != null)
            {
                styleStore.Dispose();
                styleStore = null;
            }
            base.OnDestroyed();
        }
Beispiel #15
0
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     //listview.CursorChanged -= OnSelectionChanged;
     Listview.SelectionChanged -= OnSelectionChanged;
     Listview.ButtonPressEvent -= OnDoubleClick;
     ClearPopup();
     popup.Destroy();
     listmodel.Dispose();
     accel.Dispose();
     mainWidget.Destroyed -= _mainWidget_Destroyed;
     owner = null;
 }
        protected override void OnDestroyed()
        {
            addButton.Clicked    -= AddLanguageBundle;
            removeButton.Clicked -= RemoveLanguageBundle;

            if (styleStore != null)
            {
                styleStore.Dispose();
                styleStore = null;
            }
            base.OnDestroyed();
        }
        public void AddColumn(string title, string accessor)
        {
            m_Columns[title] = accessor;

            List <Context> items = new List <Context>();
            TreeIter       iter;

            for (bool run = m_Results.GetIterFirst(out iter); run; run = m_Results.IterNext(ref iter))
            {
                items.Add((Context)m_Results.GetValue(iter, 0));
            }

            List <Type> columns = new List <Type>();

            columns.Add(typeof(Context));
            columns.Add(typeof(string));

            List <TreeViewColumn> viewColumns = new List <TreeViewColumn>();

            ResetColumns();

            int i = 2;

            foreach (string col in m_Columns.Keys)
            {
                columns.Add(typeof(string));

                TreeViewColumn wordCol = new TreeViewColumn();
                wordCol.Title = col;

                CellRendererText wordColRenderer = new CellRendererText();
                wordCol.PackStart(wordColRenderer, true);

                wordCol.AddAttribute(wordColRenderer, "text", i);
                i++;

                viewColumns.Add(wordCol);
            }

            m_Results.Dispose();
            m_Results = new ListStore(columns.ToArray());
            m_ResultsTreeView.Model = m_Results;

            foreach (TreeViewColumn wordCol in viewColumns)
            {
                m_ResultsTreeView.AppendColumn(wordCol);
            }

            foreach (Context item in items)
            {
                AddItem(item);
            }
        }
Beispiel #18
0
        protected override void OnDestroyed()
        {
            DefaultSourceEditorOptions.Instance.ColorScheme = schemeName;

            if (styleStore != null)
            {
                styleStore.Dispose();
                styleStore = null;
            }

            MonoDevelop.Ide.Gui.Styles.Changed -= HandleSkinChanged;
            base.OnDestroyed();
        }
Beispiel #19
0
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     combobox1.Changed  -= OnPositionComboChanged;
     combobox1.Focused  -= OnTitleTextBoxEnter;
     listToggle.Toggled -= OnItemChecked;
     comboModel.Dispose();
     comboRender.Destroy();
     listModel.Dispose();
     listRender.Destroy();
     listToggle.Destroy();
     mainWidget.Destroyed -= _mainWidget_Destroyed;
     owner = null;
 }
Beispiel #20
0
 protected override void OnDestroyed()
 {
     base.OnDestroyed();
     limitationWidget.Dispose();
     // All this crap is needed for the GC to collect this widget and destroy it
     store.Dispose();
     filter.Dispose();
     sort.Dispose();
     iconview.Destroy();
     treeview.Destroy();
     checkCell.Destroy();
     Disposed = true;
 }
Beispiel #21
0
        private void _mainWidget_Destroyed(object sender, EventArgs e)
        {
            textEditor.Document.LineChanged   -= OnTextHasChanged;
            textEditor.TextArea.FocusInEvent  -= OnTextBoxEnter;
            textEditor.TextArea.FocusOutEvent -= OnTextBoxLeave;
            _mainWidget.Destroyed             -= _mainWidget_Destroyed;
            textEditor.TextArea.KeyPressEvent -= OnKeyPress;
            CompletionForm.FocusOutEvent      -= OnLeaveCompletion;
            CompletionView.ButtonPressEvent   -= OnContextListMouseDoubleClick;
            CompletionView.KeyReleaseEvent    -= CompletionView_KeyReleaseEvent;
            if (CompletionForm.IsRealized)
            {
                CompletionForm.Destroy();
            }
            // It's good practice to disconnect all event handlers, as it makes memory leaks
            // less likely. However, we may not "own" the event handlers, so how do we
            // know what to disconnect?
            // We can do this via reflection. Here's how it currently can be done in Gtk#.
            // Windows.Forms would do it differently.
            // This may break if Gtk# changes the way they implement event handlers.
            foreach (Widget w in Popup)
            {
                if (w is MenuItem)
                {
                    PropertyInfo pi = w.GetType().GetProperty("AfterSignals", BindingFlags.NonPublic | BindingFlags.Instance);
                    if (pi != null)
                    {
                        System.Collections.Hashtable handlers = (System.Collections.Hashtable)pi.GetValue(w);
                        if (handlers != null && handlers.ContainsKey("activate"))
                        {
                            EventHandler handler = (EventHandler)handlers["activate"];
                            (w as MenuItem).Activated -= handler;
                        }
                    }
                }
            }

            Popup.Destroy();
            accel.Dispose();
            completionModel.Dispose();
            functionPixbuf.Dispose();
            propertyPixbuf.Dispose();
            CompletionView.Dispose();
            CompletionForm.Destroy();
            CompletionForm = null;
            textEditor.Destroy();
            textEditor = null;
            _findForm.Destroy();
            _owner = null;
        }
Beispiel #22
0
        /// <summary>
        /// Do cleanup work.
        /// </summary>
        public void Detach()
        {
            exportButton.Clicked        -= OnExportToCsv;
            importButton.Clicked        -= OnImportCsv;
            disableButton.Clicked       -= DisableSims;
            enableButton.Clicked        -= EnableSims;
            changeMaxSimsButton.Clicked -= SetMaxSims;
            run.ButtonPressEvent        -= OnRunSim;

            store.Dispose();
            contextMenu.Dispose();
            MainWidget.Destroy();
            _owner = null;
        }
Beispiel #23
0
 protected override void OnDestroyed()
 {
     base.OnDestroyed();
     if (optionsStore != null)
     {
         optionsStore.Dispose();
         optionsStore = null;
     }
     if (resultStore != null)
     {
         resultStore.Dispose();
         resultStore = null;
     }
 }
Beispiel #24
0
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     entry1.Changed       -= OnTextBox1TextChanged;
     entry2.Changed       -= OnTextBox2TextChanged;
     radiobutton1.Toggled -= OnRadioButton1CheckedChanged;
     spinbutton1.Changed  -= OnNumericUpDown1ValueChanged;
     combobox1.Changed    -= OnComboBox1SelectedValueChanged;
     comboModel.Dispose();
     comboRender.Destroy();
     graphView1.MainWidget.Destroy();
     graphView1             = null;
     _mainWidget.Destroyed -= _mainWidget_Destroyed;
     _owner = null;
 }
Beispiel #25
0
 public override void Dispose()
 {
     if (widget != null)
     {
         widget.Destroy();
         widget = null;
     }
     if (changedpathstore != null)
     {
         changedpathstore.Dispose();
         changedpathstore = null;
     }
     base.Dispose();
 }
Beispiel #26
0
 /// <summary>
 /// Cleanup the events
 /// </summary>
 /// <param name="sender">The sending object</param>
 /// <param name="e">The event arguments</param>
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     try
     {
         combobox1.Changed -= OnSelectionChanged;
         comboModel.Dispose();
         comboRender.Dispose();
         mainWidget.Destroyed -= _mainWidget_Destroyed;
         owner = null;
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
Beispiel #27
0
 public override void Destroy()
 {
     _store?.Dispose();
     _store           = null;
     _root            = null;
     _refreshButton   = null;
     _refreshLabel    = null;
     _headerContainer = null;
     _header          = null;
     _list            = null;
     _footerContainer = null;
     _footer          = null;
     _viewPort        = null;
     _refreshHeader   = null;
     base.Destroy();
 }
Beispiel #28
0
/*		void FileSelectionChanged (object sender, EventArgs e)
 *              {
 *                      Revision rev = SelectedRevision;
 *                      if (rev == null) {
 *                              diffWidget.ComparisonWidget.OriginalEditor.Text = "";
 *                              diffWidget.ComparisonWidget.DiffEditor.Text = "";
 *                              return;
 *                      }
 *                      TreeIter iter;
 *                      if (!treeviewFiles.Selection.GetSelected (out iter))
 *                              return;
 *                      string path = (string)changedpathstore.GetValue (iter, colPath);
 *                      ThreadPool.QueueUserWorkItem (delegate {
 *                              string text = info.Repository.GetTextAtRevision (path, rev);
 *                              string prevRevision = text; // info.Repository.GetTextAtRevision (path, rev.GetPrevious ());
 *
 *                              Application.Invoke (delegate {
 *                                      diffWidget.ComparisonWidget.MimeType = DesktopService.GetMimeTypeForUri (path);
 *                                      diffWidget.ComparisonWidget.OriginalEditor.Text = prevRevision;
 *                                      diffWidget.ComparisonWidget.DiffEditor.Text = text;
 *                                      diffWidget.ComparisonWidget.CreateDiff ();
 *                              });
 *                      });
 *              }*/

        protected override void OnDestroyed()
        {
            revertButton.Clicked   -= RevertRevisionClicked;
            revertToButton.Clicked -= RevertToRevisionClicked;
            refreshButton.Clicked  -= RefreshClicked;

            logstore.Dispose();
            changedpathstore.Dispose();

            diffRenderer.Dispose();
            messageRenderer.Dispose();
            textRenderer.Dispose();
            treeviewFiles.Dispose();

            base.OnDestroyed();
        }
        protected override void OnDestroyed()
        {
            if (cellRenderer != null)
            {
                cellRenderer.Destroy();
                cellRenderer = null;
            }

            if (data != null)
            {
                data.Dispose();
                data = null;
            }

            base.OnDestroyed();
        }
Beispiel #30
0
 private void _mainWidget_Destroyed(object sender, EventArgs e)
 {
     try
     {
         chkLegendInsideGraph.Toggled -= OnToggleLegendInsideGraph;
         listToggle.Toggled           -= OnItemChecked;
         listModel.Dispose();
         listRender.Dispose();
         listToggle.Dispose();
         mainWidget.Destroyed -= _mainWidget_Destroyed;
         owner = null;
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }