示例#1
0
    public static void Main()
    {
        Bus bus = Bus.Session;

        SampleInterface sample = bus.GetObject <SampleInterface> ("com.example.SampleService", new ObjectPath("/SomeObject"));

        Console.WriteLine();
        string xmlData = sample.Introspect();

        Console.WriteLine("xmlData: " + xmlData);

        //object obj = sample.HelloWorld ("Hello from example-client.py!");
        string[] vals = sample.HelloWorld("Hello from example-client.py!");
        foreach (string val in vals)
        {
            Console.WriteLine(val);
        }

        Console.WriteLine();
        MyTuple tup = sample.GetTuple();

        Console.WriteLine(tup.A);
        Console.WriteLine(tup.B);

        Console.WriteLine();
        IDictionary <string, string> dict = sample.GetDict();

        foreach (KeyValuePair <string, string> pair in dict)
        {
            Console.WriteLine(pair.Key + ": " + pair.Value);
        }
    }
示例#2
0
 public UserController(IHttpClientFactory clientFactory, IUserLogic UserLogic, AppConfigurtaionServices AppConfigurtaionServices, ILogger Logger, IHttpContextAccessor accessor, IRedisClient redisClient, SampleInterface sampleInterface) : base(redisClient)
 {
     this._clientFactory            = clientFactory;
     _UserLogic                     = UserLogic;
     this._AppConfigurtaionServices = AppConfigurtaionServices;
     this._Logger                   = Logger;
     this._accessor                 = accessor;
     this.sampleInterface           = sampleInterface;
 }
示例#3
0
 public DefaultController(IOptions <MyOptions> optionsAccessor, IOptionsSnapshot <MyOptions> namedOptionsAccessor, ILogger <DefaultController> logger, IFileProvider fileProvider, IPersonRepostitoy personRepostitoy, SampleInterface sampleInterface)
 {
     this.optionsAccessor  = optionsAccessor;
     this.logger           = logger;
     this.fileProvider     = fileProvider;
     this.personRepostitoy = personRepostitoy;
     this.sampleInterface  = sampleInterface;
     _named_options_1      = namedOptionsAccessor.Get("named_options_1");
     _named_options_2      = namedOptionsAccessor.Get("named_options_2");
 }
示例#4
0
        public EntityProxy()
        {
            ProxyGeneratorBuilder proxyGeneratorBuilder = new ProxyGeneratorBuilder();
            IProxyGenerator       proxyGenerator        = proxyGeneratorBuilder.Build();

            SampleInterface sampleInterface = proxyGenerator.CreateInterfaceProxy <SampleInterface, SampleClass>();

            Console.WriteLine(sampleInterface);
            sampleInterface.Foo();

            Console.ReadKey();

            System.Data.IDbConnection con = null;
            //proxyGenerator.CreateClassProxy();
        }
示例#5
0
        static void Main(string[] args)
        {
            SampleService server  = new SampleService();
            RemoteService service = new RemoteService(server, 5500);

            SampleInterface client = RemoteService.SubscribeToRemoteService <SampleInterface>("127.0.0.1", 5500);

            Console.WriteLine("Server from local call is calculating 1+2= {0}", server.Add(1, 2));
            Console.WriteLine("Server from remote call calculating 1+2= {0}", client.Add(1, 2));

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Write on client....");

            server.LogOnServer();
            client.LogOnServer();

            Console.ReadLine();
        }