public static bool IsSameRmType(string rmTypeName, IRmType rmObject) { Check.Require(rmObject != null, string.Format(CommonStrings.XMustNotBeNull, "rmObject")); Check.Require(!string.IsNullOrEmpty(rmTypeName), string.Format(CommonStrings.XMustNotBeNullOrEmpty, "rmTypeName")); string actualTypeName = rmObject.GetRmTypeName(); if (rmTypeName == actualTypeName) { return(true); } Type actualRmType = rmObject.GetType(); while (actualRmType != null && actualRmType != typeof(RmType)) { actualTypeName = RmFactory.GetRmTypeName(actualRmType); if (actualTypeName == rmTypeName) { return(true); } if (actualTypeName != null) { actualRmType = actualRmType.BaseType; } else { actualRmType = null; } } return(false); }
static public ObjectRef ObjectRef(HierObjectId contributionUid, HierObjectId systemId) { return(new ObjectRef(contributionUid, systemId.Value, RmFactory.GetRmTypeName(typeof(Contribution)))); }