Exemple #1
0
        public ExportDocuments(Type sourceObjectType, string fileName)
            : base(null, BusinessDomain.DocumentExporters)
        {
            defaultFileName = fileName;

            exchangersModel = new BindingListModel <IDataExchanger> (exchangers
                                                                     .Where(exporter => exporter.SupportsType(sourceObjectType) && exporter.IsAvailable), false);
            exchangersModel.Sort("ExchangeType", SortDirection.Ascending);
            grid.Model = exchangersModel;

            for (int i = 0; i < exchangersModel.Count; i++)
            {
                if (exchangersModel [i].GetType().Name != BusinessDomain.AppConfiguration.LastDocsExporter)
                {
                    continue;
                }

                defaultSelectedRow = i;
                break;
            }
        }
        private void LoadExchangers()
        {
            IEnumerable <IDataExchanger> exchangerNames = exchangers
                                                          .Where(exporter => exporter.SupportsType(typeof(T)) && exporter.IsAvailable);

            exchangersModel = new BindingListModel <IDataExchanger> (exchangerNames, false);
            exchangersModel.Sort("ExchangeType", SortDirection.Ascending);

            grid = new ListView();

            ScrolledWindow sWindow = new ScrolledWindow {
                HscrollbarPolicy = PolicyType.Automatic, VscrollbarPolicy = PolicyType.Automatic
            };

            sWindow.Add(grid);

            algGrid.Add(sWindow);
            sWindow.Show();
            grid.Show();

            ColumnController cc = new ColumnController();

            Column col = new Column(IsExport ? Translator.GetString("Export Type") : Translator.GetString("Import Type"), "ExchangeType", 0.2, "ExchangeType")
            {
                MinWidth = 70, ListCell = { IsEditable = false }
            };

            cc.Add(col);

            grid.ColumnController    = cc;
            grid.Model               = exchangersModel;
            grid.AllowMultipleSelect = false;
            grid.CellsFucusable      = true;
            grid.RulesHint           = true;
            grid.SortColumnsHint     = true;
            grid.Realized           += grid_Realized;
            grid.Selection.Changed  += grid_SelectionChanged;
        }
Exemple #3
0
 private void InitializeGrid()
 {
     model              = new BindingListModel <MoneyContainer> (list);
     model.ListChanged += model_ListChanged;
     model.Sort("Amount", SortDirection.Ascending);
 }