Пример #1
0
        internal override void Merge(
            ITypeCompletionContext context,
            INamedType type)
        {
            if (type is InterfaceType interfaceType)
            {
                TypeExtensionHelper.MergeContextData(
                    Definition,
                    interfaceType.Definition);

                TypeExtensionHelper.MergeDirectives(
                    context,
                    Definition.Directives,
                    interfaceType.Definition.Directives);

                TypeExtensionHelper.MergeInterfaceFields(
                    context,
                    Definition.Fields,
                    interfaceType.Definition.Fields);

                TypeExtensionHelper.MergeConfigurations(
                    Definition.Configurations,
                    interfaceType.Definition.Configurations);
            }
            else
            {
                throw new ArgumentException(
                          TypeResources.InterfaceTypeExtension_CannotMerge,
                          nameof(type));
            }
        }
Пример #2
0
        internal override void Merge(
            ICompletionContext context,
            INamedType type)
        {
            if (type is InterfaceType interfaceType)
            {
                TypeExtensionHelper.MergeContextData(
                    Definition,
                    interfaceType.Definition);

                TypeExtensionHelper.MergeDirectives(
                    context,
                    Definition.Directives,
                    interfaceType.Definition.Directives);

                TypeExtensionHelper.MergeInterfaceFields(
                    context,
                    Definition.Fields,
                    interfaceType.Definition.Fields);
            }
            else
            {
                // TODO : resources
                throw new ArgumentException("CANNOT MERGE");
            }
        }