コード例 #1
0
ファイル: SourceCodeGenerator.cs プロジェクト: vikyding/Vipr
        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
ファイル: Interface.cs プロジェクト: vikyding/Vipr
        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);
        }