コード例 #1
0
        internal override void Merge(
            ITypeCompletionContext context,
            INamedType type)
        {
            if (type is ObjectType objectType)
            {
                TypeExtensionHelper.MergeContextData(
                    Definition,
                    objectType.Definition);

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

                TypeExtensionHelper.MergeInterfaces(
                    Definition,
                    objectType.Definition);

                TypeExtensionHelper.MergeObjectFields(
                    context,
                    objectType.Definition.RuntimeType,
                    Definition.Fields,
                    objectType.Definition.Fields);

                TypeExtensionHelper.MergeConfigurations(
                    Definition.Configurations,
                    objectType.Definition.Configurations);
            }
            else
            {
                throw new ArgumentException(
                          TypeResources.ObjectTypeExtension_CannotMerge);
            }
        }
コード例 #2
0
        internal override void Merge(
            ICompletionContext context,
            INamedType type)
        {
            if (type is ObjectType objectType)
            {
                TypeExtensionHelper.MergeContextData(
                    Definition,
                    objectType.Definition);

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

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