Exemplo n.º 1
0
        private void PRegisterDataView(DataView view, string referenceName, bool enabled)
        {
            dictionary.AddRegisteredItem(view, referenceName);

            ViewDataSource source = FindDataComponent(referenceName) as ViewDataSource;

            if (source != null)
            {
                source.Reference = view;
                source.InitSchema();
                source.RefreshColumns();
            }
            else
            {
                source = new ViewDataSource();
                source.ReferenceName = referenceName;
                source.Reference     = view;
                source.Name          = CreateUniqueName(referenceName);
                source.Alias         = CreateUniqueAlias(source.Alias);
                source.Enabled       = enabled;
                source.InitSchema();
                dictionary.DataSources.Add(source);
                AddBaseWithChiledToDictonary(source);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Registers a DataView.
        /// </summary>
        /// <param name="view">The DataView to register.</param>
        /// <param name="referenceName">The name of the data object.</param>
        /// <param name="enabled">Determines wheter to enable the object or not.</param>
        /// <remarks>
        /// This method is for internal use only.
        /// </remarks>
        public void RegisterDataView(DataView view, string referenceName, bool enabled)
        {
            AddRegisteredItem(view, referenceName);

            ViewDataSource source = FindDataComponent(referenceName) as ViewDataSource;

            if (source != null)
            {
                source.Reference = view;
                source.InitSchema();
                source.RefreshColumns();
            }
            else
            {
                source = new ViewDataSource();
                source.ReferenceName = referenceName;
                source.Reference     = view;
                source.Name          = CreateUniqueName(referenceName);
                source.Alias         = CreateUniqueAlias(source.Alias);
                source.Enabled       = enabled;
                source.InitSchema();
                DataSources.Add(source);
            }
        }