Example #1
0
 public ViewSpecLayout ChangeName(string name)
 {
     return(ChangeProp(ImClone(this), im =>
     {
         im.ViewSpec = ViewSpec.SetName(name);
         im.ViewLayoutList = ViewLayoutList.ChangeViewName(name);
     }));
 }
Example #2
0
        public virtual ViewSpec MakeEditable(ViewSpec viewSpec)
        {
            if (!IsReadOnly(viewSpec) && !string.IsNullOrEmpty(viewSpec.Name))
            {
                return(viewSpec);
            }
            var viewNames = new HashSet <string>(BuiltInViewSpecs.Select(builtInViewSpec => builtInViewSpec.Name));

            viewNames.UnionWith(CustomViewSpecs.Select(customViewSpec => customViewSpec.Name));
            for (int index = 1; ; index++)
            {
                string name = "CustomView" + index;
                if (!viewNames.Contains(name))
                {
                    return(viewSpec.SetName(name));
                }
            }
        }