protected void RaiseValueChanged(object sender, PTypeDataTag data) { if (ValueChanged != null) { ValueChanged(sender, data); } }
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var cb = new ComboBox(); cb.Tag = tag; cb.DisplayMemberPath = "Name"; cb.SelectedValuePath = "Value"; cb.ItemsSource = this.Items; var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { binding.Converter = new SqfPropertyConverter(Key, tag, this.Items); binding.ConverterParameter = tag; } else { binding.Converter = new NormalPropertyConverter(Key, this.Items); } cb.SetBinding(ComboBox.SelectedIndexProperty, binding); cb.SourceUpdated += Cb_SourceUpdated; cb.ToolTip = App.Current.Resources["STR_CODE_Property_ValueList"] as String; return cb; }
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var tb = new TextBox(); tb.Tag = tag; var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { binding.Converter = new SqfPropertyConverter(Key, tag); } else { binding.Converter = new NormalPropertyConverter(Key); } binding.ConverterParameter = new ConverterPropertyData { Conversion = this.Conversion.ToUpper(), Window = window }; tb.SetBinding(TextBox.TextProperty, binding); tb.SourceUpdated += Tb_SourceUpdated; tb.PreviewTextInput += Tb_PreviewTextInput; tb.ToolTip = App.Current.Resources["STR_CODE_Property_Number"] as String; return tb; }
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var tb = new TextBox(); tb.Tag = tag; StringBuilder builder = new StringBuilder(); var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { throw new NotImplementedException(); } else { binding.Converter = new NormalPropertyConverter(Key); } binding.ConverterParameter = this.Count; tb.SetBinding(TextBox.TextProperty, binding); tb.PreviewKeyDown += Tb_PreviewKeyDown; tb.SourceUpdated += Tb_SourceUpdated; switch (Type.ToUpper()) { case "NUMBER": tb.ToolTip = string.Format(System.Globalization.CultureInfo.InvariantCulture, App.Current.Resources["STR_CODE_Property_Array"] as String, App.Current.Resources["STR_CODE_Property_Number"] as String, this.Count); break; case "STRING": tb.ToolTip = string.Format(System.Globalization.CultureInfo.InvariantCulture, App.Current.Resources["STR_CODE_Property_Array"] as String, App.Current.Resources["STR_CODE_Property_String"] as String, this.Count); break; case "BOOLEAN": tb.ToolTip = string.Format(System.Globalization.CultureInfo.InvariantCulture, App.Current.Resources["STR_CODE_Property_Array"] as String, App.Current.Resources["STR_CODE_Property_Boolean"] as String, this.Count); break; default: throw new Exception(); } return tb; }
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var tb = new TextBox(); tb.Tag = tag; var curVal = AddInManager.Instance.MainFile.GetKey(Key, SQF.ClassParser.ConfigField.KeyMode.EmptyReferenceOnNotFound); var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { binding.Converter = new SqfPropertyConverter(Key, tag); } else { binding.Converter = new NormalPropertyConverter(Key); } tb.SetBinding(TextBox.TextProperty, binding); tb.SourceUpdated += Tb_SourceUpdated; tb.PreviewKeyDown += Tb_PreviewKeyDown; tb.ToolTip = App.Current.Resources["STR_CODE_Property_String"] as String; return tb; }
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var tb = new TextBox(); tb.Tag = tag; var curVal = AddInManager.Instance.MainFile.GetKey(Key, SQF.ClassParser.ConfigField.KeyMode.EmptyReferenceOnNotFound); var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { binding.Converter = new SqfPropertyConverter(Key, tag); } else { binding.Converter = new NormalPropertyConverter(Key); } tb.SetBinding(TextBox.TextProperty, binding); tb.SourceUpdated += Tb_SourceUpdated; tb.PreviewKeyDown += Tb_PreviewKeyDown; tb.ToolTip = App.Current.Resources["STR_CODE_Property_String"] as String; return(tb); }
public SqfPropertyConverter(string key, PTypeDataTag tag) : base(key, tag) { }
public abstract FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag);
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var tb = new TextBox(); tb.Tag = tag; StringBuilder builder = new StringBuilder(); var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { throw new NotImplementedException(); } else { binding.Converter = new NormalPropertyConverter(Key); } binding.ConverterParameter = this.Count; tb.SetBinding(TextBox.TextProperty, binding); tb.PreviewKeyDown += Tb_PreviewKeyDown; tb.SourceUpdated += Tb_SourceUpdated; switch (Type.ToUpper()) { case "NUMBER": tb.ToolTip = string.Format(System.Globalization.CultureInfo.InvariantCulture, App.Current.Resources["STR_CODE_Property_Array"] as String, App.Current.Resources["STR_CODE_Property_Number"] as String, this.Count); break; case "STRING": tb.ToolTip = string.Format(System.Globalization.CultureInfo.InvariantCulture, App.Current.Resources["STR_CODE_Property_Array"] as String, App.Current.Resources["STR_CODE_Property_String"] as String, this.Count); break; case "BOOLEAN": tb.ToolTip = string.Format(System.Globalization.CultureInfo.InvariantCulture, App.Current.Resources["STR_CODE_Property_Array"] as String, App.Current.Resources["STR_CODE_Property_Boolean"] as String, this.Count); break; default: throw new Exception(); } return(tb); }
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var tb = new TextBox(); tb.Tag = tag; var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { binding.Converter = new SqfPropertyConverter(Key, tag); } else { binding.Converter = new NormalPropertyConverter(Key); } binding.ConverterParameter = new ConverterPropertyData { Conversion = this.Conversion.ToUpper(), Window = window }; tb.SetBinding(TextBox.TextProperty, binding); tb.SourceUpdated += Tb_SourceUpdated; tb.PreviewTextInput += Tb_PreviewTextInput; tb.ToolTip = App.Current.Resources["STR_CODE_Property_Number"] as String; return(tb); }
public override FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag) { var cb = new ComboBox(); cb.Tag = tag; cb.Items.Add("false"); cb.Items.Add("true"); var binding = new Binding("Value"); binding.Source = AddInManager.Instance.MainFile; binding.NotifyOnSourceUpdated = true; if (tag.PropertyObject is SqfProperty) { binding.Converter = new SqfPropertyConverter(Key, tag); } else { binding.Converter = new NormalPropertyConverter(Key); } cb.SetBinding(ComboBox.SelectedIndexProperty, binding); cb.SourceUpdated += Cb_SourceUpdated; cb.ToolTip = App.Current.Resources["STR_CODE_Property_Boolean"] as String; return(cb); }
public SqfConfigFieldKeyConverter(string key, PTypeDataTag tag) : base(key) { this.Tag = tag; }
public SqfPropertyConverter(string key, PTypeDataTag tag, List<Data> dataList) : base(key, tag) { this.DataList = dataList; }
protected void RaiseValueChanged(object sender, PTypeDataTag data) { if (ValueChanged != null) ValueChanged(sender, data); }
public abstract FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag);
public SqfPropertyConverter(string key, PTypeDataTag tag) : base(key, tag) { }
private void PType_ValueChanged(object sender, PTypeDataTag e) { this.CurrentEditingSnap.UpdateConfigKey(string.Concat(e.Key, e.Path)); (ArmA_UI_Editor.UI.MainWindow.TryGet()).SetStatusbarText("", false); //Tmp "fix" for outdated bindings //ToDo: Update AddIn Bindings this.CurrentEditingSnap.RegenerateDisplay(); }
public SqfPropertyConverter(string key, PTypeDataTag tag, List <Data> dataList) : base(key, tag) { this.DataList = dataList; }