Exemplo n.º 1
0
        void CarParentEditor_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
            if (!IsResultOk) return;

            var current = CarsListView.CurrentItem as CarObject;
            if (current != null) {
                if (Car.Children.Any()) {
                    if (ShowMessage(ControlsStrings.CarParent_ChildrenWillBeMoved, ToolsStrings.Common_Warning, MessageBoxButton.OKCancel) !=
                            MessageBoxResult.OK) return;
                }

                if (!File.Exists(Car.UpgradeIcon)) {
                    var dialog = new UpgradeIconEditor(Car);
                    dialog.ShowDialog();
                    if (!dialog.IsResultOk) return;
                }

                foreach (var child in Car.Children) {
                    child.ParentId = current.Id;
                }

                Car.ParentId = current.Id;
            } else {
                Car.ParentId = null;
            }
        }
        public UpgradeIconEditor_Editor()
        {
            var mainDialog = UpgradeIconEditor.Instance;

            if (mainDialog != null)
            {
                Car  = mainDialog.Car;
                _key = @"__upgradeiconeditor_" + Car.Id;
            }

            DataContext = this;
            InitializeComponent();

            NewIconLabel.Text = _key != null?ValuesStorage.Get(_key, UpgradeIconEditor.TryToGuessLabel(Car?.DisplayName)) ?? "S1" : @"?";

            NewIconLabel_UpdateFontSize();

            FocusLabel();
        }
Exemplo n.º 3
0
        void CarParentEditor_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!IsResultOk)
            {
                return;
            }

            var current = CarsListView.CurrentItem as CarObject;

            if (current != null)
            {
                if (Car.Children.Any())
                {
                    if (ShowMessage(ControlsStrings.CarParent_ChildrenWillBeMoved, ToolsStrings.Common_Warning, MessageBoxButton.OKCancel) !=
                        MessageBoxResult.OK)
                    {
                        return;
                    }
                }

                if (!File.Exists(Car.UpgradeIcon))
                {
                    var dialog = new UpgradeIconEditor(Car);
                    dialog.ShowDialog();
                    if (!dialog.IsResultOk)
                    {
                        return;
                    }
                }

                foreach (var child in Car.Children)
                {
                    child.ParentId = current.Id;
                }

                Car.ParentId = current.Id;
            }
            else
            {
                Car.ParentId = null;
            }
        }