Example #1
0
 internal IfcOwnerHistory OwnerHistory(IfcChangeActionEnum changeAction)
 {
     if (changeAction == IfcChangeActionEnum.ADDED)
     {
         if (mOwnerHistoryCreate == null)
         {
             mOwnerHistoryCreate = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.ADDED);
         }
         return(mOwnerHistoryCreate);
     }
     if (changeAction == IfcChangeActionEnum.DELETED)
     {
         if (mOwnerHistoryDelete == null)
         {
             mOwnerHistoryDelete = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.DELETED);
         }
         return(mOwnerHistoryDelete);
     }
     if (changeAction == IfcChangeActionEnum.MODIFIED)
     {
         if (mOwnerHistoryModify == null)
         {
             mOwnerHistoryModify = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.MODIFIED);
         }
         return(mOwnerHistoryModify);
     }
     return(null);
 }
Example #2
0
		public IfcOwnerHistory(IfcPersonAndOrganization po, IfcApplication app, IfcChangeActionEnum ca) : base(po.mDatabase)
		{
			mOwningUser = po.mIndex;
			mOwningApplication = app.mIndex;
			mState = IfcStateEnum.NA;
			mChangeAction = ca;
			TimeSpan ts = DateTime.Now.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0);
			mCreationDate = (int)ts.TotalSeconds;
			mLastModifiedDate = (int)ts.TotalSeconds;
		}
Example #3
0
 public IfcOwnerHistory(IfcPersonAndOrganization __OwningUser, IfcApplication __OwningApplication, IfcStateEnum?__State, IfcChangeActionEnum __ChangeAction, IfcTimeStamp?__LastModifiedDate, IfcPersonAndOrganization __LastModifyingUser, IfcApplication __LastModifyingApplication, IfcTimeStamp __CreationDate)
 {
     this._OwningUser               = __OwningUser;
     this._OwningApplication        = __OwningApplication;
     this._State                    = __State;
     this._ChangeAction             = __ChangeAction;
     this._LastModifiedDate         = __LastModifiedDate;
     this._LastModifyingUser        = __LastModifyingUser;
     this._LastModifyingApplication = __LastModifyingApplication;
     this._CreationDate             = __CreationDate;
 }
Example #4
0
 internal IfcOwnerHistory(IfcOwnerHistory o) : base()
 {
     mOwningUser               = o.mOwningUser;
     mOwningApplication        = o.mOwningApplication;
     mState                    = o.mState;
     mChangeAction             = o.mChangeAction;
     mLastModifiedDate         = o.mLastModifiedDate;
     mLastModifyingUser        = o.mLastModifyingUser;
     mLastModifyingApplication = o.mLastModifyingApplication;
     mCreationDate             = o.mCreationDate;
 }
Example #5
0
        internal IfcOwnerHistory OwnerHistory(IfcChangeActionEnum changeAction)
        {
            if (mOwnerHistories.ContainsKey(changeAction))
            {
                return(mOwnerHistories[changeAction]);
            }
            IfcOwnerHistory result = new IfcOwnerHistory(PersonOrganization, Application, changeAction);

            mOwnerHistories.Add(changeAction, result);
            return(result);
        }
Example #6
0
 internal IfcOwnerHistory(DatabaseIfc db, IfcOwnerHistory o) : base(db)
 {
     OwningUser                = db.Factory.Duplicate(o.OwningUser) as IfcPersonAndOrganization;
     OwningApplication         = db.Factory.Duplicate(o.OwningApplication) as IfcApplication;
     mState                    = o.mState;
     mChangeAction             = o.mChangeAction;
     mLastModifiedDate         = o.mLastModifiedDate;
     mLastModifyingUser        = o.mLastModifyingUser;
     mLastModifyingApplication = o.mLastModifyingApplication;
     mCreationDate             = o.mCreationDate;
 }
