示例#1
0
        public ProfileColumn(
            string propertyName,
            PropertyTypePredefined predefined,
            PropertyPrimitiveType primitiveType,
            int?propertyTypeId = null)
        {
            if (string.IsNullOrEmpty(propertyName))
            {
                throw new ArgumentNullException(nameof(propertyName));
            }

            if (propertyTypeId.HasValue && propertyTypeId.Value < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(propertyTypeId));
            }

            if (primitiveType == PropertyPrimitiveType.Image)
            {
                throw new ArgumentException("Image columns are currently not supported.");
            }

            PropertyName   = propertyName;
            PropertyTypeId = propertyTypeId;
            Predefined     = predefined;
            PrimitiveType  = primitiveType;
        }
 public static bool IsFake(this PropertyTypePredefined propertyTypePredefined)
 {
     return((propertyTypePredefined == PropertyTypePredefined.CreatedBy) ||
            (propertyTypePredefined == PropertyTypePredefined.CreatedOn) ||
            (propertyTypePredefined == PropertyTypePredefined.LastEditedBy) ||
            (propertyTypePredefined == PropertyTypePredefined.LastEditedOn));
 }
 /// <summary>
 ///
 /// </summary>
 public static bool IsVisibleInApi(this PropertyTypePredefined propertyTypePredefined)
 {
     return((((int)PropertyTypePredefined.GroupMask & (int)propertyTypePredefined) == (int)PropertyTypePredefined.CustomGroup) ||
            (propertyTypePredefined == PropertyTypePredefined.ID) ||
            (propertyTypePredefined == PropertyTypePredefined.Name) ||
            (propertyTypePredefined == PropertyTypePredefined.Description) ||
            (propertyTypePredefined == PropertyTypePredefined.UseCaseLevel) ||
            (propertyTypePredefined == PropertyTypePredefined.CreatedBy) ||
            (propertyTypePredefined == PropertyTypePredefined.CreatedOn) ||
            (propertyTypePredefined == PropertyTypePredefined.LastEditedBy) ||
            (propertyTypePredefined == PropertyTypePredefined.LastEditedOn));
 }
        public ReconcileProperty GetCorrespondingReconcileProperty(PropertyTypePredefined propertyTypePredefined, ItemTypePredefined artifacTypePredefined)
        {
            if (propertyTypePredefined == PropertyTypePredefined.Name)
            {
                return(ReconcileProperty.Name);
            }

            return(_typePredefineds
                   .Where(pair => pair.Key.Item2 == artifacTypePredefined && pair.Value.Contains(propertyTypePredefined))
                   .Select(pair => pair.Key.Item1)
                   .FirstOrDefault());
        }
        public bool IsInternalSystemProperty(PropertyTypePredefined propertyTypePredefined,
                                             ItemTypePredefined itemTypePredefined)
        {
            if (propertyTypePredefined == PropertyTypePredefined.Description)
            {
                return(false);
            }

            return
                (_typePredefineds.Where(pair => pair.Value.Contains(propertyTypePredefined))
                 .Select(pair => pair.Key)
                 .All(mapKey => mapKey.Item2 != null && mapKey.Item2 != itemTypePredefined));
        }
        private int?GetInstancePropertyTypeId(int?instancePropertyTypeId, PropertyTypePredefined predefined)
        {
            switch (predefined)
            {
            case PropertyTypePredefined.Name:
                return(WorkflowConstants.PropertyTypeFakeIdName);

            case PropertyTypePredefined.Description:
                return(WorkflowConstants.PropertyTypeFakeIdDescription);

            default:
                return(instancePropertyTypeId);
            }
        }
        // Reuse Sensitivity

        public void RegisterArtifactPropertyModification(int artifactItemId, int propertyTypeId, PropertyTypePredefined predefined)
        {
            var modifications = GetOrCreateArtifactModifications(artifactItemId);

            modifications.RegisterArtifactPropertyModification(propertyTypeId, predefined);
        }
 public void RegisterArtifactPropertyModification(int propertyTypeId, PropertyTypePredefined predefined)
 {
     _modifiedPropertiesHolder.Value.Add(new PropertyTypeInfo(propertyTypeId, predefined));
 }
 public static bool IsVisualization(this PropertyTypePredefined propertyTypePredefined)
 {
     return(((int)PropertyTypePredefined.GroupMask & (int)propertyTypePredefined) == (int)PropertyTypePredefined.VisualizationGroup);
 }
 /// <summary>
 ///
 /// </summary>
 public static bool IsAvailableForDefaultTemplateValue(this PropertyTypePredefined propertyTypePredefined)
 {
     return(propertyTypePredefined == PropertyTypePredefined.Description);
 }
 public static bool IsSystem(this PropertyTypePredefined propertyTypePredefined)
 {
     return(((int)PropertyTypePredefined.GroupMask & (int)propertyTypePredefined) == (int)PropertyTypePredefined.SystemGroup);
 }
 private static KeyValuePair <MapKey, IEnumerable <PropertyTypePredefined> > Entry(
     ReconcileProperty reconcileProperty, ItemTypePredefined itemTypePredefined, PropertyTypePredefined propertyTypePredefined)
 {
     return(new KeyValuePair <MapKey, IEnumerable <PropertyTypePredefined> >(new MapKey(reconcileProperty, itemTypePredefined), Enumerable.Repeat(propertyTypePredefined, 1)));
 }
示例#13
0
 public bool PredefinedMatches(PropertyTypePredefined predefined)
 {
     return(!_columns.IsEmpty() && _columns.Any(column => column.Predefined == predefined));
 }