Example #1
0
        /// <summary>
        /// Asynchronous export item's properties
        /// </summary>
        /// <returns>An <see cref="ExportableCI"/> instance containing all relevant properties</returns>
        public async Task <ExportableFixtureCI> ExportAsync()
        {
            var scheduledTasks = ScheduledStartTimeChanges?.Select(async s => await((ScheduledStartTimeChange)s).ExportAsync().ConfigureAwait(false)).ToList();

            if (!scheduledTasks.IsNullOrEmpty())
            {
                await Task.WhenAll(scheduledTasks).ConfigureAwait(false);
            }
            var channelTasks = TvChannels?.Select(async c => await((TvChannel)c).ExportAsync().ConfigureAwait(false)).ToList();

            return(new ExportableFixtureCI
            {
                ExtraInfo = ExtraInfo?.ToDictionary(i => i.Key, i => i.Value),
                CoverageInfo = CoverageInfo != null?await((CoverageInfo)CoverageInfo).ExportAsync().ConfigureAwait(false) : null,
                                   ProductInfo = ProductInfo != null?await((ProductInfo)ProductInfo).ExportAsync().ConfigureAwait(false) : null,
                                                     ReplacedBy = ReplacedBy?.ToString(),
                                                     References = References?.References?.ToDictionary(r => r.Key, r => r.Value),
                                                     NextLiveTime = NextLiveTime,
                                                     StartTimeConfirmed = StartTimeConfirmed,
                                                     ScheduledStartTimeChanges = scheduledTasks.IsNullOrEmpty() ? null : scheduledTasks.Select(s => s.Result).ToList(),
                                                     StartTime = StartTime,
                                                     TvChannels = channelTasks.IsNullOrEmpty() ? null : channelTasks.Select(s => s.Result).ToList(),
                                                     StartTimeTBD = StartTimeTBD,
                                                     ParentStageId = ParentStageId?.ToString(),
                                                     AdditionalParentsIds = AdditionalParentsIds?.Select(s => s.ToString()).ToList()
            });
        }
