コード例 #1
0
        public void DeleteGroup(GroupTemplates groupTemplates)
        {
            var group = Groups.SingleOrDefault(x => x.Id.Equals(groupTemplates.Id));

            if (group != null)
            {
                Groups.Remove(group);
            }

            Save();
        }
コード例 #2
0
        public void DeleteTemplate(GroupTemplates groupTemplates, TemplateSettings template)
        {
            var group = Groups.SingleOrDefault(x => x.Id.Equals(groupTemplates.Id));
            var tmplt = group.Templates.SingleOrDefault(x => x.Id.Equals(template.Id));

            if (tmplt != null)
            {
                group.Templates.Remove(tmplt);
            }

            Save();
        }
コード例 #3
0
        public int SaveGroup(GroupTemplates groupTemplates)
        {
            var group = Groups.SingleOrDefault(x => x.Id.Equals(groupTemplates.Id));

            if (group == null)
            {
                Groups.Add(groupTemplates);
            }
            else
            {
                group.Name    = groupTemplates.Name;
                group.Enabled = groupTemplates.Enabled;
            }

            Save();

            return(Groups.FindIndex(x => x.Id.Equals(groupTemplates.Id)));
        }
コード例 #4
0
        public int SaveTemplate(GroupTemplates groupTemplates, TemplateSettings template)
        {
            var tmplt = groupTemplates.Templates.SingleOrDefault(x => x.Id.Equals(template.Id));

            if (tmplt == null)
            {
                groupTemplates.Templates.Add(template);
            }
            else
            {
                tmplt.Name      = template.Name;
                tmplt.Enabled   = template.Enabled;
                tmplt.PerEntity = template.PerEntity;
                tmplt.FileExt   = template.FileExt;
                tmplt.Code      = template.Code;
                tmplt.Language  = template.Language;
            }

            Save();

            return(groupTemplates.Templates.FindIndex(x => x.Id.Equals(template.Id)));
        }