Example #7
0
 public IfcOwnerHistory(IfcPersonAndOrganization owningUser, IfcApplication owningApplication, IfcStateEnum state, IfcChangeActionEnum changeAction, IfcTimeStamp lastModifiedDate, IfcPersonAndOrganization lastModifyingUser, IfcApplication lastModifyingApplication, IfcTimeStamp creationDate) : base()
 {
     OwningUser               = owningUser;
     OwningApplication        = owningApplication;
     State                    = state;
     ChangeAction             = changeAction;
     LastModifiedDate         = lastModifiedDate;
     LastModifyingUser        = lastModifyingUser;
     LastModifyingApplication = lastModifyingApplication;
     CreationDate             = creationDate;
 }
Example #8
0
        internal IfcOwnerHistory(IfcPersonAndOrganization po, IfcApplication app, IfcChangeActionEnum ca) : base(po.mDatabase)
        {
            mOwningUser        = po.mIndex;
            mOwningApplication = app.mIndex;
            mState             = IfcStateEnum.NA;
            mChangeAction      = ca;
            TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0);

            //if(ca == IfcChangeActionEnum.ADDED)
            mCreationDate = (int)ts.TotalSeconds;
            //if (ca != IfcChangeActionEnum.NOTDEFINED)
            mLastModifiedDate = (int)ts.TotalSeconds;
        }
        public OwnerHistory(IfcStore model, PersonOrgRelation personOrgRelation, Application application, IfcChangeActionEnum changeAction, int creationDate)
        {
            ifcOwnerHistory = model.Instances.New <IfcOwnerHistory>(p =>
            {
                p.OwningUser        = personOrgRelation.PersonAndOrganization;
                p.OwningApplication = application.IfcApplication;
                p.ChangeAction      = changeAction;
                p.CreationDate      = creationDate;
            });

            this.personOrgRelation = personOrgRelation;
            this.application       = application;
            this.changeAction      = changeAction;
            this.creationDate      = creationDate;
        }
Example #10
0
        public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _owningUser = (IfcPersonAndOrganization)value.EntityVal;
                break;

            case 1:
                _owningApplication = (IfcApplication)value.EntityVal;
                break;

            case 2:
                _state = (IfcStateEnum?)Enum.Parse(typeof(IfcStateEnum), value.EnumVal, true);
                break;

            case 3:
                _changeAction = (IfcChangeActionEnum)Enum.Parse(typeof(IfcChangeActionEnum), value.EnumVal, true);
                break;

            case 4:
                _lastModifiedDate = value.IntegerVal;
                break;

            case 5:
                _lastModifyingUser = (IfcPersonAndOrganization)value.EntityVal;
                break;

            case 6:
                _lastModifyingApplication = (IfcApplication)value.EntityVal;
                break;

            case 7:
                _creationDate = value.IntegerVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Example #11
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _owningUser = (IfcPersonAndOrganization)(value.EntityVal);
                return;

            case 1:
                _owningApplication = (IfcApplication)(value.EntityVal);
                return;

            case 2:
                _state = (IfcStateEnum)System.Enum.Parse(typeof(IfcStateEnum), value.EnumVal, true);
                return;

            case 3:
                _changeAction = (IfcChangeActionEnum)System.Enum.Parse(typeof(IfcChangeActionEnum), value.EnumVal, true);
                return;

            case 4:
                _lastModifiedDate = value.IntegerVal;
                return;

            case 5:
                _lastModifyingUser = (IfcPersonAndOrganization)(value.EntityVal);
                return;

            case 6:
                _lastModifyingApplication = (IfcApplication)(value.EntityVal);
                return;

            case 7:
                _creationDate = value.IntegerVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Example #12
0
		internal IfcOwnerHistory OwnerHistory(IfcChangeActionEnum changeAction)
		{
			if(changeAction == IfcChangeActionEnum.ADDED)
			{
				if (mOwnerHistoryCreate == null)
					mOwnerHistoryCreate = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.ADDED);
				return mOwnerHistoryCreate;
			}
			if(changeAction == IfcChangeActionEnum.DELETED)
			{
				if (mOwnerHistoryDelete == null)
					mOwnerHistoryDelete = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.DELETED);
				return mOwnerHistoryDelete;
			}
			if(changeAction == IfcChangeActionEnum.MODIFIED)
			{
				if (mOwnerHistoryModify == null)
					mOwnerHistoryModify = new IfcOwnerHistory(PersonOrganization, Application, IfcChangeActionEnum.MODIFIED);
				return mOwnerHistoryModify;
			}
			return null;
		}
