Пример #1
0
        private void WriteSignature(IndexerSignature indexer, bool? @public = true)
        {
            var accessModifier = @public.HasValue ? @public.Value ? "public" : "private" : "";

            var explicitName = indexer.DefiningInterface == null
                ? string.Empty
                : indexer.DefiningInterface + ".";

            _("{0} {1}this[{2}]", indexer.ReturnType, explicitName, indexer.Parameters.ToParametersString());
        }
Пример #2
0
        public static IEnumerable <Interface> ForCollection(OdcmEntityClass odcmClass)
        {
            var interfaces = new List <Interface>();

            foreach (var projection in odcmClass.DistinctProjections())
            {
                var @interface = new Interface
                {
                    Attributes = global::Vipr.Writer.CSharp.Lite.Attributes.ForCollectionInterface,
                    Identifier = NamesService.GetCollectionInterfaceName(odcmClass, projection),
                    Namespace  = NamesService.GetNamespaceName(odcmClass.Namespace),
                    Methods    = global::Vipr.Writer.CSharp.Lite.Methods.ForCollectionInterface(odcmClass, projection),
                    Indexers   = IndexerSignature.ForCollectionInterface(odcmClass, projection),
                    Interfaces = new[] { new Type(NamesService.GetExtensionTypeName("IReadOnlyQueryableSetBase"), new Type(NamesService.GetConcreteInterfaceName(odcmClass))) }
                };

                interfaces.Add(@interface);
            }

            return(interfaces);
        }