static void Init()
    {
        // Get existing open window or if none, make a new one
        ItemWindow window = (ItemWindow)GetWindow(typeof(ItemWindow));

        window.Show();
    }
        public static void OpenItemWindow(Item item)
        {
            if (string.IsNullOrEmpty(item?.UniqueName))
            {
                return;
            }

            try
            {
                if (!Settings.Default.IsOpenItemWindowInNewWindowChecked && Utilities.IsWindowOpen <ItemWindow>())
                {
                    var existItemWindow = Application.Current.Windows.OfType <ItemWindow>().FirstOrDefault();
                    existItemWindow?.InitializeItemWindow(item);
                    existItemWindow?.Activate();
                }
                else
                {
                    var itemWindow = new ItemWindow(item);
                    itemWindow.Show();
                }
            }
            catch (ArgumentNullException e)
            {
                Log.Error(nameof(OpenItemWindow), e);
                var catchItemWindow = new ItemWindow(item);
                catchItemWindow.Show();
            }
        }
Ejemplo n.º 3
0
 [AjaxMethod]//win 显示
 public void ItemInfo(string action)
 {
     if (action == "new")
     {
         Ext.DoScript("#{fpItem}.getForm().reset();");
         hdnItemid.SetValue("");
     }
     if (action == "edit")
     {
         RowSelectionModel sm = gpItem.SelectionModel.Primary as RowSelectionModel;
         if (sm.SelectedRows.Count > 0)
         {
             hdnItemid.SetValue(sm.SelectedRow.RecordID);
             var item = dc.ParItem.First(p => p.Itemid == decimal.Parse(sm.SelectedRow.RecordID));
             tfItemname.Text      = item.Itemname;
             nfitemFullscore.Text = item.Fullscore.ToString();
         }
     }
     ItemWindow.Show();
 }
Ejemplo n.º 4
0
 private void CommonRightsItem_Clicked(object sender, RoutedEventArgs e)
 {
     var item = sender as System.Windows.Controls.Button;
     var st = item.DataContext.GetType();
     if (st.Name.Equals("Item"))
     {
         Item tp = (Item) item.DataContext;
         Window frm3 = new ItemWindow(tp, _logProcessor.Index - 1, _logProcessor.GetTimeStampByState(_logProcessor.Index - 1));
         frm3.Show();
     }
     else if (st.Name.Equals("Agent"))
     {
         Agent tp = (Agent) item.DataContext;
         tp.IsPaneExpanded = !tp.IsPaneExpanded;
     }
 
 }
Ejemplo n.º 5
0
 private void KVPItem_Clicked(object sender, RoutedEventArgs e)
 {
     var item = sender as Grid;
     Item tp = (Item)item.DataContext;
     Window frm3 = new ItemWindow(tp, _logProcessor.Index-1, _logProcessor.GetTimeStampByState(_logProcessor.Index-1));
     frm3.Show();
     //MessageBox.Show("suspicious "+ tp.InstanceOf);
 }
Ejemplo n.º 6
0
        public void CreateItemWindow()
        {
            var itemWindow = new ItemWindow();

            itemWindow.Show();
        }