Ejemplo n.º 1
0
 private void Bind_command_save_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     using (arxiveService1Client = new DrawingArxiveService.DrawingArxiveService1Client())
     {
         if (CommandBindings.Contains(bind_command_save))
         {
             CommandBindings.Remove(bind_command_save);
         }
         foreach (DrawingArxiveService.DrawingItem drawing in DrawingListVisual.SelectedItems)
         {
             arxiveService1Client.SetRepeatArxivation(drawing.ID);
             System.Diagnostics.Debug.WriteLine(drawing.Name);
             System.Diagnostics.Debug.WriteLine("Отправлено");
             Task.Delay(5000);
         }
         if (!CommandBindings.Contains(bind_command_save))
         {
             CommandBindings.Add(bind_command_save);
         }
     }
 }
Ejemplo n.º 2
0
 private void Bind_command_open_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         if (CommandBindings.Contains(bind_command_open))
         {
             CommandBindings.Remove(bind_command_open);
         }
         using (arxiveService1Client = new DrawingArxiveService.DrawingArxiveService1Client())
         {
             var drawingItems = arxiveService1Client.GetWrongDrawingList();
             DrawingListVisual.ItemsSource = drawingItems;
             if (drawingItems.Count > 0)
             {
                 if (!CommandBindings.Contains(bind_command_save))
                 {
                     CommandBindings.Add(bind_command_save);
                 }
             }
             else
             {
                 if (CommandBindings.Contains(bind_command_save))
                 {
                     CommandBindings.Remove(bind_command_save);
                 }
             }
         }
         if (!CommandBindings.Contains(bind_command_open))
         {
             CommandBindings.Add(bind_command_open);
         }
     }catch (Exception err)
     {
         MessageBox.Show(err.Message);
     }
 }