Exemplo n.º 1
0
        private void MenuItemAddItem_Click(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            try
            {
                ChartLiveData selected = null;

                foreach (var chartLiveData in AllCharts)
                {
                    if (chartLiveData.IsSelected)
                    {
                        selected = chartLiveData;
                        break;
                    }
                }

                if (selected == null)
                {
                    ShowMsgOnStatusBar("First select a item");
                    return;
                }

                //TODO Parameters
                if (ItemsForCompare.Count >= 15)
                {
                    ShowMsgOnStatusBar(string.Format("Maximum number of items(={0}) for Compare is reached", 15));
                    return;
                }

                if (ItemsForCompare.IndexOf(selected) >= 0)
                {
                    ShowMsgOnStatusBar("This item already exists in Compare List");
                    return;
                }

                ItemsForCompare.Add(selected);

                MenuItem newMenuItem = new MenuItem();
                newMenuItem.Header = selected.ItemsAioViewModel.ItemName;

                MenuItem newContextMenuItem = new MenuItem();
                newContextMenuItem.Header = selected.ItemsAioViewModel.ItemName;

                MenuItemItems.Items.Add(newMenuItem);
                ContextMenuItemItems.Items.Add(newContextMenuItem);
                MenuItemClearItems.IsEnabled        = true;
                ContextMenuItemClearItems.IsEnabled = true;
            }
            catch (Exception ex)
            {
                Logger.LogIndustrialMonitoring(ex);
            }
        }
Exemplo n.º 2
0
 private void MenuItemCompareData_OnClick(object sender, RadRoutedEventArgs e)
 {
     try
     {
         if (ItemsForCompare.Any())
         {
             MenuItemClearItems.IsEnabled = true;
         }
     }
     catch (Exception ex)
     {
         Logger.LogIndustrialMonitoring(ex);
     }
 }
Exemplo n.º 3
0
 private void MenuItemClearItems_Click(object sender, Telerik.Windows.RadRoutedEventArgs e)
 {
     try
     {
         ItemsForCompare.Clear();
         MenuItemItems.Items.Clear();
         ContextMenuItemItems.Items.Clear();
         MenuItemClearItems.IsEnabled        = false;
         ContextMenuItemClearItems.IsEnabled = false;
     }
     catch (Exception ex)
     {
         Logger.LogIndustrialMonitoring(ex);
     }
 }