Пример #1
0
 /// <summary>
 /// Finds all of the Objects Subtypes
 /// </summary>
 public void FindObjectSubTypes()
 {
     foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
     {
         foreach (var type in assembly.GetTypes().Where(myType => myType.IsClass && !myType.IsAbstract && myType.IsSubclassOf(typeof(Actor))))
         {
             ObjectTypes.Add(type);
         }
     }
 }
Пример #2
0
        private void InitializeObjectTypeFilters()
        {
            var task = new DatabaseInteraction().GetObjectTypes(new System.Threading.CancellationToken());
            var list = task.Result?.OrderBy(x => x).ToList();

            foreach (var type in list)
            {
                ObjectTypes.Add(new DSOObjectType(type));
            }
        }
        /// <summary>
        /// Retrieves relationship of the resource
        /// </summary>
        private void RetrieveRelations()
        {
            if (levelOfStripping <= 0)
            {
                return;
            }

            List <Relationship> containedResources;

            using (ZentityContext context = CoreHelper.CreateZentityContext())
            {
                Resource resource = context.Resources
                                    .Where(res => res.Id == ResourceUri)
                                    .FirstOrDefault();

                if (resource == null ||
                    !resource.Authorize("Read", context, CoreHelper.GetAuthenticationToken()))
                {
                    return;
                }

                resource.RelationshipsAsSubject.Load();

                containedResources = resource.RelationshipsAsSubject.ToList();

                foreach (Relationship rel in containedResources)
                {
                    rel.ObjectReference.Load();
                    ObjectResourceIds.Add(rel.Object.Id);

                    Type objectType = rel.Object.GetType();

                    ObjectTypes.Add(objectType);

                    rel.PredicateReference.Load();
                    RelationUris.Add(rel.Predicate.Name);
                }
            }
        }
Пример #4
0
        public ResultSvc <ObjectType> CreateObjectType(ObjectType objectType)
        {
            var result = new ResultSvc <ObjectType>(objectType);

            try
            {
                if (!ObjectTypes.Items.Any(x => x.Name == objectType.Name.Trim() && x.Capacity == objectType.Capacity))
                {
                    objectType.Name          = objectType.Name?.Trim();
                    objectType.ObjectsName   = objectType.ObjectsName?.Trim();
                    objectType.UserCreatedId = Context.HttpContext.User.GetUserId();
                    ObjectTypes.Add(objectType);
                }
                else
                {
                    result.Errors.Add("Typ objektu s těmito údaji již existuje!");
                }
            }
            catch (Exception e)
            {
                Logger.LogError(e.Message);
            }
            return(result);
        }
Пример #5
0
 private void BuildObjTypeList()
 {
     ObjectTypes.Add("Tree");
 }
Пример #6
0
 public OpenFeatureLayerFilter()
     : base("Map Feature Layer")
 {
     ObjectTypes.Add(typeof(IFeatureLayer));
 }
Пример #7
0
 public ActorSpawner()
 {
     ObjectTypes.Add(typeof(Actor));
     FindObjectSubTypes();
     SpawnTypeCreator();
 }
Пример #8
0
 public OpenRendererFilter()
     : base("Map Feature Layer")
 {
     ObjectTypes.Add(typeof(ITOCElement));
 }