Example #1
0
        // Summary:
        //     Get objects according to the specified object type
        // Remarks:
        //     If there is only a DGObjects with the specified object type,
        //     it will be returned directly.
        //
        //     If there are multiple DGObjects with the specified object type,
        //     then a new DGObjects is returned which will merged all the objects.
        //     In this situation, the index of the DGObjects are lost.
        public async Task <List <DGObject> > getObjects(string objType)
        {
            DGObjectRepository repository = DGObjectRepository.Instance(
                Globals.project.projDef.ID, name, objType);
            List <DGObject> objList = await repository.GetAllAsync();

            return(objList);
        }
Example #2
0
        public async Task <List <DGObject> > QueryAllByObjs()
        {
            DGObjectRepository repository = DGObjectRepository.Instance(
                Globals.project.projDef.ID, parent.name, definition.Type);
            List <DGObject> list = await repository.GetAllByObjs(GetFilter());

            list.ForEach(x => x.parent = this);
            return(list);
        }
Example #3
0
        // Summary:
        //     Get object by a key
        public async Task <DGObject> QueryObjByID(int objID)
        {
            DGObjectRepository repository = DGObjectRepository.Instance(
                Globals.project.projDef.ID, parent.name, definition.Type);
            DGObject obj = await repository.Retrieve(objID);

            obj.parent = this;
            return(obj);
        }
 public static DGObjectRepository Instance(string prjID, string domainType, string dgobjectName)
 {
     if (_DGObjectsRepository == null)
     {
         _DGObjectsRepository = new DGObjectRepository();
     }
     _DGObjectsRepository.projectID    = prjID;
     _DGObjectsRepository.domainType   = domainType;
     _DGObjectsRepository.dgobjectName = dgobjectName;
     return(_DGObjectsRepository);
 }