Ejemplo n.º 1
0
    protected void ckActive_CheckedChanged(object sender, EventArgs e)
    {
        if (sender == null)
        {
            throw new ArgumentNullException("sender");
        }

        CheckBox ck = sender as CheckBox;

        HiddenField h = (HiddenField)ck.NamingContainer.FindControl("hdnID");

        int id = Convert.ToInt32(h.Value, CultureInfo.InvariantCulture);

        if (ck.Checked)
        {
            ActiveTemplates.Add(id);
            Refresh();
            if (TemplateSelected != null)
            {
                TemplateSelected(this, new PropertyTemplateEventArgs(UserTemplates.FirstOrDefault(pt => pt.ID == id)));
            }
        }
        else
        {
            ActiveTemplates.Remove(id);
            Refresh();
            if (TemplateUnselected != null)
            {
                TemplateUnselected(this, new PropertyTemplateEventArgs(id));
            }
        }
    }
Ejemplo n.º 2
0
    public void AddTemplate(PropertyTemplate pt)
    {
        if (pt == null)
        {
            throw new ArgumentNullException(nameof(pt));
        }

        ActiveTemplates.Add(pt);
        mfbSelectTemplates.AddTemplate(pt.ID);
    }
Ejemplo n.º 3
0
 public void AddTemplates(IEnumerable <PropertyTemplate> rgpt)
 {
     if (rgpt == null)
     {
         return;
     }
     foreach (PropertyTemplate pt in rgpt)
     {
         ActiveTemplates.Add(pt.ID);
     }
 }
Ejemplo n.º 4
0
 public void AddTemplates(IEnumerable <PropertyTemplate> rgpt)
 {
     if (rgpt == null)
     {
         throw new ArgumentNullException(nameof(rgpt));
     }
     foreach (PropertyTemplate pt in rgpt)
     {
         ActiveTemplates.Add(pt);
     }
     mfbSelectTemplates.AddTemplates(rgpt);
 }
Ejemplo n.º 5
0
 public void AddTemplate(int id)
 {
     ActiveTemplates.Add(id);
 }