public void AddProfile(Profile profile)
        {
            var top = ProfileControls
              .Select(x => x.Bottom)
              .DefaultIfEmpty(12)
              .Max();

              var control = new ProfileControl
              {
            Profile = profile,
            Top = top + 3,
            Left = 12,
            Width = profilePanel.Width - 24,
            Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top
              };

              control.RemoveButtonClicked += RemoveProfile;
              profilePanel.Controls.Add(control);
        }
 private void ProfileChanged(Profile profile)
 {
     _model.Reload();
       comboBox1_SelectedIndexChanged(this, new EventArgs());
 }
 public static MenuItem GenerateProtoItem(Profile profile, string key, string path, string name, string model, string zoomAttribute)
 {
     var item = new MenuItem { Profile = profile};
       item.Descriptions = new List<string>();
       var keyParts = key.Split('-');
       if (keyParts.Count() == 2)
       {
     item.Module = keyParts[0];
     item.ModuleSolution = keyParts[0];
     item.Number = Convert.ToInt32(keyParts[1]);
       }
       item.Assembly = path;
       if (item.Module.ToLower() == "aaa" && !item.Assembly.IsNullOrTrimmedEmpty())
       {
     if (item.Assembly.Contains("MVC"))
     {
       var parts = item.Assembly.Split('.');
       if (parts.Count() == 4 && parts[0] == "Caselle" && parts[2] == "MVC" && parts[1].Length == 3)
       {
     item.ModuleSolution = parts[1].ToLower();
       }
     }
     else if (item.Assembly.Contains("UI"))
     {
       var parts = item.Assembly.Split('.');
       if (parts.Count() == 5 && parts[0] == "Caselle" && parts[2] == "UI" && parts[1].Length == 3)
       {
     item.ModuleSolution = parts[1].ToLower();
       }
     }
       }
       item.ControlName = name;
       item.Model = model;
       item.IsZoomable = zoomAttribute == "True";
       return item;
 }