Example #1
0
        public void RemoveUnusedContexts()
        {
            var usedIds    = new HashSet <string>();
            var contextIds = Facts.
                             Where(f => f.Context != null).
                             Select(f => f.Context.Id).
                             Concat(FilingIndicators.Select(f => f.ContextRef)).
                             Distinct().
                             ToList();

            usedIds.UnionWith(contextIds);

            GetUsedContexts(Facts, usedIds);

            Contexts.RemoveUnusedItems(usedIds);
        }
Example #2
0
        public bool Equals(Instance other)
        {
            var result = false;

            if (other != null)
            {
                if (SchemaReference.Equals(other.SchemaReference))
                {
                    if (Units.Equals(other.Units))
                    {
                        if (FilingIndicators.Equals(other.FilingIndicators))
                        {
                            if (Contexts.Equals(other.Contexts))
                            {
                                result |= Facts.Equals(other.Facts);
                            }
                        }
                    }
                }
            }

            return(result);
        }
Example #3
0
 public FilingIndicator AddFilingIndicator(Context context, string value, bool filed)
 {
     return(FilingIndicators.Add(context, value, filed));
 }
Example #4
0
 public override int GetHashCode()
 {
     return(SchemaReference.GetHashCode()
            ^ Units.GetHashCode()
            ^ FilingIndicators.GetHashCode());
 }