internal static DefinitionLocatorRelationshipInfo CreateObj(string label, string priority, float origOrder, float orderArg, string prefLabel, bool isProhibited, string targetRole, bool?isClosed, bool?isUsable, bool?isall, bool?isScenario, bool?isRequiresElement, bool?isDefault, DimensionNode.NodeType nodeType) { DefinitionLocatorRelationshipInfo obj = new DefinitionLocatorRelationshipInfo(); obj.Label = label; obj.IsProhibited = isProhibited; obj.PrefLabel = prefLabel; obj.Order = orderArg; obj.OrigOrder = origOrder; obj.Priority = Convert.ToInt32(priority); obj.NodeInfo = DefinitionNodeInfoBase.CreateDefinitionNodeInfo(isClosed, isUsable, isall, isScenario, isDefault, isRequiresElement, targetRole, nodeType); if (prefLabel != null) { int lastSlash = prefLabel.LastIndexOf("/") + 1; obj.PrefLabel = prefLabel.Substring(lastSlash, prefLabel.Length - lastSlash); } return(obj); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { DefinitionNodeInfoBase other = obj as DefinitionNodeInfoBase; if (this.NodeType != other.NodeType) { return(false); } if (!string.Equals(this.TargetRole, other.TargetRole)) { return(false); } return(base.Equals(obj)); }
/// <summary> /// Creates a new instance of <see cref="DefinitionLocatorRelationshipInfo"/>. /// </summary> public DefinitionLocatorRelationshipInfo(DimensionNode.NodeType nodeType) { switch (nodeType) { case DimensionNode.NodeType.Dimension: this.NodeInfo = new DefinitionNodeInfoDimension(null); break; case DimensionNode.NodeType.Hypercube: this.NodeInfo = new DefinitionNodeInfoHypercube(); break; case DimensionNode.NodeType.Item: this.NodeInfo = new DefinitionNodeInfoMember(); break; } }
/// <summary> /// /// </summary> /// <param name="isClosed"></param> /// <param name="isUsable"></param> /// <param name="isall"></param> /// <param name="isScenario"></param> /// <param name="isDefault"></param> /// <param name="isRequired"></param> /// <param name="targetRole"></param> /// <param name="nodeType"></param> /// <returns></returns> public static DefinitionNodeInfoBase CreateDefinitionNodeInfo(bool?isClosed, bool?isUsable, bool?isall, bool?isScenario, bool?isDefault, bool?isRequired, string targetRole, DimensionNode.NodeType nodeType) { DefinitionNodeInfoBase ret = null; switch (nodeType) { case DimensionNode.NodeType.Dimension: ret = new DefinitionNodeInfoDimension(targetRole); break; case DimensionNode.NodeType.Hypercube: ret = new DefinitionNodeInfoHypercube(isClosed, isall, isScenario, targetRole); break; case DimensionNode.NodeType.Item: ret = new DefinitionNodeInfoMember(isUsable, isDefault, isRequired, targetRole); break; } return(ret); }
/// <summary> /// Creates a new instance of <see cref="DefinitionLocatorRelationshipInfo"/> /// and initializes its properties from a parameter-supplied <see cref="DefinitionLocatorRelationshipInfo"/> /// </summary> /// <param name="orig"></param> public DefinitionLocatorRelationshipInfo(DefinitionLocatorRelationshipInfo orig) : base(orig) { this.NodeInfo = orig.NodeInfo.CreateCopy(); }