private Control AddChangesColumn(int lastRowPlusOne, int columnCount)
        {
            List <string> changesColumn = new List <string>()
            {
                "", "New"
            };

            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());

            newCommonValuesBox.AddToolTip("changes");
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            newCommonValuesBox.SetComboBox(changesColumn);
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }
        private Control AddGameFileColumn(int lastRowPlusOne, int columnCount, string headerKey, LocalizationFileObject gameLocalizationFile)
        {
            SortedSet <string> allCommonValuesSorted = gameLocalizationFile.HeaderKeyToCommonValuesMap.GetValueOrDefault(headerKey);
            List <string>      allCommonValues       = new List <string>(allCommonValuesSorted);

            if (allCommonValues == null)
            {
                allCommonValues = new List <string>();
            }
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
            newCommonValuesBox.AddToolTip(headerKey);
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            newCommonValuesBox.SetComboBox(allCommonValues);
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }
Пример #3
0
        private Control AddModKeysColumn(int lastRowPlusOne, int columnCount, List <XmlObjectsListWrapper> xmlWrappersForGameKeys)
        {
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                Tag        = lastRowPlusOne,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
            newCommonValuesBox.AddToolTip("key");
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            AddModAttributesFromWrappers(xmlWrappersForGameKeys, newCommonValuesBox);
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }
        private Control AddModKeysColumn(int lastRowPlusOne, int columnCount, XmlObjectsListWrapper selectedModItemsWrapper, XmlObjectsListWrapper selectedModBlocksWrapper)
        {
            topGrid.ColumnDefinitions.Add(new ColumnDefinition());
            ComboBox newCommonValuesBox = new ComboBox
            {
                FontSize   = 18,
                IsEditable = true,
                Background = BackgroundColorController.GetBackgroundColor()
            };

            newCommonValuesBox.Resources.Add(SystemColors.WindowBrushKey, BackgroundColorController.GetBackgroundColor());
            newCommonValuesBox.AddToolTip("key");
            newCommonValuesBox.DropDownClosed += NewCommonValuesBox_DropDownClosed;
            newCommonValuesBox.LostFocus      += NewCommonValuesBox_LostFocus;
            if (selectedModItemsWrapper != null)
            {
                Dictionary <string, List <string> > attributeDictinaryForItems = selectedModItemsWrapper.ObjectNameToAttributeValuesMap.GetValueOrDefault("item");
                if (attributeDictinaryForItems != null)
                {
                    List <string> commonAttributes = attributeDictinaryForItems.GetValueOrDefault("name");
                    commonAttributes.Insert(0, "");
                    newCommonValuesBox.SetComboBox(commonAttributes);
                }
            }
            if (selectedModBlocksWrapper != null)
            {
                Dictionary <string, List <string> > attributeDictinaryForBlocks = selectedModBlocksWrapper.ObjectNameToAttributeValuesMap.GetValueOrDefault("block");
                if (attributeDictinaryForBlocks != null)
                {
                    List <string> commonAttributes = attributeDictinaryForBlocks.GetValueOrDefault("name");
                    newCommonValuesBox.SetComboBox(commonAttributes);
                }
            }
            Grid.SetRow(newCommonValuesBox, lastRowPlusOne);
            Grid.SetColumn(newCommonValuesBox, columnCount);
            topGrid.Children.Add(newCommonValuesBox);
            return(newCommonValuesBox);
        }