KeepAlive() private method

private KeepAlive ( Object obj ) : void
obj Object
return void
Exemplo n.º 1
0
        private void ConfigureDlg()
        {
            var filterFrom = new RouteListsFilter(UoW);

            filterFrom.SetAndRefilterAtOnce(
                f => f.OnlyStatuses = new[] {
                RouteListStatus.EnRoute,
                RouteListStatus.OnClosing
            },
                f => f.SetFilterDates(
                    DateTime.Today.AddDays(-3),
                    DateTime.Today.AddDays(1)
                    )
                );
            var vmFrom = new RouteListsVM(filterFrom);

            GC.KeepAlive(vmFrom);
            yentryreferenceRLFrom.RepresentationModel = vmFrom;
            yentryreferenceRLFrom.JournalButtons      = QS.Project.Dialogs.GtkUI.Buttons.Add | QS.Project.Dialogs.GtkUI.Buttons.Edit;
            yentryreferenceRLFrom.CanEditReference    = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_delete");

            var filterTo = new RouteListsFilter(UoW);

            filterTo.SetAndRefilterAtOnce(
                f => f.OnlyStatuses = new[] {
                RouteListStatus.New,
                RouteListStatus.InLoading,
                RouteListStatus.EnRoute,
                RouteListStatus.OnClosing
            },
                f => f.SetFilterDates(
                    DateTime.Today.AddDays(-3),
                    DateTime.Today.AddDays(1)
                    )
                );
            var vmTo = new RouteListsVM(filterTo);

            yentryreferenceRLTo.RepresentationModel = vmTo;
            yentryreferenceRLTo.JournalButtons      = QS.Project.Dialogs.GtkUI.Buttons.Add | QS.Project.Dialogs.GtkUI.Buttons.Edit;
            yentryreferenceRLTo.CanEditReference    = ServicesConfig.CommonServices.CurrentPermissionService.ValidatePresetPermission("can_delete");

            yentryreferenceRLFrom.Changed += YentryreferenceRLFrom_Changed;
            yentryreferenceRLTo.Changed   += YentryreferenceRLTo_Changed;

            //Для каждой TreeView нужен свой экземпляр ColumnsConfig
            ytreeviewRLFrom.ColumnsConfig = GetColumnsConfig(false);
            ytreeviewRLTo.ColumnsConfig   = GetColumnsConfig(true);

            ytreeviewRLFrom.Selection.Mode = Gtk.SelectionMode.Multiple;
            ytreeviewRLTo.Selection.Mode   = Gtk.SelectionMode.Multiple;

            ytreeviewRLFrom.Selection.Changed += YtreeviewRLFrom_OnSelectionChanged;
            ytreeviewRLTo.Selection.Changed   += YtreeviewRLTo_OnSelectionChanged;

            ConfigureTreeViewsDriverBalance();

            ybtnTransferTerminal.Clicked += (sender, e) => TransferTerminal.Execute();
            ybtnRevertTerminal.Clicked   += (sender, e) => RevertTerminal.Execute();
        }