Ejemplo n.º 1
0
        private void SopListPanel_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            try
            {
                var obj = ((Telerik.Windows.Controls.RadPanelBarItem)e.OriginalSource).DataContext as MessageTypeSOPParentModel;
                if (obj != null)
                {
                    var sopObjIndex = sopViewModel.SopList.IndexOf(sopViewModel.SopList.FirstOrDefault(x => x.SOPId == obj.SOPId));
                    if (sopObjIndex != _sopActiveStepIndex)
                    {
                        _sopActiveStepIndex = sopObjIndex;
                    }
                    //else
                    //{
                    //    // obj.IsExpanded = true;
                    //    if (obj.SOPItems != null && obj.SOPItems.Count > 0)
                    //        HandlePatrolClick(obj.SOPItems[0]);
                    //}
                    OpenDetails(obj);

                    if (obj.SOPItems[0].UserControlModel == null)
                    {
                        e.Handled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                Utility.WriteLog(ex);
                MessageBox.Show(Utility.GetErrorMessage());
                Utility.LogOut();
            }
        }
Ejemplo n.º 2
0
        private void SopListPanel_Expanded(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            var obj = ((Telerik.Windows.Controls.RadPanelBarItem)e.OriginalSource).DataContext as MessageTypeSOPParentModel;

            if (obj != null)
            {
                if (obj.SOPItems[0].UserControlModel == null)
                {
                    obj.IsExpanded = false;
                    // e.Handled = true;
                }
                if (obj.IsExpanded)
                {
                    var item = obj.SOPItems[0].UserControlModel.FirstOrDefault();
                    if (item is AssignedPatrolsViewModel)
                    {
                        ((AssignedPatrolsViewModel)item).GetAssignedPatrols();
                        if (!((AssignedPatrolsViewModel)item).AssignedPatrols.Any())
                        {
                            obj.IsExpanded = false;
                        }
                    }
                }
            }
        }
        private void MenuItemShowSetTimeDialog_OnClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            DialogSetTime dialogSetTime = new DialogSetTime();

            dialogSetTime.TimeChanged += dialogSetTime_TimeChanged;
            dialogSetTime.StartTime    = StartTime;
            dialogSetTime.EndTime      = EndTime;
            dialogSetTime.ShowDialog();
        }
Ejemplo n.º 4
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);
            }
        }
Ejemplo n.º 5
0
 private void OnCellDoubleClick(object sender, Telerik.Windows.RadRoutedEventArgs args)
 {
     Telerik.Windows.Controls.GridView.GridViewCellBase cell = args.OriginalSource as Telerik.Windows.Controls.GridView.GridViewCellBase;
     if (cell != null)
     {
         if (cell.ParentRow is Telerik.Windows.Controls.GridView.GridViewRow)
         {
             if (btnEdit.Visibility == Visibility.Visible && btnEdit.Command != null)
             {
                 btnEdit.Command.Execute(btnEdit.CommandParameter);
             }
         }
     }
 }
Ejemplo n.º 6
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);
     }
 }
Ejemplo n.º 7
0
        private void File_DoubleClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
        {
            Tab      tab;
            FileInfo file = sender as FileInfo;

            if (file != null)
            {
                tab = new Tab();
                var Header = new HeaderPane()
                {
                    Header = file.Header
                };
                Header.Click += () => {
                    if (tab.Save())
                    {
                        Root.Items.Remove(tab);
                    }
                };
                tab.Header = Header;
                tab.LoadFile(file.FullPath);
                Root.Items.Add(tab);
            }
        }
Ejemplo n.º 8
0
 void viewitem_Click(object sender, Telerik.Windows.RadRoutedEventArgs e)
 {
     var item = e.Source as RadTreeViewItem;
     var t    = e.Source;
 }