예제 #1
0
        private void MergeTypeExtension(
            ICompletionContext context,
            INamedTypeExtensionMerger extension,
            INamedType type)
        {
            if (extension.Kind != type.Kind)
            {
                // TODO : resources
                throw new SchemaException(SchemaErrorBuilder.New()
                                          .SetMessage("Cannot merge type!")
                                          .SetTypeSystemObject((ITypeSystemObject)type)
                                          .Build());
            }

            extension.Merge(context, type);
        }
예제 #2
0
        private static void MergeTypeExtension(
            ICompletionContext context,
            INamedTypeExtensionMerger extension,
            INamedType type)
        {
            if (extension.Kind != type.Kind)
            {
                throw new SchemaException(SchemaErrorBuilder.New()
                                          .SetMessage(string.Format(
                                                          CultureInfo.InvariantCulture,
                                                          TypeResources.TypeInitializer_Merge_KindDoesNotMatch,
                                                          type.Name))
                                          .SetTypeSystemObject((ITypeSystemObject)type)
                                          .Build());
            }

            extension.Merge(context, type);
        }