Exemple #1
0
 private BitmapImage GetPropertyIcon(PropertyPurpose purpose)
 {
     if (purpose == PropertyPurpose.Property)
     {
         return(PROPERTY_ICON);
     }
     else if (purpose == PropertyPurpose.Measure)
     {
         return(MEASURE_ICON);
     }
     else if (purpose == PropertyPurpose.Dimension)
     {
         return(DIMENSION_ICON);
     }
     else if (purpose == PropertyPurpose.System || purpose == PropertyPurpose.Hierarchy)
     {
         return(SYSTEM_PROPERTY_ICON);
     }
     return(QUESTION_ICON);
 }
Exemple #2
0
        private void ParseMetaProperty(StreamReader reader, string line, MetaObject metaObject, PropertyPurpose purpose)
        {
            string[] lines      = line.Split(',');
            string   fileName   = lines[2].Replace("}", string.Empty);
            string   objectName = lines[3].Replace("\"", string.Empty);

            MetaProperty property = new MetaProperty
            {
                Name    = objectName,
                Purpose = purpose
            };

            metaObject.Properties.Add(property);

            if (DBFields.TryGetValue(fileName, out DBNameEntry entry))
            {
                if (entry.DBNames.Count == 1)
                {
                    property.Field = CreateMetaFieldName(entry.DBNames[0]);
                }
                else if (entry.DBNames.Count > 1) // ???
                {
                    foreach (var dbn in entry.DBNames.Where(dbn => dbn.Token == MetadataTokens.Fld))
                    {
                        property.Field = CreateMetaFieldName(dbn);
                    }
                }
            }
            ParseMetaPropertyTypes(reader, property);
        }
Exemple #3
0
        private void ParseMetaProperties(StreamReader reader, string line, MetaObject metaObject, PropertyPurpose purpose)
        {
            string[] lines = line.Split(',');
            int      count = int.Parse(lines[1].Replace("}", string.Empty));
            Match    match;
            string   nextLine;

            for (int i = 0; i < count; i++)
            {
                while ((nextLine = reader.ReadLine()) != null)
                {
                    match = rxDbName.Match(nextLine);
                    if (match.Success)
                    {
                        ParseMetaProperty(reader, nextLine, metaObject, purpose);
                        break;
                    }
                }
            }
        }