public ModInfo(L4D2MM manager, string key, ModState state, ModSource source, L4D2Mod mod) { Manager = manager; Key = key; ModState = state; Source = source; Mod = mod; IsHaveCollision = false; base.CollisionCountChangeHandler = (count) => { IsHaveCollision = count > 0; }; RefreshResources(); }
public void Update(L4D2MM manager) { AllViewItems.Clear(); foreach (var v in manager.Mods) { AllViewItems.Add(new ViewItem(v.Value)); } MainComboBox.Dispatcher.Invoke(new Action(() => RefreshMainComboListItem(MainComboBox.SelectedItem as ComboItem))); SubComboBox.Dispatcher.Invoke(new Action(() => RefreshSubComboListItem(SubComboBox.SelectedItem as ComboItem))); SearchBox.Dispatcher.Invoke(new Action(() => UpdateSearch())); ListView.Dispatcher.Invoke(new Action(() => ListView.Items.Refresh())); }
public MainWindow() { InitializeComponent(); //UI this.FontSize = Configure.View.FontSize; ctlMenu.FontSize = Configure.View.FontSize; this.SetSize(Configure.View.WindowSize); foreach (var col in CustomInformation.Instance.ViewLists) { if (CheckModInfoReflection(col.Reflection)) { var textBlockFactory = new FrameworkElementFactory(typeof(TextBlock)); textBlockFactory.SetValue(TextElement.ForegroundProperty, Brushes.Black); textBlockFactory.SetBinding(TextBlock.TextProperty, new System.Windows.Data.Binding("Mod") { Converter = new StringDisplayConverter(), ConverterParameter = "Mod." + col.Reflection }); textBlockFactory.SetValue(TextBlock.TextAlignmentProperty, col.TextAlignment); GridViewColumn column = new GridViewColumn(); column.Header = col.TryTranslate ? StringAdapter.GetResource(col.Header) : col.Header; column.Width = col.Width; column.CellTemplate = new DataTemplate { VisualTree = textBlockFactory }; ctlGridView.Columns.Add(column); SortReflectionMap.Add(column, col.Reflection); } } //new m_manager = new L4D2MM(); m_categorySelected = new CategorySelecter(ctlCategoryList, ctlSubcategoryList, ctlTextSearch, ctlListView); //initialize property ctlPrintText.AppendText(System.Reflection.Assembly.GetExecutingAssembly().GetName().Name + " [version " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version + ']'); ctlProgressBar.SetValue(ProgressBar.ValueProperty, 100.0); InitializeListViewMenu(); InitializeWindowMenu(); }