Ejemplo n.º 1
0
 public DataItemInfo(DataItemDefinition definition, List <ComponentDefinition> components)
 {
     this.Id       = definition.Id;
     this.Type     = definition.Type;
     this.ParentId = definition.ParentId;
     this.SubType  = definition.SubType;
     this.Parents  = DataItemInfo.GetParents(definition.ParentId, components);
 }
Ejemplo n.º 2
0
 public SampleInfo(Sample sample, DataItemInfo dataItem)
 {
     DeviceId        = sample.DeviceId;
     Id              = sample.Id;
     Timestamp       = sample.Timestamp;
     Sequence        = sample.Sequence;
     AgentInstanceId = sample.AgentInstanceId;
     CDATA           = sample.CDATA;
     Condition       = sample.Condition;
     DataItem        = dataItem;
 }
Ejemplo n.º 3
0
        private static List <ComponentDefinition> GetParents(string parentId, List <ComponentDefinition> components)
        {
            List <ComponentDefinition> componentDefinitionList = new List <ComponentDefinition>();

            if (!parentId.IsNullOrEmpty <char>())
            {
                ComponentDefinition componentDefinition = components.Find((Predicate <ComponentDefinition>)(o => o.Id == parentId));
                if (componentDefinition != null)
                {
                    componentDefinitionList.Add(componentDefinition);
                    componentDefinitionList.AddRange((IEnumerable <ComponentDefinition>)DataItemInfo.GetParents(componentDefinition.ParentId, components));
                }
            }
            return(componentDefinitionList);
        }