Example #1
0
 protected ValueVariantBase([NotNull] ValueVariantBase clone, [NotNull] AnalysisContext context)
 {
     if (clone == null)
     {
         throw new ArgumentNullException(nameof(clone));
     }
     Path    = clone.Path;
     Context = context;
 }
        public static ValueVariantBase Clone([CanBeNull] this ValueVariantBase self, [NotNull] AnalysisContext context,
                                             GraphNode[] path)
        {
            var clone = self.Clone(context);

            if (clone != null)
            {
                clone.Path = path;
            }

            return(clone);
        }
        public static ValueVariantBase Clone([CanBeNull] this ValueVariantBase self, [NotNull] AnalysisContext context)
        {
            switch (self)
            {
            case null:
                return(null);

            case ItemValueVariantBase itemValueVariantBase:
                return(itemValueVariantBase.Clone(context));

            case VariableValueVariantBase variableValueVariantBase:
                return(variableValueVariantBase.Clone(context));

            default:
                throw new ArgumentOutOfRangeException(nameof(self));
            }
        }