Example #2
0
        /// <summary>
        /// Asynchronous export item's properties
        /// </summary>
        /// <returns>An <see cref="ExportableCI"/> instance containing all relevant properties</returns>
        public async Task <ExportableFixtureCI> ExportAsync()
        {
            var scheduledTasks = ScheduledStartTimeChanges?.Select(async s => await((ScheduledStartTimeChange)s).ExportAsync().ConfigureAwait(false));
            var channelTasks   = TvChannels?.Select(async c => await((TvChannel)c).ExportAsync().ConfigureAwait(false));

            return(new ExportableFixtureCI
            {
                ExtraInfo = ExtraInfo?.ToDictionary(i => i.Key, i => i.Value),
                CoverageInfo = CoverageInfo != null?await((CoverageInfo)CoverageInfo).ExportAsync().ConfigureAwait(false) : null,
                                   ProductInfo = ProductInfo != null?await((ProductInfo)ProductInfo).ExportAsync().ConfigureAwait(false) : null,
                                                     ReplacedBy = ReplacedBy?.ToString(),
                                                     References = References?.References?.ToDictionary(r => r.Key, r => r.Value),
                                                     NextLiveTime = NextLiveTime,
                                                     StartTimeConfirmed = StartTimeConfirmed,
                                                     ScheduledStartTimeChanges = scheduledTasks != null ? await Task.WhenAll(scheduledTasks) : null,
                                                     StartTime = StartTime,
                                                     TvChannels = channelTasks != null ? await Task.WhenAll(channelTasks) : null,
                                                     StartTimeTBD = StartTimeTBD
            });
        }
        public OBO_Typedef(List <KeyValuePair <string, string> > data = null)
        {
            if (data != null)
            {
                foreach (var datum in data)
                {
                    switch (datum.Key.ToLower())
                    {
                    case "id":
                        Id = datum.Value;
                        break;

                    case "is_anonymous":
                        IsAnonymous = Convert.ToBoolean(datum.Value);
                        break;

                    case "name":
                        Name = datum.Value;
                        break;

                    case "namespace":
                        Namespace = datum.Value;
                        break;

                    case "alt_id":
                        AltId.Add(datum.Value);
                        break;

                    case "def":
                        Def = datum.Value;
                        break;

                    case "comment":
                        Comment = datum.Value;
                        break;

                    case "subset":
                        Subset.Add(datum.Value);
                        break;

                    case "synonym":
                        Synonym.Add(datum.Value);
                        break;

                    case "xref":
                        XRef.Add(datum.Value);
                        break;

                    case "domain":
                        Domain = datum.Value;
                        break;

                    case "range":
                        Range = datum.Value;
                        break;

                    case "is_anti_symmetric":
                        IsAntiSymmetric = Convert.ToBoolean(datum.Value);
                        break;

                    case "is_cyclic":
                        IsCyclic = Convert.ToBoolean(datum.Value);
                        break;

                    case "is_reflexive":
                        IsReflexive = Convert.ToBoolean(datum.Value);
                        break;

                    case "is_symmetric":
                        IsSymmetric = Convert.ToBoolean(datum.Value);
                        break;

                    case "is_transitive":
                        IsTransitive = Convert.ToBoolean(datum.Value);
                        break;

                    case "is_a":
                        IsA.Add(datum.Value);
                        break;

                    case "inverse_of":
                        InverseOf = datum.Value;
                        break;

                    case "transitive_over":
                        TransitiveOver.Add(datum.Value);
                        break;

                    case "relationship":
                        Relationship.Add(datum.Value);
                        break;

                    case "is_obsolete":
                        IsObsolete = Convert.ToBoolean(datum.Value);
                        break;

                    case "replaced_by":
                        ReplacedBy.Add(datum.Value);
                        break;

                    case "consider":
                        Consider.Add(datum.Value);
                        break;

                    case "created_by":
                        CreatedBy = datum.Value;
                        break;

                    case "creation_date":
                        CreationDate = datum.Value;
                        break;

                    default:
                        break;
                    }
                }
            }
        }
        public OBO_Instance(List <KeyValuePair <string, string> > data = null)
        {
            if (data != null)
            {
                foreach (var datum in data)
                {
                    switch (datum.Key.ToLower())
                    {
                    case "id":
                        Id = datum.Value;
                        break;

                    case "is_anonymous":
                        IsAnonymous = Convert.ToBoolean(datum.Value);
                        break;

                    case "name":
                        Name = datum.Value;
                        break;

                    case "namespace":
                        Namespace = datum.Value;
                        break;

                    case "alt_id":
                        AltId.Add(datum.Value);
                        break;

                    case "comment":
                        Comment = datum.Value;
                        break;

                    case "synonym":
                        Synonym.Add(datum.Value);
                        break;

                    case "xref":
                        XRef.Add(datum.Value);
                        break;

                    case "instance_of":
                        InstanceOf = datum.Value;
                        break;

                    case "property_value":
                        Property_Value.Add(datum.Value);
                        break;

                    case "is_obsolete":
                        IsObsolete = Convert.ToBoolean(datum.Value);
                        break;

                    case "replaced_by":
                        ReplacedBy.Add(datum.Value);
                        break;

                    case "consider":
                        Consider.Add(datum.Value);
                        break;

                    default:
                        break;
                    }
                }
            }
        }
Example #5
0
            public OBO_Term(List <KeyValuePair <string, string> > data = null)
            {
                if (data != null)
                {
                    foreach (var datum in data)
                    {
                        switch (datum.Key.ToLower())
                        {
                        case "id":
                            Id = datum.Value;
                            break;

                        case "is_anonymous":
                            IsAnonymous = Convert.ToBoolean(datum.Value);
                            break;

                        case "name":
                            Name = datum.Value;
                            break;

                        case "namespace":
                            Namespace = datum.Value;
                            break;

                        case "alt_id":
                            AltId.Add(datum.Value);
                            break;

                        case "def":
                            Def = datum.Value;
                            break;

                        case "comment":
                            Comment = datum.Value;
                            break;

                        case "subset":
                            Subset.Add(datum.Value);
                            break;

                        case "synonym":
                            Synonym.Add(datum.Value);
                            break;

                        case "xref":
                            XRef.Add(datum.Value);
                            break;

                        case "is_a":
                            IsA.Add(datum.Value);
                            break;

                        case "intersection_of":
                            IntersectionOf.Add(datum.Value);
                            break;

                        case "union_of":
                            UnionOf.Add(datum.Value);
                            break;

                        case "disjoint_from":
                            DisjointFrom.Add(datum.Value);
                            break;

                        case "relationship":
                            Relationship.Add(datum.Value);
                            break;

                        case "is_obsolete":
                            IsObsolete = Convert.ToBoolean(datum.Value);
                            break;

                        case "replaced_by":
                            ReplacedBy.Add(datum.Value);
                            break;

                        case "consider":
                            Consider.Add(datum.Value);
                            break;

                        case "created_by":
                            CreatedBy = datum.Value;
                            break;

                        case "creation_date":
                            CreationDate = datum.Value;
                            break;

                        default:
                            break;
                        }
                    }
                }
            }