public CardWindow() { _emptyImage = new Bitmap(1, 1); using (var gr = Graphics.FromImage(_emptyImage)) gr.Clear(Color.FromKnownColor(KnownColor.Transparent)); InitializeComponent(); AutoScaleMode = AutoScaleMode.Dpi; UniversalDragAndDrop.SetupDragAndDrop(listView, SimpleDropSink_Dropped, SimpleDropSink_CanDrop, (sender, args) => RefreshList()); SetupImageLists(); olvColumnName.AspectGetter = rowObject => (rowObject as Card)?.Name; olvColumnFilename.AspectGetter = rowObject => (rowObject as Card)?.Location.Name; olvColumnModDate.AspectGetter = rowObject => (rowObject as Card)?.Location.LastWriteTime; olvColumnSex.AspectGetter = rowObject => (rowObject as Card)?.Sex; olvColumnPersonality.AspectGetter = rowObject => (rowObject as Card)?.PersonalityName; olvColumnExtended.AspectGetter = rowObject => (rowObject as Card)?.Extended?.Count.ToString() ?? "-"; Details(this, EventArgs.Empty); ((OLVColumn)listView.Columns[listView.Columns.Count - 1]).FillsFreeSpace = true; _typedListView = new TypedObjectListView <Card>(listView); listView.CacheVirtualItems += ListView_CacheVirtualItems; listView.EmptyListMsgFont = new Font(Font.FontFamily, 24); listView.EmptyListMsg = "No cards were found"; ListTools.SetUpSearchBox(listView, toolStripTextBoxSearch); }
public CardWindow() { _emptyImage = new Bitmap(1, 1); using (var gr = Graphics.FromImage(_emptyImage)) gr.Clear(Color.FromKnownColor(KnownColor.Transparent)); InitializeComponent(); AutoScaleMode = AutoScaleMode.Dpi; UniversalDragAndDrop.SetupDragAndDrop(listView, SimpleDropSink_Dropped, SimpleDropSink_CanDrop, (sender, args) => RefreshCurrentFolder()); SetupImageLists(); olvColumnName.AspectGetter = rowObject => (rowObject as Card)?.Name; olvColumnFilename.AspectGetter = rowObject => (rowObject as Card)?.Location.Name; olvColumnModDate.AspectGetter = rowObject => (rowObject as Card)?.Location.LastWriteTime; olvColumnSex.AspectGetter = rowObject => (rowObject as Card)?.Parameter.sex == 0 ? "Male" : "Female"; olvColumnPersonality.AspectGetter = rowObject => Utility.GetPersonalityName((rowObject as Card)?.Parameter.personality ?? -1); olvColumnExtended.AspectGetter = rowObject => (rowObject as Card)?.Extended?.Count.ToString() ?? "-"; Details(this, EventArgs.Empty); ((OLVColumn)listView.Columns[listView.Columns.Count - 1]).FillsFreeSpace = true; _typedListView = new TypedObjectListView <Card>(listView); listView.CacheVirtualItems += ListView_CacheVirtualItems; }