예제 #1
0
 protected void RaiseValueChanged(object sender, PTypeDataTag data)
 {
     if (ValueChanged != null)
     {
         ValueChanged(sender, data);
     }
 }
예제 #2
0
        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;
        }
예제 #3
0
 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;
 }
예제 #4
0
        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;
        }
예제 #5
0
        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;
        }
예제 #6
0
        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);
        }
예제 #7
0
 public SqfPropertyConverter(string key, PTypeDataTag tag) : base(key, tag)
 {
 }
예제 #8
0
 public abstract FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag);
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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;
 }
예제 #13
0
 public SqfPropertyConverter(string key, PTypeDataTag tag, List<Data> dataList)
     : base(key, tag)
 {
     this.DataList = dataList;
 }
예제 #14
0
파일: PType.cs 프로젝트: X39/ArmA-UI-Editor
 protected void RaiseValueChanged(object sender, PTypeDataTag data)
 {
     if (ValueChanged != null)
         ValueChanged(sender, data);
 }
예제 #15
0
파일: PType.cs 프로젝트: X39/ArmA-UI-Editor
 public abstract FrameworkElement GenerateUiElement(string Key, ArmA_UI_Editor.UI.Snaps.EditingSnap window, PTypeDataTag tag);
예제 #16
0
 public SqfPropertyConverter(string key, PTypeDataTag tag)
     : base(key, tag)
 {
 }
예제 #17
0
 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();
 }
예제 #18
0
 public SqfPropertyConverter(string key, PTypeDataTag tag, List <Data> dataList) : base(key, tag)
 {
     this.DataList = dataList;
 }