Example #1
0
            /// <summary>
            /// Assign resource ID's to attributes.
            /// </summary>
            internal void AssignResourceIds(ResourceIdMap resourceIdMap)
            {
                if (string.IsNullOrEmpty(Namespace))
                    return;

                int id;
                Value.Types valueType;
                if (resourceIdMap.TryGetId(XName, out id, out valueType))
                {
                    // Set resource id
                    resourceId = id;

                    // Change value type (if needed)
                    switch (valueType)
                    {
                        case Value.Types.TYPE_FIRST_INT:
                            TypedValue = new Value(valueType, int.Parse(RawValue));
                            break;
                    }
                }
            }
Example #2
0
            /// <summary>
            /// Assign resource ID's to attributes.
            /// </summary>
            internal void AssignResourceIds(ResourceIdMap resourceIdMap)
            {
                if (string.IsNullOrEmpty(Namespace))
                {
                    return;
                }

                int id;

                Value.Types valueType;
                if (resourceIdMap.TryGetId(XName, out id, out valueType))
                {
                    // Set resource id
                    resourceId = id;

                    // Change value type (if needed)
                    switch (valueType)
                    {
                    case Value.Types.TYPE_FIRST_INT:
                        TypedValue = new Value(valueType, int.Parse(RawValue));
                        break;
                    }
                }
            }