예제 #1
0
        internal override void parseJObject(JObject obj)
        {
            base.parseJObject(obj);
            Identification = extractString(obj.GetValue("Idenfification", StringComparison.InvariantCultureIgnoreCase));
            Name           = extractString(obj.GetValue("Name", StringComparison.InvariantCultureIgnoreCase));
            Description    = extractString(obj.GetValue("Description", StringComparison.InvariantCultureIgnoreCase));
            DocumentReferences.AddRange(mDatabase.extractJArray <IfcDocumentReference>(obj.GetValue("DocumentReferences", StringComparison.InvariantCultureIgnoreCase) as JArray));
            Location = extractString(obj.GetValue("Location", StringComparison.InvariantCultureIgnoreCase));
            Purpose  = extractString(obj.GetValue("Purpose", StringComparison.InvariantCultureIgnoreCase));
            Revision = extractString(obj.GetValue("Revision", StringComparison.InvariantCultureIgnoreCase));
            JObject jobj = obj["DocumentOwner"] as JObject;

            if (jobj != null)
            {
                DocumentOwner = mDatabase.ParseJObject <IfcActorSelect>(jobj);
            }
            Editors.AddRange(mDatabase.extractJArray <IfcActorSelect>(obj.GetValue("Editors", StringComparison.InvariantCultureIgnoreCase) as JArray));
            JToken token = obj.GetValue("CreationTime");

            if (token != null)
            {
                CreationTime = DateTime.Parse(token.Value <string>());
            }
            token = obj.GetValue("LastRevisionTime");
            if (token != null)
            {
                LastRevisionTime = DateTime.Parse(token.Value <string>());
            }
            ElectronicFormat = extractString(obj.GetValue("ElectronicFormat", StringComparison.InvariantCultureIgnoreCase));
            token            = obj.GetValue("ValidFrom");
            if (token != null)
            {
                ValidFrom = DateTime.Parse(token.Value <string>());
            }
            token = obj.GetValue("ValidUntil");
            if (token != null)
            {
                ValidUntil = DateTime.Parse(token.Value <string>());
            }
            token = obj.GetValue("Confidentiality");
            if (token != null)
            {
                Enum.TryParse <IfcDocumentConfidentialityEnum>(token.Value <string>(), true, out mConfidentiality);
            }
            token = obj.GetValue("Status");
            if (token != null)
            {
                Enum.TryParse <IfcDocumentStatusEnum>(token.Value <string>(), true, out mStatus);
            }
        }
예제 #2
0
        internal override void parse(string str, ref int pos, ReleaseVersion release, int len, ConcurrentDictionary <int, BaseClassIfc> dictionary)
        {
            mIdentification = ParserIfc.Decode(ParserSTEP.StripString(str, ref pos, len));
            mName           = ParserIfc.Decode(ParserSTEP.StripString(str, ref pos, len));
            mDescription    = ParserIfc.Decode(ParserSTEP.StripString(str, ref pos, len));
            if (release < ReleaseVersion.IFC4)
            {
                DocumentReferences.AddRange(ParserSTEP.StripListLink(str, ref pos, len).Select(x => dictionary[x] as IfcDocumentReference));
            }
            else
            {
                mLocation = ParserIfc.Decode(ParserSTEP.StripString(str, ref pos, len));
            }
            mPurpose       = ParserSTEP.StripString(str, ref pos, len);
            mIntendedUse   = ParserSTEP.StripString(str, ref pos, len);
            mScope         = ParserSTEP.StripString(str, ref pos, len);
            mRevision      = ParserSTEP.StripString(str, ref pos, len);
            mDocumentOwner = dictionary[ParserSTEP.StripLink(str, ref pos, len)] as IfcActorSelect;
            Editors.AddRange(ParserSTEP.StripListLink(str, ref pos, len).Select(x => dictionary[x] as IfcActorSelect));
            mCreationTime     = IfcDateTime.ParseSTEP(ParserSTEP.StripField(str, ref pos, len));
            mLastRevisionTime = IfcDateTime.ParseSTEP(ParserSTEP.StripField(str, ref pos, len));
            if (release < ReleaseVersion.IFC4)
            {
                mSSElectronicFormat = dictionary[ParserSTEP.StripLink(str, ref pos, len)] as IfcDocumentElectronicFormat;
            }
            else
            {
                mElectronicFormat = ParserSTEP.StripString(str, ref pos, len);
            }
            mValidFrom  = IfcDate.ParseSTEP(ParserSTEP.StripField(str, ref pos, len));
            mValidUntil = IfcDate.ParseSTEP(ParserSTEP.StripField(str, ref pos, len));
            string s = ParserSTEP.StripField(str, ref pos, len);

            if (s[0] == '.')
            {
                Enum.TryParse <IfcDocumentConfidentialityEnum>(s.Replace(".", ""), true, out mConfidentiality);
            }
            s = ParserSTEP.StripField(str, ref pos, len);
            if (s[0] == '.')
            {
                Enum.TryParse <IfcDocumentStatusEnum>(s.Replace(".", ""), true, out mStatus);
            }
        }
예제 #3
0
        public IndexStorage(Index index, TransactionContextPool contextPool, DocumentDatabase database)
        {
            _index           = index;
            _contextPool     = contextPool;
            DocumentDatabase = database;
            _logger          = LoggingSource.Instance.GetLogger <IndexStorage>(DocumentDatabase.Name);

            var referencedCollections = index.GetReferencedCollections();

            if (referencedCollections != null)
            {
                _referencedCollections = referencedCollections
                                         .SelectMany(x => x.Value)
                                         .Distinct()
                                         .ToDictionary(x => x.Name, x => x, StringComparer.OrdinalIgnoreCase);
            }

            ReferencesForDocuments       = new DocumentReferences();
            ReferencesForCompareExchange = new CompareExchangeReferences();
        }
예제 #4
0
        public SearchPageState SaveState()
        {
            var state = new SearchPageState()
            {
                SearchResultInfo = this.SearchResultInfo
            };

            if (null != QueryParameter)
            {
                state.QueryParameter = QueryParameter;
            }

            if (null != DocumentReferences)
            {
                state.DocumentReferencesList = DocumentReferences.ToList();
                state.Hits     = DocumentReferences.Hits;
                state.Page     = DocumentReferences.Page;
                state.PageSize = DocumentReferences.PageSize;
            }

            return(state);
        }