예제 #1
0
        public Relation(ViewsManager manager, string name, string description, TableField masterField, TableField detailsField)
            : this(manager, name, description)
        {
            if (null == masterField)
            {
                throw new ArgumentNullException("masterField");
            }
            if (null == detailsField)
            {
                throw new ArgumentNullException("detailsField");
            }

            this.MasterField  = masterField;
            this.MasterTable  = masterField.Table;
            this.DetailsField = detailsField;
            this.DetailsTable = detailsField.Table;

            if (String.IsNullOrEmpty(name))
            {
                this.Name = String.Format("{0}.{1} TO {2}.{3}", this.MasterTable.Name, this.MasterField.Name, this.DetailsTable.Name, this.DetailsField.Name);
            }

            this.MasterTable.Relations.Add(this);
            this.DetailsTable.Relations.Add(this);
        }
예제 #2
0
        public ViewToken(ViewsManager manager)
        {
            if (null == manager)
            {
                throw new ArgumentNullException("manager");
            }

            this.ViewsManager = manager;
        }
예제 #3
0
파일: Table.cs 프로젝트: t1b1c/lwas
 public Table(ViewsManager manager, string name)
     : this(manager)
 {
     if (String.IsNullOrEmpty(name))
     {
         throw new ArgumentNullException("table");
     }
     this.Name = name;
 }
예제 #4
0
        public ComputedField(ViewsManager manager)
        {
            if (null == manager)
            {
                throw new ArgumentNullException("manager");
            }

            this.Manager = manager;
        }
예제 #5
0
 public View(ViewsManager manager)
 {
     this.Manager                   = manager;
     this.Relationship              = new RelationsCollection(this.Manager);
     this.Filters                   = new FiltersCollection(this.Manager);
     this.Fields                    = new FieldsCollection <TableField>(TableField.XML_KEY);
     this.ComputedFields            = new FieldsCollection <ComputedField>(ComputedField.XML_KEY);
     this.ComputedFields.InitField += new EventHandler <FieldsCollection <ComputedField> .FieldEventArgs>(ComputedFields_InitField);
     this.Aliases                   = new Dictionary <Field, string>();
     this.OwnParameters             = new ParametersCollection();
     this.UpdateParameters          = new ParametersCollection();
     this.Sorting                   = new ViewSorting(this);
     this.Subviews                  = new Dictionary <View, Dictionary <string, Field> >();
 }
예제 #6
0
파일: View.cs 프로젝트: t1b1c/lwas
 public View(ViewsManager manager)
 {
     this.Manager = manager;
     this.Relationship = new RelationsCollection(this.Manager);
     this.Filters = new FiltersCollection(this.Manager);
     this.Fields = new FieldsCollection<TableField>(TableField.XML_KEY);
     this.ComputedFields = new FieldsCollection<ComputedField>(ComputedField.XML_KEY);
     this.ComputedFields.InitField += new EventHandler<FieldsCollection<ComputedField>.FieldEventArgs>(ComputedFields_InitField);
     this.Aliases = new Dictionary<Field, string>();
     this.OwnParameters = new ParametersCollection();
     this.UpdateParameters = new ParametersCollection();
     this.Sorting = new ViewSorting(this);
     this.Subviews = new Dictionary<View, Dictionary<string, Field>>();
 }
예제 #7
0
파일: Relation.cs 프로젝트: t1b1c/lwas
        public Relation(ViewsManager manager, string name, string description, TableField masterField, TableField detailsField)
            : this(manager, name, description)
        {
            if (null == masterField) throw new ArgumentNullException("masterField");
            if (null == detailsField) throw new ArgumentNullException("detailsField");

            this.MasterField = masterField;
            this.MasterTable = masterField.Table;
            this.DetailsField = detailsField;
            this.DetailsTable = detailsField.Table;

            if (String.IsNullOrEmpty(name))
                this.Name = String.Format("{0}.{1} TO {2}.{3}", this.MasterTable.Name, this.MasterField.Name, this.DetailsTable.Name, this.DetailsField.Name);

            this.MasterTable.Relations.Add(this);
            this.DetailsTable.Relations.Add(this);
        }
