// Copyright (C) 2013 João Pedro Correia - All Rights Reserved
// Code under the terms of the GPLv2 license
// URL: http://flowstudio.codeplex.com

namespace FlowStudio.ViewModel.Data
{
    using System.Activities.Presentation.Model;

    public class OutlineVariablesHolderItem : OutlinePropertyItem
    {
        private readonly string displayText;

        private readonly string propertyName;

        public OutlineVariablesHolderItem(ModelItem modelItem)
            : base(modelItem)
        {
            displayText = modelItem.Source.Name;
            propertyName = modelItem.Source.Name;

            foreach (var item in modelItem.Source.Collection)
            {
                InnerItems.Add(new OutlineVariableItem(item));
            }
        }

        public override string DisplayText
        {
            get { return displayText; }
        }

        public override string PropertyName
        {
            get { return propertyName; }
        }
    }
}
