Bonjour,
J'ai un xaml.cs
quand je clique le bouton, la méthode button_click() doit être appelée, le string _instrument va obtenir l'option qu'on a choisi par combobox. Ensuite, je voudrais appeler le main dans l'espace de nom
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 namespace WpfApplication2 { public partial class MainWindow : Window { private string _instrument; public string Instrument { get { return _instrument; } } public MainWindow() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { _instrument= combobox1.Text; } } }
Je ne sais pas comment il peut appeler ce main parce qu'ils ont des noms d'espace différents.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 namespace Com.Lmax.Api public static void Main(string[] args) { MyTradingBot myTradingBot = new MyTradingBot(); MainWindow nw = new MainWindow(); LmaxApi lmaxApi = new LmaxApi("https://testapi.lmaxtrader.com"); lmaxApi.Login(new LoginRequest("sheninparis", "20141123p", ProductType.CFD_DEMO), myTradingBot.Login, FailureCallback("log in")); if (args.Length != 5) { Console.WriteLine("Usage MarketDataClient <url> <username> <password> [CFD_DEMO|CFD_LIVE] instrumentId"); Environment.Exit(-1); }
Partager