Beispiel #1
0
    public void CopyFrom (TComponentModelItem model)
    {
      if (model.NotNull ()) {
        Model.CopyFrom (model);

        if (Model.NodeModelCollection.Count > 0) {
          ChildCategoryValue = Model.NodeModelCollection [0].ChildCategory;
          ChildCategory = Server.Models.Infrastructure.TCategoryType.FromValue (ChildCategoryValue);
        }

        SelectIconResource ();
      }
    }
Beispiel #2
0
    public void CopyFrom (TComponentModelItem alias)
    {
      if (alias.NotNull ()) {
        base.CopyFrom (alias);

        Category = alias.Category;

        ChildCollection.Clear ();

        foreach (var item in alias.ChildCollection) {
          ChildCollection.Add (item);
        }
      }
    }
Beispiel #3
0
    public bool TryToInsert (TComponentModelItem componentModelItem)
    {
      var res = false;

      if (componentModelItem.NotNull ()) {
        if (componentModelItem.Id.NotEmpty ()) {
          var id = componentModelItem.Id;

          var list = ComponentModelCollection
            .Where (p => p.Id.Equals (id))
            .ToList ()
          ;

          if (list.Count.Equals (0)) {
            if (m_ComponentModelTryToInsert.ContainsKey (id).IsFalse ()) {
              m_ComponentModelTryToInsert.Add (id, componentModelItem);
              res = true;
            }
          }
        }
      }

      return (res);
    }