public EditViewUserControl(WindowState state) { InitializeComponent(); State = state; source = new EditViewDataSource(state); State.BindFile(GotFile); State.BindFrontCard(GotCard); cardIndexListBox.DisplayMember = "Index"; cardIndexListBox.DataSource = listBindingSource; cardIndexListBox.DataBindings.Add(new Binding("SelectedIndex", source, "SelectedIndex", false, DataSourceUpdateMode.OnPropertyChanged)); }
public FileViewUserControl(WindowState state) { InitializeComponent(); State = state; fileUpdatePairs = new Dictionary <string, Card>(); State.BindFile(GotFile); State.BindFrontCard(GotCard); panelFilePreview.Resize += PanelFilePreview_Resize; iconImageList.Images.Add(SystemIcons.WinLogo); Disposed += OnDispose; textBoxIndex.Font = new Font(FontFamily.GenericMonospace, textBoxIndex.Font.Size); fileUpdateDialog.UpdateRequest += FileUpdateDialog_UpdateRequest; fileSystemWatcher.EnableRaisingEvents = false; fileSystemWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size; listViewFile.Resize += (s, e) => RecenterIcon(); }