예제 #8
0
        public IEnumerable <Table> RelatableTables()
        {
            ViewsManager vm = this.Manager;

            if (this.Relationship.Count == 0)
            {
                return new Table[] { this.Source }
            }
            ;

            return(vm.Tables
                   .Values
                   .Where(t =>
            {
                return vm.Relations
                .Select <Relation, Table>(rel => rel.MasterTable)
                .Union(vm.Relations
                       .Select <Relation, Table>(rel => rel.DetailsTable))
                .Where(tb =>
                {
                    return this.Relationship
                    .Any(r =>
                    {
                        return r.DetailsTable == tb ||
                        r.MasterTable == tb;
                    })
                    ||
                    vm.Relations
                    .Any(r =>
                    {
                        return ((r.MasterTable == tb && r.DetailsTable == this.Source) ||
                                (r.DetailsTable == tb && r.MasterTable == this.Source));
                    });
                })
                .Contains(t);
            }));
        }
예제 #9
0
 public RelationsCollection(ViewsManager manager)
 {
     this.Relations = new List <Relation>();
     this.Manager   = manager;
 }
예제 #10
0
파일: Relation.cs 프로젝트: t1b1c/lwas
 public Relation(ViewsManager manager)
 {
     this.Manager = manager;
 }
예제 #11
0
 public Relation(ViewsManager manager, string name, string description)
     : this(manager)
 {
     this.Name        = name;
     this.Description = description;
 }
예제 #12
0
파일: Database.cs 프로젝트: t1b1c/lwas
 public Database(string name, string viewsKey, IStorageAgent agent, IExpressionsManager expressionsManager)
 {
     this.Name         = name;
     this.ViewsKey     = viewsKey;
     this.ViewsManager = new ViewsManager(viewsKey, agent, expressionsManager);
 }
예제 #13
0
파일: Table.cs 프로젝트: t1b1c/lwas
 public Table(ViewsManager manager, string name, string description)
     : this(manager, name)
 {
     this.Description = description;
 }
예제 #14
0
파일: Table.cs 프로젝트: t1b1c/lwas
 public Table(ViewsManager manager)
 {
     this.Manager   = manager;
     this.Relations = new RelationsCollection(manager);
     this.Fields    = new FieldsCollection <TableField>(TableField.XML_KEY);
 }
예제 #15
0
파일: ViewToken.cs 프로젝트: t1b1c/lwas
        public ViewToken(ViewsManager manager)
        {
            if (null == manager) throw new ArgumentNullException("manager");

            this.ViewsManager = manager;
        }
예제 #16
0
 public Relation(ViewsManager manager)
 {
     this.Manager = manager;
 }
예제 #17
0
 public ViewsCollection(ViewsManager manager)
 {
     this.Manager = manager;
 }
예제 #18
0
 public FiltersCollection(ViewsManager manager)
 {
     this.Manager = manager;
 }
예제 #19
0
파일: Table.cs 프로젝트: t1b1c/lwas
 public Table(ViewsManager manager)
 {
     this.Manager = manager;
     this.Relations = new RelationsCollection(manager);
     this.Fields = new FieldsCollection<TableField>(TableField.XML_KEY);
 }
예제 #20
0
파일: Filter.cs 프로젝트: t1b1c/lwas
 public Filter(ViewsManager manager)
 {
     this.Manager = manager;
 }
예제 #21
0
파일: Table.cs 프로젝트: t1b1c/lwas
 public Table(ViewsManager manager, string name)
     : this(manager)
 {
     if (String.IsNullOrEmpty(name)) throw new ArgumentNullException("table");
     this.Name = name;
 }
예제 #22
0
파일: Relation.cs 프로젝트: t1b1c/lwas
 public Relation(ViewsManager manager, string name, string description)
     : this(manager)
 {
     this.Name = name;
     this.Description = description;
 }
예제 #23
0
파일: Table.cs 프로젝트: t1b1c/lwas
 public Table(ViewsManager manager, string name, string description)
     : this(manager, name)
 {
     this.Description = description;
 }
예제 #24
0
파일: ComputedField.cs 프로젝트: t1b1c/lwas
        public ComputedField(ViewsManager manager)
        {
            if (null == manager) throw new ArgumentNullException("manager");

            this.Manager = manager;
        }
예제 #25
0
파일: Filter.cs 프로젝트: t1b1c/lwas
 public Filter(ViewsManager manager)
 {
     this.Manager = manager;
 }