/// <summary>
        /// Inits grid source.
        /// </summary>
        /// <param name="maxParametersCount">Maximum number of attribute parameters.</param>
        /// <param name="collectionSource">Data grid collection source.</param>
        private void _InitGridSource(int maxParametersCount,
                                     DataGridCollectionViewSource collectionSource)
        {
            IVrpSolver solver = App.Current.Solver;
            SolverSettings solverSettings = solver.SolverSettings;
            NetworkDescription networkDescription = solver.NetworkDescription;
            ICollection<Restriction> restrictions = solverSettings.Restrictions;

            var restrictionWrappers = new List<RestrictionDataWrapper>();

            var networkAttributes = networkDescription.NetworkAttributes;
            foreach (NetworkAttribute attribute in networkAttributes)
            {
                if (attribute.UsageType == NetworkAttributeUsageType.Restriction)
                {
                    Restriction restriction = _FindRestriction(attribute.Name, restrictions);
                    if (restriction.IsEditable)
                    {
                        Debug.Assert(null != attribute.Parameters);

                        // Create collection of all non "restriction usage" attribute parameters.
                        IList<NetworkAttributeParameter> attrParams;
                        if (attribute.RestrictionUsageParameter != null)
                            attrParams = attribute.Parameters.Where(
                                param => param.Name != attribute.RestrictionUsageParameter.Name).ToList();
                        else
                            attrParams = attribute.Parameters.ToList();

                        var parameters = new Parameters(maxParametersCount);
                        for (int index = 0; index < maxParametersCount; ++index)
                        {
                            string value = null;
                            if (index < attrParams.Count())
                            {
                                NetworkAttributeParameter param = attrParams.ElementAt(index);
                                value = _GetParameterValue(attribute.Name, param.Name, solverSettings);
                                parameters[index] = new Parameter(param.Name, value);
                            }
                            else
                                parameters[index] = new Parameter();
                        }

                        // Create wrapper for restriction.
                        var wrapper = new RestrictionDataWrapper(restriction.IsEnabled,
                                                                 restriction.NetworkAttributeName,
                                                                 restriction.Description, parameters);

                        // If attribute has restriction usage parameter - add this parameter
                        // to wrapper.
                        if (attribute.RestrictionUsageParameter != null)
                        {
                            var restrictionUsageParameterValue = _GetParameterValue(attribute.Name,
                                attribute.RestrictionUsageParameter.Name, solverSettings);
                            var restrictionParameter = new Parameter(attribute.RestrictionUsageParameter.Name,
                                restrictionUsageParameterValue);
                            wrapper.RestrictionUsageParameter = restrictionParameter;
                        }

                        restrictionWrappers.Add(wrapper);
                    }
                }
            }

            collectionSource.Source = restrictionWrappers;
        }
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        public RestrictionDataWrapper(bool IsEnabled, string name, string description, Parameters parameters)
        {
            Debug.Assert(null != parameters);

            _isEnabled = IsEnabled;
            _restrictionName = new RestrictionName(name, description);
            _parameters = parameters;
        }