コード例 #1
0
        private void LoadPropertiesToEdit(object obj)
        {
            AdvPropertyGrid1.SelectedObject = null;
            AdvPropertyGrid1.PropertySettings.Clear();
            if (obj is TextGroupInfo)
            {
                var piEncodingString = new PropertySettings(nameof(TextGroupInfo.EncodingString))
                {
                    DisplayName = "Encoding",
                    ValueEditor = new PropertyValueEditors.TextEncodingEditor(new[] { TextGroupInfo.ENCODING_STRING_M64, TextGroupInfo.ENCODING_STRING_ASCII })
                };
                AdvPropertyGrid1.PropertySettings.Add(piEncodingString);
                var piEncoding = new PropertySettings(nameof(TextTableGroupInfo.Encoding))
                {
                    Visible = false
                };
                AdvPropertyGrid1.PropertySettings.Add(piEncoding);
                if (obj is TextTableGroupInfo)
                {
                    var piData = new PropertySettings(nameof(TextTableGroupInfo.Data))
                    {
                        TypeConverter = new ExpandableObjectConverter()
                    };
                    AdvPropertyGrid1.PropertySettings.Add(piData);
                    var piDialogData = new PropertySettings(nameof(TextTableGroupInfo.DialogData))
                    {
                        TypeConverter = new ExpandableObjectConverter()
                    };
                    AdvPropertyGrid1.PropertySettings.Add(piDialogData);
                    var piSegmented = new PropertySettings(nameof(TextTableGroupInfo.Segmented))
                    {
                        TypeConverter = new ExpandableObjectConverter()
                    };
                    AdvPropertyGrid1.PropertySettings.Add(piSegmented);
                    var piTableType = new PropertySettings(nameof(TextTableGroupInfo.TableType))
                    {
                        Visible = false
                    };
                    AdvPropertyGrid1.PropertySettings.Add(piTableType);
                }
                else if (obj is TextArrayGroupInfo)
                {
                    var piTexts = new PropertySettings(nameof(TextArrayGroupInfo.Texts))
                    {
                        Visible = false
                    };
                    AdvPropertyGrid1.PropertySettings.Add(piTexts);
                }

                LoadTextArrayItems((TextGroupInfo)obj);
            }

            AdvPropertyGrid1.SelectedObject = obj;
            AdvPropertyGrid1.ExpandAllGridItems();
        }
コード例 #2
0
        private void ListViewEx_LM_ScrollTexList_SelectedIndexChanged(object sender, EventArgs e)
        {
            var objs = new List <ScrollTexPropertyClass>();

            foreach (ListViewItem item in ListViewEx_LM_ScrollTexList.SelectedItems)
            {
                objs.Add((ScrollTexPropertyClass)item.Tag);
            }
            AdvPropertyGrid1.SuspendLayout();
            AdvPropertyGrid1.SelectedObjects = objs.ToArray();
            AdvPropertyGrid1.ResumeLayout();
        }
コード例 #3
0
 private void AdvPropertyGrid1_PropertyValueChanged(object sender, PropertyChangedEventArgs e)
 {
     UpdateAllListViewItems();
     AdvPropertyGrid1.RefreshPropertyValues();
     ScrollTexChanged?.Invoke(this, new EventArgs());
 }