public void UpdateItem()
        {
            _canFireChangedEvent = false;
            if (!_populated)
            {
                PopulateDropdown();
            }

            if (!IsCurrentItem)
            {
                _horizontalOffsetField.text = HorizontalOffset.ToString(CultureInfo.InvariantCulture);
                _verticalOffsetField.text   = VerticalOffset.ToString(CultureInfo.InvariantCulture);
                _reverseCheckbox.isChecked  = IsReversed;
                _dropDown.selectedIndex     = Singleton <ParallelRoadTool> .instance.AvailableRoadTypes
                                              .FindIndex(ni => ni != null && ni.name == NetInfo.name);
            }
            else
            {
                _dropDown.selectedIndex = 0;
                _deleteButton.isVisible =
                    _horizontalOffsetField.isVisible   =
                        _verticalOffsetField.isVisible =
                            _reverseCheckbox.isVisible =
                                _dropDown.isVisible    = false;
                _label.isVisible = _addButton.isVisible = true;
                _label.text      = Locale.Get($"{Configuration.ResourcePrefix}TEXTS", "SameAsSelectedLabel");
            }

            _canFireChangedEvent = true;
        }
예제 #2
0
        public void WriteXml(XmlWriter writer)
        {
            logger.Trace("Writing xml");
            var header = ((TabItem)Parent).Header as TabHeader;

            writer.WriteAttributeString("Title", (string)header.NameLabel.Content);
            writer.WriteAttributeString("ScrollH", HorizontalOffset.ToString());
            writer.WriteAttributeString("ScrollV", VerticalOffset.ToString());
            writer.WriteStartElement("WorkflowCanvas");
            ChildCanvas.WriteXml(writer);
            writer.WriteEndElement();
        }