Example #13
0
		internal IfcOwnerHistory(IfcOwnerHistory o) : base()
		{
			mOwningUser = o.mOwningUser;
			mOwningApplication = o.mOwningApplication;
			mState = o.mState;
			mChangeAction = o.mChangeAction;
			mLastModifiedDate = o.mLastModifiedDate;
			mLastModifyingUser = o.mLastModifyingUser;
			mLastModifyingApplication = o.mLastModifyingApplication;
			mCreationDate = o.mCreationDate;
		}
Example #14
0
 internal IfcOwnerHistory OwnerHistory(IfcChangeActionEnum changeAction)
 {
     if (mOwnerHistories.ContainsKey(changeAction))
         return mOwnerHistories[changeAction];
     IfcOwnerHistory result = new IfcOwnerHistory(PersonOrganization, Application, changeAction);
     mOwnerHistories.Add(changeAction, result);
     return result;
 }
Example #15
0
		internal IfcOwnerHistory(IfcPersonAndOrganization po, IfcApplication app, IfcChangeActionEnum ca) : base(po.mDatabase)
		{
			mOwningUser = po.mIndex;
			mOwningApplication = app.mIndex;
			mState = IfcStateEnum.NA;
			mChangeAction = ca;
			TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0);
			//if(ca == IfcChangeActionEnum.ADDED)
			mCreationDate = (int)ts.TotalSeconds;
			//if (ca != IfcChangeActionEnum.NOTDEFINED)
			mLastModifiedDate = (int)ts.TotalSeconds;
		}
Example #16
0
        public static IfcOwnerHistory NewIfc4OwnerHistoryEntry(this IfcStore s, string version, IfcChangeActionEnum change = IfcChangeActionEnum.ADDED)
        {
            var newEntry = s.Instances.New <IfcOwnerHistory>();

            newEntry.ChangeAction = change;
            var dateTime = (IfcTimeStamp)DateTime.Now;

            newEntry.CreationDate      = dateTime;
            newEntry.LastModifiedDate  = dateTime;
            newEntry.OwningUser        = s.DefaultOwningUser as IfcPersonAndOrganization;
            newEntry.OwningApplication = s.DefaultOwningApplication as IfcApplication;
            return(newEntry);
        }
 public virtual void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _owningUser = (IfcPersonAndOrganization) value.EntityVal;
             break;
         case 1:
             _owningApplication = (IfcApplication) value.EntityVal;
             break;
         case 2:
             _state = (IfcStateEnum?) Enum.Parse(typeof (IfcStateEnum), value.EnumVal, true);
             break;
         case 3:
             _changeAction = (IfcChangeActionEnum) Enum.Parse(typeof (IfcChangeActionEnum), value.EnumVal, true);
             break;
         case 4:
             _lastModifiedDate = value.IntegerVal;
             break;
         case 5:
             _lastModifyingUser = (IfcPersonAndOrganization) value.EntityVal;
             break;
         case 6:
             _lastModifyingApplication = (IfcApplication) value.EntityVal;
             break;
         case 7:
             _creationDate = value.IntegerVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Example #18
0
        private IfcOwnerHistory GetNewOwnerHistory(IfcChangeActionEnum changeAction)
        {
            //existing default owner history
            IfcOwnerHistory defOwner = Model.OwnerHistoryAddObject as IfcOwnerHistory;
            IfcTimeStamp stamp = IfcTimeStamp.ToTimeStamp(DateTime.Now);

            //return new object
            return Model.Instances.New<IfcOwnerHistory>(h => { h.OwningUser = defOwner.OwningUser; h.OwningApplication = defOwner.OwningApplication; h.CreationDate = stamp; h.ChangeAction = changeAction; });
        }
Example #19
0
        private IfcOwnerHistory NewOwnerHistoryEntry(string version, IfcChangeActionEnum change)
        {
            IfcOwnerHistory newVersion = Store.NewIfc4OwnerHistoryEntry(version, change);

            return(newVersion);
        }