コード例 #1
0
        public Binance(Maybe <IDownloadData> downloader)
        {
            // If a downloader is not provided, create the default
            if (!downloader.Any())
            {
                downloader = new Maybe <IDownloadData>(
                    new DownloadData(Constants.Endpoint, Constants.AbsolutePath)
                    );
            }

            // We can call Single() safely because we are sure there is only one
            // instance of IDownloadData inside the Maybe
            _publicApi  = new PublicMethods(downloader.Single());
            _privateApi = new PrivateMethods();
        }
コード例 #2
0
ファイル: ExpressionCallString.cs プロジェクト: am11/linker
        public static void Main()
        {
            PublicMethods.Test();
            ProtectedMethods.Test();
            PrivateMethods.Test();

            Expression.Call(typeof(Derived), "PublicOnBase", Type.EmptyTypes);
            Expression.Call(typeof(Derived), "ProtectedOnBase", Type.EmptyTypes);
            Expression.Call(typeof(Derived), "PrivateOnBase", Type.EmptyTypes);

            // Keep all methods on type UnknownNameMethodClass
            Expression.Call(typeof(UnknownNameMethodClass), GetUnknownString(), Type.EmptyTypes);

            TestUnknownType.Test();

            TestGenericMethods.Test();
        }