<commit_before>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using CslaGenerator.Util;

namespace CslaGenerator.Design
{
    /// <summary>
    /// Generate Inline Query Collection Editor
    /// </summary>
    public class GenerateInlineQueryCollectionEditor : UITypeEditor, IDisposable
    {
        private IWindowsFormsEditorService _editorService;
        private ListBox _lstCrudOperations;

        public GenerateInlineQueryCollectionEditor()
        {
            _lstCrudOperations = new ListBox();
            _lstCrudOperations.DoubleClick += LstCrudOperationsDoubleClick;
            _lstCrudOperations.DisplayMember = "key";
            _lstCrudOperations.ValueMember = "value";
            _lstCrudOperations.SelectionMode = SelectionMode.MultiSimple;
        }

        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            if (_editorService != null)
            {
                if (context.Instance != null)
                {
                    // CR modifying to accomodate PropertyBag
                    Type instanceType = null;
                    object objinfo = null;
                    TypeHelper.GetContextInstanceObject(context, ref objinfo, ref instanceType);
                    var propInfo = instanceType.GetProperty("GenerateInlineQueries");
                    var propColl = (List<string>)propInfo.GetValue(objinfo, null);

                    _lstCrudOperations.Items.Clear();
                    _lstCrudOperations.Items.Add("(None)");
                    _lstCrudOperations.Items.Add("Create");
                    _lstCrudOperations.Items.Add("Read");
                    _lstCrudOperations.Items.Add("Update");
                    _lstCrudOperations.Items.Add("Delete");

                    foreach (var item in propColl)
                    {
                        _lstCrudOperations.SelectedItems.Add(item);
                    }
<commit_msg>Filter "Generate Inline Queries" options according to object stereotype. Work Item #1799<commit_after>using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
using CslaGenerator.CodeGen;
using CslaGenerator.Metadata;
using CslaGenerator.Util;

namespace CslaGenerator.Design
{
    /// <summary>
    /// Generate Inline Query Collection Editor
    /// </summary>
    public class GenerateInlineQueryCollectionEditor : UITypeEditor, IDisposable
    {
        private IWindowsFormsEditorService _editorService;
        private ListBox _lstCrudOperations;

        public GenerateInlineQueryCollectionEditor()
        {
            _lstCrudOperations = new ListBox();
            _lstCrudOperations.DoubleClick += LstCrudOperationsDoubleClick;
            _lstCrudOperations.DisplayMember = "key";
            _lstCrudOperations.ValueMember = "value";
            _lstCrudOperations.SelectionMode = SelectionMode.MultiSimple;
        }

        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            _editorService = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
            if (_editorService != null)
            {
                if (context.Instance != null)
                {
                    // CR modifying to accomodate PropertyBag
                    Type instanceType = null;
                    object objinfo = null;
                    TypeHelper.GetContextInstanceObject(context, ref objinfo, ref instanceType);
                    var propInfo = instanceType.GetProperty("GenerateInlineQueries");
                    var propColl = (List<string>)propInfo.GetValue(objinfo, null);

                    var obj = (CslaObjectInfo)objinfo;
                    var fullCrud = CslaTemplateHelperCS.IsEditableType(obj.ObjectType);

                    _lstCrudOperations.Items.Clear();
                    _lstCrudOperations.Items.Add("(None)");
                    if (fullCrud)
                        _lstCrudOperations.Items.Add("Create");
                    _lstCrudOperations.Items.Add("Read");
                    if (fullCrud)
                        _lstCrudOperations.Items.Add("Update");
                    if (fullCrud)
                        _lstCrudOperations.Items.Add("Delete");

                    foreach (var item in propColl)
                    {
                        _lstCrudOperations.SelectedItems.Add(item);
                    }

{'fraction_non_alphanumeric': 0.07714762301918265, 'fraction_numerical': 0.0008340283569641367, 'mean_word_length': 2.075, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4232298', 'n_tokens_mistral': 1164, 'n_tokens_neox': 1145, 'n_words': 225}