当前位置: 首页>>代码示例>>C#>>正文


C# IConceptInfo.GetUserDescription方法代码示例

本文整理汇总了C#中IConceptInfo.GetUserDescription方法的典型用法代码示例。如果您正苦于以下问题:C# IConceptInfo.GetUserDescription方法的具体用法?C# IConceptInfo.GetUserDescription怎么用?C# IConceptInfo.GetUserDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IConceptInfo的用法示例。


在下文中一共展示了IConceptInfo.GetUserDescription方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ValidatePropertyListSyntax

        public static void ValidatePropertyListSyntax(string dslList, IConceptInfo errorContext)
        {
            var errorHeader = new Lazy<string>(() =>
                "Invalid format of list '" + dslList + "' in '" + errorContext.GetUserDescription() + "': ");

            if (string.IsNullOrWhiteSpace(dslList))
                throw new DslSyntaxException(errorHeader.Value + "The list is empty.");

            if (dslList.Contains(',') || dslList.Contains(';'))
                throw new DslSyntaxException(errorHeader.Value + "Property names in the list must be separated with spaces.");

            if (dslList.Contains('.'))
                throw new DslSyntaxException(errorHeader.Value + "The list must contain only property names, without data structure or entity names (or dot character).");

            // Ensure uniqueness of the concept's key. There should not exists different instances of SqlIndexMultiple that generate same index in database.
            if (dslList.Contains("  "))
                throw new DslSyntaxException(errorHeader.Value + "Property names in the list must be separated by single space character. Verify that there are no multiple spaces.");
            if (dslList.StartsWith(" "))
                throw new DslSyntaxException(errorHeader.Value + "The list of property names must not start with a space character.");
            if (dslList.EndsWith(" "))
                throw new DslSyntaxException(errorHeader.Value + "The list of property names must not end with a space character.");
        }
开发者ID:koav,项目名称:Rhetos,代码行数:22,代码来源:DslUtility.cs

示例2: GetDependsOnWriteableDataStructure

        private static void GetDependsOnWriteableDataStructure(DataStructureInfo dataStructure, List<DataStructureInfo> dependencies, IEnumerable<IConceptInfo> allConcepts, IConceptInfo errorContext, HashSet<string> done)
        {
            var conceptKey = dataStructure.GetKey();
            if (done.Contains(conceptKey))
                return;
            done.Add(conceptKey);

            if (dataStructure is EntityInfo)
                dependencies.Add(dataStructure);
            else if (dataStructure is SqlQueryableInfo)
            {
                var deps = allConcepts.OfType<SqlDependsOnDataStructureInfo>().Where(dep => dep.Dependent == dataStructure).ToArray();
                foreach (var dep in deps)
                    GetDependsOnWriteableDataStructure(dep.DependsOn, dependencies, allConcepts, errorContext, done);
            }
            else
                throw new DslSyntaxException(errorContext.GetKeywordOrTypeName()
                    + " is not supported on dependency type '" + dataStructure.GetKeywordOrTypeName() + "'. "
                    + errorContext.GetUserDescription() + " depends on " + dataStructure.GetUserDescription() + ".");
        }
开发者ID:koav,项目名称:Rhetos,代码行数:20,代码来源:HierarchyInfo.cs

示例3: DslSyntaxException

 public DslSyntaxException(IConceptInfo concept, string additionalMessage, Exception inner)
     : base(concept.GetUserDescription() + ": " + additionalMessage, inner)
 {
 }
开发者ID:tjakopovic,项目名称:Rhetos,代码行数:4,代码来源:DslSyntaxException.cs

示例4: AddReferencesBeforeConcept

 private static void AddReferencesBeforeConcept(IConceptInfo concept, List<IConceptInfo> sortedList, Dictionary<IConceptInfo, bool> processed)
 {
     if (!processed.ContainsKey(concept))
         throw new FrameworkException(string.Format(
             "Unexpected inner state: Referenced concept {0} is not found in list of all concepts.",
             concept.GetUserDescription()));
     if (processed[concept]) // eliminates duplication of referenced concepts and stops circular references from infinite recursion
         return;
     processed[concept] = true;
     foreach (ConceptMember member in ConceptMembers.Get(concept))
         if (member.IsConceptInfo)
             AddReferencesBeforeConcept((IConceptInfo)member.GetValue(concept), sortedList, processed);
     sortedList.Add(concept);
 }
开发者ID:koav,项目名称:Rhetos,代码行数:14,代码来源:DslContainer.cs

示例5: ReportErrorContext

 protected string ReportErrorContext(IConceptInfo conceptInfo, int index)
 {
     var sb = new StringBuilder();
     sb.AppendLine(_dslSource.ReportError(index));
     if (conceptInfo != null)
     {
         sb.AppendFormat("Previous concept: {0}", conceptInfo.GetUserDescription()).AppendLine();
         var properties = conceptInfo.GetType().GetProperties().ToList();
         properties.ForEach(it =>
             sb.AppendFormat("Property {0} ({1}) = {2}",
                 it.Name,
                 it.PropertyType.Name,
                 it.GetValue(conceptInfo, null) ?? "<null>")
                 .AppendLine());
     }
     return sb.ToString();
 }
开发者ID:koav,项目名称:Rhetos,代码行数:17,代码来源:DslParser.cs

示例6: CreateNewConcepts

        internal static IList<IConceptInfo> CreateNewConcepts(
            BrowseDataStructureInfo browse, string path, string newPropertyName,
            IEnumerable<IConceptInfo> existingConcepts, IConceptInfo errorContext)
        {
            var newConcepts = new List<IConceptInfo>();

            ValueOrError<PropertyInfo> sourceProperty = GetSelectedPropertyByPath(browse, path, existingConcepts);
            if (sourceProperty.IsError)
                return null; // Creating the browse property may be delayed for other macro concepts to generate the needed properties. If this condition is not resolved, the CheckSemantics function below will throw an exception.

            if (!IsValidIdentifier(newPropertyName))
                throw new DslSyntaxException(string.Format(
                    "Invalid format of {0}: Property name '{1}' is not a valid identifier. Specify a valid name before the path to override the generated name.",
                    errorContext.GetUserDescription(),
                    newPropertyName));

            var cloneMethod = typeof(object).GetMethod("MemberwiseClone", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
            var browseProperty = (PropertyInfo)cloneMethod.Invoke(sourceProperty.Value, null);
            browseProperty.DataStructure = browse;
            browseProperty.Name = newPropertyName;

            var browsePropertySelector = new BrowseFromPropertyInfo { PropertyInfo = browseProperty, Path = path };

            return new IConceptInfo[] { browseProperty, browsePropertySelector };
        }
开发者ID:koav,项目名称:Rhetos,代码行数:25,代码来源:BrowseTakePropertyInfo.cs

示例7: CheckSemantics

 internal static void CheckSemantics(BrowseDataStructureInfo browse, string path, IEnumerable<IConceptInfo> concepts, IConceptInfo errorContext)
 {
     var property = GetSelectedPropertyByPath(browse, path, concepts);
     if (property.IsError)
         throw new DslSyntaxException("Invalid format of " + errorContext.GetUserDescription() + ": " + property.Error);
 }
开发者ID:koav,项目名称:Rhetos,代码行数:6,代码来源:BrowseTakePropertyInfo.cs


注:本文中的IConceptInfo.GetUserDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。