Пример #1
0
        public async Task Set(DGObjects objs)
        {
            List <DGObject> dGObjects = await RepositoryForClient.RetrieveObjs(objs);

            string domain  = objs.parent.name;
            string objtype = objs.definition.Type;

            //获取对应属性数据
            iS3Property property = new iS3Property();
            Type        objType  = iS3Property.GetType(objs.parent.name, objs.definition.Type);
            Type        _t       = property.GetType();
            MethodInfo  mi       = _t.GetMethod("Convert").MakeGenericMethod(objType);

            DGObjectsHolder.ItemsSource = mi.Invoke(property, new object[] { dGObjects }) as IEnumerable;
        }
Пример #2
0
        public async Task GetData(DGObjects objs)
        {
            lastObj           = objs;
            domainName        = objs.parent.name;
            objTypeName       = objs.definition.Type;
            AddBtn.Content    = "新增" + objs.definition.Type + "对象";
            DeleteBtn.Content = "删除" + objs.definition.Type + "对象";
            List <DGObject> objList = await RepositoryForClient.RetrieveObjs(objs);

            string domain  = objs.parent.name;
            string objtype = objs.definition.Type;

            //获取对应属性数据
            Type       objType = ObjectHelper.GetType(objs.parent.name, objs.definition.Type);
            Type       _t      = typeof(ObjectHelper);
            MethodInfo mi      = _t.GetMethod("Convert").MakeGenericMethod(objType);

            DGObjectDataGrid.ItemsSource = mi.Invoke(null, new object[] { objList }) as IEnumerable;
        }
        public async Task LoadProject(string definitionFile)
        {
            try
            {
                if (definitionFile == null ||
                    definitionFile.Length == 0)
                {
                    return;
                }
                _prj = new Project()
                {
                    projectID = projectID
                };
                _prj.projectInfo = await CommonRepo.GetProjectInfo(_prj.projectID);

                _prj.domains = await CommonRepo.GetDomains(_prj.projectID);

                _prj.emaps = await CommonRepo.GetEMaps(_prj.projectID);

                Globals.project = _prj;
                foreach (Domain domain in _prj.domains)
                {
                    try
                    {
                        domain.objectsDefinitions = await CommonRepo.GetObjectsDefinition(_prj.projectID, domain.name);

                        domain.DGObjectsList = new List <DGObjects>();
                        foreach (ObjectsDefinition definition in domain.objectsDefinitions)
                        {
                            if ((definition.Layer3DName == null) || (definition.Layer3DName == ""))
                            {
                                definition.Layer3DName = definition.Domain + "/" + definition.Type;
                            }
                            DGObjects objs = new DGObjects()
                            {
                                parent = domain, definition = definition,
                            };
                            domain.DGObjectsList.Add(objs);
                            objs.objContainer = await RepositoryForClient.RetrieveObjs(objs);

                            _prj.objsDefIndex[definition.Name] = objs;
                        }
                    }
                    catch (Exception ex)
                    {
                        //  MessageBox.Show(ex.ToString());
                    }
                }

                loadDomainPanels();
                await LoadViews();


                if (projectLoaded != null)
                {
                    projectLoaded(this, EventArgs.Empty);
                }

                ViewHolder.SelectedIndex = 1;
            }
            catch (Exception ex)
            {
            }
        }
Пример #4
0
        public async Task GetData(DGObjects objs)
        {
            List <DGObject> objList = await RepositoryForClient.RetrieveObjs(objs);

            currenttable = ReadFromDgobjects(objList);
        }