示例#1
0
    protected bool?set_element_cut(int id, element_cut.element_cut_type tp, bool copy = false)
    {
        element_cut ec = find_element_cut(id, tp);

        if (ec == null)
        {
            elements_cut.Add(new element_cut(id, tp, copy)); return(true);
        }
        if (ec.copy != copy)
        {
            ec.copy = copy; return(null);
        }
        remove_element_cut(id, tp);
        return(false);
    }
示例#2
0
 protected element_cut find_element_cut(int id, element_cut.element_cut_type tp)
 {
     return(elements_cut.FirstOrDefault(x => x.tp == tp && x.id == id));
 }
示例#3
0
 protected void remove_element_cut(int id, element_cut.element_cut_type tp)
 {
     elements_cut.Remove(find_element_cut(id, tp));
 }
示例#4
0
 protected bool there_element_cut(int id, element_cut.element_cut_type tp)
 {
     return(elements_cut.FirstOrDefault(x => x.tp == tp && x.id == id) != null);
 }