void Sell_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (VerifyBuying == 0) { bing.ServiceReference1.TranzactiiClient tc = new bing.ServiceReference1.TranzactiiClient(bind, endpoint); tc.GetTranzactieCumparareAsync(); tc.GetTranzactieCumparareCompleted += new EventHandler<GetTranzactieCumparareCompletedEventArgs>(tc_GetTranzactieCumparareCompleted); b.IsBusy = true; VerifyBuying = 1; } else { b.IsBusy = true; Selling(); } }
private static int VerifyBuying = 0;//e folosit si la selling public MyTranzactii(Canvas canvas2) { AtributeGlobale.i++; Search = new Canvas(); CreateOffer = new Canvas(); this.canvas2 = canvas2; canvas2.Children.Clear(); //b e busyIndicator b.Width = 152; b.Height = 56; b.IsBusy = false; canvas2.Children.Add(b); Canvas.SetLeft(b, canvas2.Width/2-152); Canvas.SetTop(b, canvas2.Height / 2); ControlCuColturiRotunde sus = new ControlCuColturiRotunde(canvas2, canvas2.Width - 2, 60, 0, 0, false, 1); sus.Colors("#FF252525", "#FF000000", new Point(0.5, 1), new Point(0.5, 0), 1); sus.Border(new CornerRadius(0, 0, 0, 0), "#FF696c6e", new Thickness(1), canvas2.Width, 62); #region Trades Trades = new ControlCuColturiRotunde(canvas2, 160, 60, 0, 1, false, 1); Trades.Colors("#FF252525", "#FF000000", new Point(0.5, 1), new Point(0.5, 0), 1); Trades.AddTextBlock(new TextBlock(), "My Trades", 23, 20, 10, "#FF959906"); MyTrades = Trades.intoarce(); MyTrades.MouseEnter += new MouseEventHandler(MyTrades_MouseEnter); MyTrades.MouseLeave += new MouseEventHandler(MyTrades_MouseLeave); MyTrades.MouseLeftButtonDown += new MouseButtonEventHandler(MyTrades_MouseLeftButtonDown); #endregion #region Cbuy CBuy = new ControlCuColturiRotunde(canvas2, 80, 60, 162, 1, false, 1); CBuy.Colors("#FF252525", "#FF000000", new Point(0.5, 1), new Point(0.5, 0), 1); CBuy.AddTextBlock(new TextBlock(), "Buy", 23, 20, 10, "#FF959906"); Buy = CBuy.intoarce(); Buy.MouseEnter += new MouseEventHandler(Buy_MouseEnter); Buy.MouseLeave += new MouseEventHandler(Buy_MouseLeave); Buy.MouseLeftButtonDown += new MouseButtonEventHandler(Buy_MouseLeftButtonDown); #endregion #region Sell CSell = new ControlCuColturiRotunde(canvas2, 80, 60, 244, 1, false, 1); CSell.Colors("#FF252525", "#FF000000", new Point(0.5, 1), new Point(0.5, 0), 1); CSell.AddTextBlock(new TextBlock(), "Sell", 23, 20, 10, "#FF959906"); Sell = CSell.intoarce(); Sell.MouseEnter += new MouseEventHandler(Sell_MouseEnter); Sell.MouseLeave += new MouseEventHandler(Sell_MouseLeave); Sell.MouseLeftButtonDown += new MouseButtonEventHandler(Sell_MouseLeftButtonDown); #endregion #region Conectare Service try { bing.ServiceReference1.TranzactiiClient tc = new bing.ServiceReference1.TranzactiiClient(bind,endpoint); //tc.GetToateAnimaleleAsync(); //tc.GetToateAnimaleleCompleted += new EventHandler<bing.ServiceReference1.GetToateAnimaleleCompletedEventArgs>(tc_GetToateAnimaleleCompleted); Toateanimalele = new List<string>(); tc.gettranzAsync("test"); tc.gettranzCompleted += new EventHandler<bing.ServiceReference1.gettranzCompletedEventArgs>(tc_gettranzCompleted); } catch (Exception e) { MessageBox.Show(e.Message); } #endregion #region Imagine imgInchide.Source = new BitmapImage(new Uri("DesignImages/x.png", UriKind.Relative)); imgInchide.Height = 25; imgInchide.Width = 25; imgInchide.MouseEnter += new MouseEventHandler(imgInchide_MouseEnter); imgInchide.MouseLeave += new MouseEventHandler(imgInchide_MouseLeave); imgInchide.MouseLeftButtonDown += new MouseButtonEventHandler(imgInchide_MouseLeftButtonDown); canvas2.Children.Add(imgInchide); Canvas.SetTop(imgInchide, 12); Canvas.SetLeft(imgInchide, 728); #endregion adaugaSearch(); CRCuvant.Ascunde(); CRRegiune.Ascunde(); CRQA.Ascunde(); search.Ascunde(); lol.Ascunde(); lupa = new Image() { Width = 28, Height = 27, Source = new BitmapImage(new Uri("DesignImages/lupa.png", UriKind.Relative)) }; canvas2.Children.Add(lupa); lupa.Visibility = Visibility.Collapsed; Canvas.SetLeft(lupa, 10); Canvas.SetTop(lupa, 80); }
void MyTrades_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (VerifyHistory == 0) { bing.ServiceReference1.TranzactiiClient tc = new bing.ServiceReference1.TranzactiiClient(bind, endpoint); tc.GetToateAnimaleleAsync(); tc.GetToateAnimaleleCompleted += new EventHandler<bing.ServiceReference1.GetToateAnimaleleCompletedEventArgs>(tc_GetToateAnimaleleCompleted); tc.GetToateFirmeleAsync(); tc.GetToateFirmeleCompleted += new EventHandler<GetToateFirmeleCompletedEventArgs>(tc_GetToateFirmeleCompleted); b.IsBusy = true; VerifyHistory = 1; } else { b.IsBusy = true; IncarcaAnimale(); } }