/// <summary>
 /// Create instance of object.
 /// </summary>
 /// <param name="control">Reference to the data source control.</param>
 /// <param name="oldTypeName">Existing type name.</param>
 public CslaDataSourceConfiguration(DataSourceControl control, string oldTypeName)
   : this()
 {
   _control = control;
   DiscoverTypes();
   this.TypeComboBox.Text = oldTypeName;
 }
 public DbEntryDesignerDataSourceView(DbEntryDataSourceDesigner owner)
     : base(owner, "MainView")
 {
     _dataSource = (DataSourceControl)owner.Component;
     _modelType = _dataSource.GetType().BaseType.GetGenericArguments()[0];
     _info = ObjectInfoFactory.Instance.GetInstance(_modelType);
 }
Пример #3
0
 private void InitDataSourceControl()
 {
     if (!string.IsNullOrEmpty(_dataSourceID))
     {
         _dsCtrl = (DataSourceControl)Utility.FindControl(this, _dataSourceID);
         if (_dsCtrl is SqlDataSource)
         {
         }
         else if (_dsCtrl is ObjectDataSource)
         {
         }
         else
         {
             throw new Exception("目前附件控件只能支持 ObjectDataSource / SqlDataSource 控件作为数据源,或者请检查 DataSourceID 是否正确。");
         }
     }
 }
        public esDataSourceWizard(IServiceProvider provider, DataSourceControl esDataSource)
        {
            InitializeComponent();

            this.esDataSource = esDataSource;
            this.provider = provider;
            this.helper = new esReflectionHelper();

            //----------------------------------------------------
            // Let's see if we can load our types right up !!
            //----------------------------------------------------
            ITypeDiscoveryService discovery = null;
            if (esDataSource.Site != null)
                discovery = (ITypeDiscoveryService)esDataSource.Site.GetService(typeof(ITypeDiscoveryService));

            ICollection types = discovery.GetTypes(typeof(esEntityCollectionBase), true);

            foreach (Type type in types)
            {
                if (type.IsClass && !type.IsAbstract)
                {
                    if (type.IsSubclassOf(typeof(esEntityCollectionBase)))
                    {
                        try
                        {
                            esEntityCollectionBase coll = Activator.CreateInstance(type) as esEntityCollectionBase;

                            if (coll != null)
                            {
                                collections[type.Name] = coll;
                            }
                        }
                        catch { }
                    }
                }
            }

            foreach (string collectionName in collections.Keys)
            {
                this.lboxCollections.Items.Add(collectionName);
            }
        }
Пример #5
0
        protected DataSourceView(IDataSource owner, string viewName)
        {
            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }
            if (viewName == null)
            {
                throw new ArgumentNullException("viewName");
            }
            this._name = viewName;
            DataSourceControl control = owner as DataSourceControl;

            if (control != null)
            {
                control.DataSourceChangedInternal += new EventHandler(this.OnDataSourceChangedInternal);
            }
            else
            {
                owner.DataSourceChanged += new EventHandler(this.OnDataSourceChangedInternal);
            }
        }
 internal QueryableDataSourceView(DataSourceControl owner, string viewName, HttpContext context, IDynamicQueryable queryable)
     : base(owner, viewName) {
     _context = context;
     _queryable = queryable;
     _owner = owner;
 }
 protected QueryableDataSourceView(DataSourceControl owner, string viewName, HttpContext context)
     : this(owner, viewName, context, new DynamicQueryableWrapper()) {
     _context = context;
     _owner = owner;
 }
Пример #8
0
 /// <summary>
 /// Initialize the designer component.
 /// </summary>
 /// <param name="component">The CslaDataSource control to 
 /// be designed.</param>
 public override void Initialize(IComponent component)
 {
   base.Initialize(component);
   _control = (DataSourceControl)component;
 }
 internal ContextDataSourceView(DataSourceControl owner, string viewName, HttpContext context, IDynamicQueryable queryable)
     : base(owner, viewName, context, queryable) {
 }
 protected ContextDataSourceView(DataSourceControl owner, string viewName, HttpContext context)
     : base(owner, viewName, context) {
     _owner = owner;
 }