コード例 #1
0
        public DirectoryBrowser()
        {
            InitializeComponent();

            VisualStyleUtil.StyleTreeView(_treeView);

            _imageList.Assign(_treeView);

            _watcher.IncludeSubdirectories = true;
            _watcher.NotifyFilter          = NotifyFilters.CreationTime | NotifyFilters.DirectoryName | NotifyFilters.LastWrite;
            _watcher.SynchronizingObject   = this;
            _watcher.Changed += _watcher_Changed;
            _watcher.Created += _watcher_Changed;
            _watcher.Deleted += _watcher_Changed;
            _watcher.Renamed += _watcher_Renamed;

            _treeView.Nodes.Add(new TreeNode("Root"));

            var dragDropManager = new DragDropManager(this);

            dragDropManager.DragEnter += _dragDropManager_DragEnter;
            dragDropManager.DragLeave += _dragDropManager_DragLeave;
            dragDropManager.DragOver  += _dragDropManager_DragOver;
            dragDropManager.DragDrop  += _dragDropManager_DragDrop;

            Reload();
        }
コード例 #2
0
        public FileBrowser()
        {
            InitializeComponent();

            Enabled = false;

            VisualStyleUtil.StyleListView(_listView);

            _imageList.Assign(_listView);

            _watcher.IncludeSubdirectories = false;
            _watcher.NotifyFilter          = NotifyFilters.Attributes | NotifyFilters.CreationTime | NotifyFilters.FileName | NotifyFilters.LastWrite;
            _watcher.SynchronizingObject   = this;
            _watcher.Changed += _watcher_Changed;
            _watcher.Created += _watcher_Changed;
            _watcher.Deleted += _watcher_Changed;
            _watcher.Renamed += _watcher_Changed;

            var dragDropManager = new DragDropManager(this);

            dragDropManager.DragEnter += _dragDropManager_DragEnter;
            dragDropManager.DragDrop  += _dragDropManager_DragDrop;

            Reload();
        }
コード例 #3
0
        public ValidationErrorsForm(ApiRowErrorsCollection errors)
        {
            if (errors == null)
            {
                throw new ArgumentNullException(nameof(errors));
            }

            InitializeComponent();

            VisualStyleUtil.StyleListView(_listView);

            foreach (var rowErrors in errors)
            {
                foreach (var error in rowErrors.Errors)
                {
                    _listView.Items.Add(new ListViewItem
                    {
                        Text     = (rowErrors.Row + 1).ToString(),
                        SubItems =
                        {
                            error.Field,
                            error.Error
                        }
                    });
                }
            }

            _listView.AutoResizeColumns(
                errors.Count > 0 ? ColumnHeaderAutoResizeStyle.ColumnContent : ColumnHeaderAutoResizeStyle.HeaderSize
                );
        }
コード例 #4
0
        public ReportForm(Api api, string directory, string fileName, ReportDefinition report)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            if (directory == null)
            {
                throw new ArgumentNullException(nameof(directory));
            }
            if (report == null)
            {
                throw new ArgumentNullException(nameof(report));
            }

            _api       = api;
            _directory = directory;
            _fileName  = fileName;
            _entity    = report.Entity;
            _filters   = report.Filters;

            InitializeComponent();

            if (fileName != null)
            {
                Text += " - " + fileName;
            }

            _gridManager = new ReportGridManager(_grid);

            foreach (ToolStripMenuItem menuItem in _aggregateMenuItem.DropDownItems)
            {
                menuItem.Tag = Enum.Parse(typeof(ReportFieldTransform), (string)menuItem.Tag);
            }

            VisualStyleUtil.StyleTreeView(_fields);

            BuildFields(_fields.Nodes, _entity);

            foreach (var field in report.Fields)
            {
                switch (field.Type)
                {
                case ReportFieldType.Column:
                    _columns.Items.Add(field);
                    break;

                case ReportFieldType.Row:
                    _rows.Items.Add(field);
                    break;

                case ReportFieldType.Value:
                    _values.Items.Add(field);
                    break;
                }
            }

            UpdateEnabled();
        }
コード例 #5
0
        public VariablesControl()
        {
            Font = SystemFonts.MessageBoxFont;

            InitializeComponent();

            VisualStyleUtil.StyleListView(_listView);
        }
コード例 #6
0
        public ExportDefinitionForm(Api api, string directory, string fileName, ExportDefinition export)
        {
            if (api == null)
            {
                throw new ArgumentNullException(nameof(api));
            }
            if (directory == null)
            {
                throw new ArgumentNullException(nameof(directory));
            }
            if (export == null)
            {
                throw new ArgumentNullException(nameof(export));
            }

            _api       = api;
            _directory = directory;
            _fileName  = fileName;
            _entity    = export.Entity;
            _filters   = export.Filters;

            InitializeComponent();

            if (fileName != null)
            {
                Text += " - " + fileName;
            }

            VisualStyleUtil.StyleListView(_availableFields);
            VisualStyleUtil.StyleListView(_reportFields);

            _entityGroup = new ListViewGroup(HumanText.GetEntityName(_entity));
            _reportFields.Groups.Add(_entityGroup);

            var selectPath = new Button
            {
                Image = NeutralResources.navigate_close
            };

            _path.RightButtons.Add(selectPath);

            selectPath.Click += selectPath_Click;

            foreach (var field in export.Fields)
            {
                AddReportField(field);
            }

            SetSelectedEntity(EntityMemberPath.Empty);

            UpdateEnabled();
        }
コード例 #7
0
        public ProjectControl(JavaScriptForm owner)
        {
            if (owner == null)
            {
                throw new ArgumentNullException(nameof(owner));
            }

            _owner = owner;
            _owner.ProjectChanged += _owner_ProjectChanged;

            Font = SystemFonts.MessageBoxFont;

            InitializeComponent();

            VisualStyleUtil.StyleTreeView(_treeView);
        }
コード例 #8
0
        private TreeView BuildPathSelectorTreeView()
        {
            var treeView = new EntityPathSelectorTreeView(_api, _entity)
            {
                Dock        = DockStyle.Fill,
                BorderStyle = BorderStyle.None,
                Font        = Font
            };

            VisualStyleUtil.StyleTreeView(treeView);

            treeView.LostFocus            += treeView_LostFocus;
            treeView.NodeMouseDoubleClick += treeView_NodeMouseDoubleClick;

            return(treeView);
        }