コード例 #1
0
        private static Dictionary <string, ControlData> EditChoices(
            SiteSettings ss, Column column, string value)
        {
            var editChoices = column.EditChoices();

            if (column.UseSearch != true)
            {
                return(editChoices);
            }
            else if (editChoices.ContainsKey(value))
            {
                return(new Dictionary <string, ControlData>()
                {
                    { value, editChoices[value] }
                });
            }
            else
            {
                var referenceId = value.ToLong();
                if (referenceId > 0 && ss.Links?.Any() == true)
                {
                    return(new Dictionary <string, ControlData>()
                    {
                        {
                            value,
                            new ControlData(ItemUtilities.Title(referenceId, ss.Links))
                        }
                    });
                }
                else
                {
                    return(new Dictionary <string, ControlData>());
                }
            }
        }