Exemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\Menu.xaml"
                ((NipponBar.Menu)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:

            #line 10 "..\..\Menu.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);

            #line default
            #line hidden
                return;

            case 3:
                this.ButtonFechar = ((System.Windows.Controls.Button)(target));

            #line 33 "..\..\Menu.xaml"
                this.ButtonFechar.Click += new System.Windows.RoutedEventHandler(this.ButtonFechar_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.GridPrincipal = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.TrainsitionigContentSlide = ((MaterialDesignThemes.Wpf.Transitions.TransitioningContent)(target));
                return;

            case 6:
                this.GridCursor = ((System.Windows.Controls.Grid)(target));
                return;

            case 7:
                this.ListViewMenu = ((System.Windows.Controls.ListView)(target));

            #line 48 "..\..\Menu.xaml"
                this.ListViewMenu.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ListViewMenu_SelectionChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.goods = ((System.Windows.Controls.ListViewItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 2
0
        private void bindingArry(string[][] source)
        {
            Brush blackBrush = new SolidColorBrush(Colors.Black);
              Brush grayBrush = new SolidColorBrush(Colors.LightBlue);
              Thickness borderThickness = new Thickness(1);

              foreach (string[] line in source)
              {
            ListViewItem lvi = new ListViewItem();
            StackPanel sp = new StackPanel();
            sp.Orientation = Orientation.Horizontal;

            foreach (string item in line)
            {
              Label itemLabel = new Label();
              itemLabel.Background = grayBrush;
              itemLabel.BorderBrush = blackBrush;
              itemLabel.BorderThickness = borderThickness;
              itemLabel.Content = item;
              sp.Children.Add(itemLabel);
            }
            lvi.Content = sp;
            lvTable.Items.Add(lvi);
              }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ListViewMenu = ((System.Windows.Controls.ListView)(target));
                return;

            case 2:
                this.ItemHome = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 3:
                this.ItemHome2 = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 4:
                this.ItemHome3 = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 5:
                this.ItemHome4 = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 6:
                this.ItemHome5 = ((System.Windows.Controls.ListViewItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Event handler for when the file is dropped into the playlist area.
        /// It checks if the files are mp3s if they are we add them to the play list.
        /// </summary>
        /// <param name="sender">Not used</param>
        /// <param name="e">Used to get the file name</param>
        private void playList_Drop(object sender, System.Windows.DragEventArgs e)
        {
            Array a = (Array)e.Data.GetData(System.Windows.Forms.DataFormats.FileDrop);

            if (a != null)
            {
                for (int i = 0; i < a.Length; i++)
                {
                    string s = a.GetValue(i).ToString();
                    if (System.IO.Path.GetExtension(s) == ".mp3")
                    {
                        FileInfo temp = new FileInfo(s);

                        files.Add(new System.IO.FileInfo(s));
                    }
                }
                listView.Items.Clear();
                foreach (System.IO.FileInfo f in files)
                {
                    System.Windows.Controls.ListViewItem fileItem = new System.Windows.Controls.ListViewItem();
                    SongItem item = new SongItem(f.DirectoryName + "\\", f.Name);
                    listView.Items.Add(item);
                }
            }

            listViewLabel.Visibility = Visibility.Hidden;
        }
    public WindowMain()
    {
      InitializeComponent();

      fAppSettings = new AppSettings();
      fLastScanned = PageTypeEnum.Letter;

      fScanner = new Scanner();
      fPrinter = new Printer();
      fPdfExporter = new PdfExporter();
      fPdfImporter = new PdfImporter();
      fImageLoader = new ImageLoader();
      fImageSaver = new ImageSaver();

      fDocument = new Document();
      fDocument.OnPageAdded += fDocument_OnPageAdded;
      fDocument.OnPageRemoved += fDocument_OnPageRemoved;
      fDocument.OnPageUpdated += fDocument_OnPageUpdated;
      fDocument.OnPageMoved += fDocument_OnPageMoved;
       
      fInsertionMark = new InsertionMark();
      fDragStartItem = null;
      fScrollTimer = new System.Timers.Timer(150);
      fScrollTimer.Elapsed += fScrollTimer_Elapsed;
      fScrollTimer.AutoReset = false;

      this.KeyUp += WindowMain_KeyUp;

      fClosing = false;
      fDeleting = false;
    }
Exemplo n.º 6
0
        public Bookmark(KinectBrowser.D3D.Browser.D3DBrowser browser)
        {
            this.InitializeComponent();

            currentBrowser = browser;
            xmlPath = Directory.GetParent(Environment.CurrentDirectory)+"\\KinectBrowser\\bookmark.xml";

            xmlDoc = new XmlDocument();
            xmlDoc.Load(xmlPath);

            XmlNodeList bookmarkList = xmlDoc.GetElementsByTagName("Bookmark");

            foreach (XmlNode node in bookmarkList)
            {
                XmlElement bookmarkElement = (XmlElement) node;

                string title = bookmarkElement.GetElementsByTagName("Title")[0].InnerText;
                string url = bookmarkElement.GetElementsByTagName("Url")[0].InnerText;

                ListViewItem item = new ListViewItem();
                item.Content = title;
                item.ToolTip = url;
                item.Selected += new RoutedEventHandler(Select_bookmark);
                //item.MouseDoubleClick += new MouseButtonEventHandler(Bookmark_DoubleClick);
                listView1.Items.Add(item);
            }
        }
Exemplo n.º 7
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.DeckList = ((System.Windows.Controls.ListView)(target));
                return;

            case 3:
                this.NewCardDeck = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 4:
                this.DisplayWindow = ((System.Windows.Controls.ContentPresenter)(target));
                return;

            case 5:
                this.ModeSwitching = ((System.Windows.Controls.Button)(target));

            #line 71 "..\..\MainWindow.xaml"
                this.ModeSwitching.Click += new System.Windows.RoutedEventHandler(this.ModeSwitch);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 8
0
        int ComparePeopleByPersonDescending(ListViewItem a, ListViewItem b)
        {
            ReservationList first  = (ReservationList)a.Content;
            ReservationList second = (ReservationList)b.Content;

            return(String.Compare(second.Person, first.Person));
        }
Exemplo n.º 9
0
        int CompareReservationByDateEndAscending(ListViewItem a, ListViewItem b)
        {
            ReservationList first  = (ReservationList)a.Content;
            ReservationList second = (ReservationList)b.Content;
            DateTime        firstDate;
            DateTime        secondDate;

            if (first.ReservationEnd.CompareTo("") != 0)
            {
                firstDate = Convert.ToDateTime(first.ReservationEnd);
            }
            else
            {
                firstDate = DateTime.MinValue;
            }
            if (second.ReservationEnd.CompareTo("") != 0)
            {
                secondDate = Convert.ToDateTime(second.ReservationEnd);
            }
            else
            {
                secondDate = DateTime.MinValue;
            }
            return(DateTime.Compare(firstDate, secondDate));
        }
Exemplo n.º 10
0
        int CompareCarAscending(ListViewItem a, ListViewItem b)
        {
            MyLendList first  = (MyLendList)a.Content;
            MyLendList second = (MyLendList)b.Content;

            return(String.Compare(first.Vehicle, second.Vehicle));
        }
Exemplo n.º 11
0
        int CompareLendByDateStartDescending(ListViewItem a, ListViewItem b)
        {
            MyLendList first  = (MyLendList)a.Content;
            MyLendList second = (MyLendList)b.Content;
            DateTime   firstDate;
            DateTime   secondDate;

            if (first.LendStart.CompareTo("") != 0)
            {
                firstDate = Convert.ToDateTime(first.LendStart);
            }
            else
            {
                firstDate = DateTime.MinValue;
            }
            if (second.LendStart.CompareTo("") != 0)
            {
                secondDate = Convert.ToDateTime(second.LendStart);
            }
            else
            {
                secondDate = DateTime.MinValue;
            }
            return(DateTime.Compare(secondDate, firstDate));
        }
 private void addProfil(Profil p)
 {
     if (!this.doesProfileExist(p.name))
     {
         System.Windows.Controls.ListViewItem listViewItem = new System.Windows.Controls.ListViewItem();
         listViewItem.Content = (object)p.name;
         listViewItem.Tag     = (object)p;
         System.Windows.Controls.ContextMenu contextMenu = new System.Windows.Controls.ContextMenu();
         System.Windows.Controls.MenuItem    menuItem    = new System.Windows.Controls.MenuItem();
         menuItem.Header = (object)"Löschen";
         menuItem.Click += new RoutedEventHandler(this.item_Click);
         contextMenu.Items.Add((object)menuItem);
         listViewItem.ContextMenu = contextMenu;
         this.listProfiles.Items.Add((object)listViewItem);
     }
     else
     {
         foreach (System.Windows.Controls.ListViewItem listViewItem in (IEnumerable)this.listProfiles.Items)
         {
             if ((listViewItem.Tag as Profil).name == p.name)
             {
                 listViewItem.Tag = (object)p;
                 break;
             }
         }
     }
 }
Exemplo n.º 13
0
        int CompareLendByIdAscending(ListViewItem a, ListViewItem b)
        {
            MyLendList first  = (MyLendList)a.Content;
            MyLendList second = (MyLendList)b.Content;

            return(first.LendId.CompareTo(second.LendId));
        }
        private void differServer_Click(object sender, RoutedEventArgs e)
        {
            Server       server1      = (sender as System.Windows.Controls.MenuItem).Tag as Server;
            ServerEditor serverEditor = new ServerEditor(server1);

            serverEditor.ShowDialog();
            if (!serverEditor.wasAccepted)
            {
                return;
            }
            this.settings.servers.Remove(server1);
            this.settings.servers.Add(serverEditor.server);
            System.Windows.Controls.ListViewItem serverItem = this.getServerItem(server1);
            foreach (ComboBoxItem comboBoxItem in (IEnumerable)this.comboServer.Items)
            {
                if (comboBoxItem.Tag == server1)
                {
                    comboBoxItem.Tag     = (object)serverEditor.server;
                    comboBoxItem.Content = (object)serverEditor.server.name;
                    break;
                }
            }
            Server server2 = serverEditor.server;

            serverItem.Content = (object)server2.name;
            foreach (FrameworkElement frameworkElement in (IEnumerable)serverItem.ContextMenu.Items)
            {
                frameworkElement.Tag = (object)server2;
            }
        }
Exemplo n.º 15
0
        public CaseViewer()
        {
            InitializeComponent();
            MyData md = new MyData();
            md.CaseName = "dddd";

            string[] row = { "1", "case1", "case1", "case1", "case1" };
            ListViewItem ldv = new ListViewItem();

            XmlDocument doc = new XmlDocument();
            doc.PreserveWhitespace = false;
            doc.Load("record.xml");
            XmlNode root = doc.DocumentElement;
            XmlNodeList nodes = root.SelectNodes("Child");
            foreach (XmlNode node in nodes)
            {
                for (int i = 0; i < 5; i++)
                {
                    Console.WriteLine(node.ChildNodes[i].InnerText);
                }

                MyData item = new MyData
                {
                    CaseNumber = node.ChildNodes[0].InnerText.ToString(),
                    CaseName = node.ChildNodes[1].InnerText.ToString(),
                    CaseNotes = node.ChildNodes[2].InnerText.ToString(),
                    LastUpdatedBy = node.ChildNodes[3].InnerText.ToString(),
                    LastUpdateDate = node.ChildNodes[4].InnerText.ToString()
                };
                lstvu1.Items.Add(item);
            }
        }
 private void AddList(Data.BOMenuKichThuocMon item)
 {
     ListViewItem li = new ListViewItem();
     li.Content = item;
     li.Tag = item;
     lvData.Items.Add(li);
 }
Exemplo n.º 17
0
        private void Modyfikuj_Rezerwacje(object sender, RoutedEventArgs e)
        {
            ListViewItem selected = (ListViewItem)ListViewReservations.SelectedItem;

            if (selected != null)
            {
                ReservationList selectedObj = (ReservationList)selected.Content;
                int             selectedId  = selectedObj.ReservationId - 1;
                var             db          = new AEiI_2020_BD2_Drynda_FlotaEntities();

                Reservation reservationChange = null;

                var reservation = (from reserv in db.Reservations
                                   where reserv.id == selectedId
                                   select reserv).FirstOrDefault();

                if (reservation != null)
                {
                    reservationChange = reservation;
                }
                if (reservationChange.ended == false)
                {
                    System.Windows.Window glowneOkno = System.Windows.Application.Current.MainWindow;
                    glowneOkno.DataContext = new ZmienRezerwacje(reservationChange);
                }
                else
                {
                    MessageBox.Show("Rezerwacja się zakończyła!", "Komunikat");
                }
            }
            else
            {
                MessageBox.Show("Niczego nie wybrano !", "Komunikat");
            }
        }
        protected override void PrepareItem(ListViewItem item)
        {
            if (_autoWidthColumns == null)
            {
                _autoWidthColumns = new HashSet<int>();

                foreach (var column in Columns)
                {
                    if(double.IsNaN(column.Width))
                        _autoWidthColumns.Add(column.GetHashCode());
                }                
            }

            foreach (var column in Columns)
            {
                if (_autoWidthColumns.Contains(column.GetHashCode()))
                {
                    if (double.IsNaN(column.Width))
                        column.Width = column.ActualWidth;

                    column.Width = double.NaN;                    
                }          
            }

            base.PrepareItem(item);
        }        
Exemplo n.º 19
0
        int CompareReservationByIdDescending(ListViewItem a, ListViewItem b)
        {
            ReservationList first  = (ReservationList)a.Content;
            ReservationList second = (ReservationList)b.Content;

            return(second.ReservationId.CompareTo(first.ReservationId));
        }
Exemplo n.º 20
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.RootDialog = ((MaterialDesignThemes.Wpf.DialogHost)(target));
                return;

            case 2:
                this.GridMenu = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.ListViewMenu = ((System.Windows.Controls.ListView)(target));
                return;

            case 4:
                this.ItemHome = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 5:
                this.ControlPlaceHolder = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 21
0
        int CompareCarAscending(ListViewItem a, ListViewItem b)
        {
            ReservationList first  = (ReservationList)a.Content;
            ReservationList second = (ReservationList)b.Content;

            return(String.Compare(first.Vehicle, second.Vehicle));
        }
Exemplo n.º 22
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ListViewMenu = ((System.Windows.Controls.ListView)(target));
                return;

            case 2:
                this.ItemNotes = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 3:
                this.ItemGrades = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 4:
                this.ItemTasks = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 5:
                this.ItemСalendar = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 6:
                this.ItemLogOut = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 7:
                this.ActiveItem = ((System.Windows.Controls.ContentControl)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.btnMerge = ((System.Windows.Controls.ListViewItem)(target));

            #line 22 "..\..\..\Views\ComparisonView.xaml"
                this.btnMerge.Selected += new System.Windows.RoutedEventHandler(this.BtnMerge_Click);

            #line default
            #line hidden
                return;

            case 2:
                this.SaveTemplate = ((System.Windows.Controls.ListViewItem)(target));

            #line 31 "..\..\..\Views\ComparisonView.xaml"
                this.SaveTemplate.Selected += new System.Windows.RoutedEventHandler(this.SaveTemplate_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.cmbMergeOption = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:
                this.itemsListColumnParsers = ((System.Windows.Controls.ItemsControl)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 24
0
        public void RefreshPlaylist(Playlist playlist)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() =>
            {
                _playlist = playlist;
                listViewPlaylist.Items.Clear();
                listViewPlaylistAlbumArt.Items.Clear();
                string currentAlbum = string.Empty;
                int songCount = 0;
                foreach (var item in _playlist.Items)
                {
                    // Add only one row per album (to do: expose row height in viewmodel)
                    songCount++;                                            
                    string album = string.Format("{0}_{1}", item.AudioFile.ArtistName, item.AudioFile.AlbumTitle).ToUpper();
                    if (string.IsNullOrEmpty(currentAlbum))
                    {
                        currentAlbum = album;
                    }
                    else if (album != currentAlbum)
                    {
                        //Console.WriteLine("PlaylistWindow - RefreshPlaylists - Album: {0} SongCount: {1}", album, songCount);
                        var listViewItem = new ListViewItem();
                        listViewItem.Background = new LinearGradientBrush(Colors.HotPink, Colors.Yellow, 90);
                        listViewItem.Height = (songCount - 1) * 24;
                        listViewItem.Content = string.Format("{0}/{1}", (songCount - 1), currentAlbum);
                        listViewPlaylistAlbumArt.Items.Add(listViewItem);
                        currentAlbum = album;
                        songCount = 1;
                    }

                    listViewPlaylist.Items.Add(item);
                }
            }));
        }
Exemplo n.º 25
0
 public SPDefinitionWindow()
 {
     InitializeComponent();
     def = Program.Configs[Program.SelectedConfig].GetSMDef();
     if (def == null)
     {
         MessageBox.Show("The config was not able to parse a sourcepawn definiton.", "Stop", MessageBoxButton.OK, MessageBoxImage.Warning);
         this.Close();
         return;
     }
     List<SPDefEntry> defList = new List<SPDefEntry>();
     for (int i = 0; i < def.Functions.Length; ++i) { defList.Add((SPDefEntry)def.Functions[i]); }
     for (int i = 0; i < def.Constants.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Constants[i], Entry = "Constant" }); }
     for (int i = 0; i < def.Types.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Types[i], Entry = "Type" }); }
     for (int i = 0; i < def.MethodNames.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.MethodNames[i], Entry = "Method" }); }
     for (int i = 0; i < def.Properties.Length; ++i) { defList.Add(new SPDefEntry() { Name = def.Properties[i], Entry = "Property" }); }
     defList.Sort((a, b) => { return string.Compare(a.Name, b.Name); });
     defArray = defList.ToArray();
     int defArrayLength = defArray.Length;
     items = new ListViewItem[defArrayLength];
     for (int i = 0; i < defArrayLength; ++i)
     {
         items[i] = new ListViewItem() { Content = defArray[i].Name, Tag = defArray[i].Entry };
         SPBox.Items.Add(items[i]);
     }
     searchTimer.Elapsed += searchTimer_Elapsed;
 }
 private void DragList_DragOver(object sender, DragEventArgs e)
 {
     _overTarget = ((DependencyObject)e.OriginalSource).FindAnchestor<ListViewItem>();
     if (_overTarget == null) return;
     if (_draggedItem == _overTarget) return;
     (_overTarget.Content as AssetViewModel).DragOverTarget = true;
 }
Exemplo n.º 27
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ListViewMenu = ((System.Windows.Controls.ListView)(target));

            #line 11 "..\..\..\..\UserControls\Menu\DerslerMenuUserControl.xaml"
                this.ListViewMenu.PreviewMouseDown += new System.Windows.Input.MouseButtonEventHandler(this.ListViewMenu_PreviewMouseDown);

            #line default
            #line hidden
                return;

            case 2:
                this.matematik = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 3:
                this.fizik = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 4:
                this.kimya = ((System.Windows.Controls.ListViewItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
        private void tbxName_PreviewKeyUp(object sender, KeyEventArgs e)
        {
            ICountCollection    countSource  = (ICountCollection)ItemsSource;
            IRemoveAtCollection removeSource = (IRemoveAtCollection)ItemsSource;

            if (e.Key == SeparatorKey && !String.IsNullOrEmpty(tbxName.Text))
            {
                RaiseEvent(new CreateItemEventArgs(CreateItemEvent, this, tbxName.Text));

                //ViewModel.Items.Add(new CompletionItem { Name = textBox.Text });
                tbxName.Text = String.Empty;
            }
            else if (e.Key == Key.Back && String.IsNullOrEmpty(tbxName.Text) && countSource.Count > 0)
            {
                removeSource.RemoveAt(countSource.Count - 1);
            }
            else if (e.Key == Key.Left && tbxName.CaretIndex == 0)
            {
                lvwItems.Focus();
                lvwItems.SelectedIndex = countSource.Count - 1;
                UIListViewItem listViewItem = (UIListViewItem)lvwItems.ItemContainerGenerator.ContainerFromIndex(lvwItems.SelectedIndex);
                listViewItem.Focus();

                e.Handled = true;
            }
        }
        int CompareLendByIdDescending(ListViewItem a, ListViewItem b)
        {
            LendList first  = (LendList)a.Content;
            LendList second = (LendList)b.Content;

            return(second.LendId.CompareTo(first.LendId));
        }
Exemplo n.º 30
0
 public void UpdateListView()
 {                        
     Process[] Processes = Process.GetProcesses();
   //  Array.Sort(Processes, new CompareProcessStartTime());
     var sorted = from p in Processes orderby StartTimeNoException(p) descending, p.Id select p;            
     foreach (Process p in sorted)          
     {
         
         ProcessModule pm;
         string path;
         try { pm = p.MainModule; }
         catch (Exception) { continue; }
         try { path = pm.FileName; }
         catch (Exception) { continue; }
         if (p.ProcessName == "svchost") continue;
         ListViewItem lvi = new ListViewItem() {Tag=p };
         StackPanel sp = new StackPanel() { Width = 64, Height = 64 };
         Image i = new Image() { Source = GetAssociatedIcon(path), Width = 32, Height = 32 };
         TextBlock tb = new TextBlock()
         {
             TextWrapping = System.Windows.TextWrapping.Wrap,
             MaxWidth = sp.Width,
             Text = p.ProcessName,
             HorizontalAlignment = System.Windows.HorizontalAlignment.Center,
             VerticalAlignment = System.Windows.VerticalAlignment.Top,
             TextAlignment = TextAlignment.Center
         };
         sp.Children.Add(i);
         sp.Children.Add(tb);
         lvi.Content = sp;
         lv.Items.Add(lvi);           
     }
    
 }
Exemplo n.º 31
0
        public void LoadData(List<Group> groups)
        {
            listView.Items.Clear();

            foreach (TreeViewItem item in treeView.Items)
            {
                item.UnregisterName(item.Header.ToString());
            }
            treeView.Items.Clear();

            foreach (Group group in groups)
            {
                TreeViewItem treeViewItem = new TreeViewItem() { Header = group.Name, Tag = group };
                treeView.Items.Add(treeViewItem);
                treeViewItem.RegisterName(group.Name, treeViewItem);

                var persons = group.Persons;

                foreach (Person person in persons)
                {
                    ListViewItem listViewItem = new ListViewItem() { Content = person, Tag = person };
                    listView.Items.Add(listViewItem);

                    TreeViewItem i = treeView.FindName(group.Name) as TreeViewItem;
                    TreeViewItem treeViewSubItem = new TreeViewItem() { Header = person.Name, Tag = person };
                    i.Items.Add(treeViewSubItem);
                }

                treeViewItem.IsExpanded = true;
            }
        }
Exemplo n.º 32
0
        private void SubmitEditBtn_Click(object sender, RoutedEventArgs e)
        {
            Spell currSpell = shared.currentSpell != null ? shared.currentSpell : new Spell();
            if (SpellNameEditTxtBx.Text != currSpell.SpellName && currSpell == shared.currentSpell)
            {
                currSpell.SpellName = SpellNameEditTxtBx.Text;
                shared.spellListView.Items.Clear();

                foreach (Spell spell in shared.character.spells) {
                    ListViewItem newItem = new ListViewItem();
                    newItem.Content = spell.SpellName;
                    shared.spellListView.Items.Add(newItem);
                }
            }
            else {
                currSpell.SpellName = SpellNameEditTxtBx.Text;
            }
            
            currSpell.Rank = Convert.ToInt32(RankEditTxtBx.Text);
            currSpell.Description = DescriptionEditTxtBx.Text;
            currSpell.Requirement = ReqEditTxtBx.Text;
            currSpell.Area = AreaEditTxtBx.Text;
            currSpell.Duration = DurationEditTxtBx.Text;

            if (currSpell != shared.currentSpell)
            {
                currSpell.Casts = 0;
                shared.character.spells.Add(currSpell);
                ListViewItem newItem = new ListViewItem();
                newItem.Content = currSpell.SpellName;
                shared.spellListView.Items.Add(newItem);
            }
            shared.currentSpell = currSpell;
            this.Close();
        }
Exemplo n.º 33
0
 System.Windows.Controls.ListViewItem Create_ItemList(string Text)
 {
     System.Windows.Controls.ListViewItem temp = new System.Windows.Controls.ListViewItem();
     temp.Foreground = Brushes.Blue;
     temp.Content    = Text;
     return(temp);
 }
        private void rxList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            System.Windows.Controls.ListViewItem item = sender as System.Windows.Controls.ListViewItem;
            if (item != null)
            {
                MessageGroup obj = (MessageGroup)item.Content;

                List <string> dates = obj.dateList;
                string        msg   = obj.message;


                if (!msg.Equals(LINE_MISMATCH))
                {
                    LogGraph lg = new LogGraph(dates, msg);
                    lg.Show();
                    lg.Activate();

                    lg.Focus();
                    lg.Topmost = true;
                }
                else
                {
                    DateListWindow dlw = new DateListWindow(dates);
                    dlw.Show();
                    dlw.Activate();

                    dlw.Focus();
                    dlw.Topmost = true;
                }
            }
        }
        int CompareLendByDatePlannedEndAscending(ListViewItem a, ListViewItem b)
        {
            LendList first  = (LendList)a.Content;
            LendList second = (LendList)b.Content;
            DateTime firstDate;
            DateTime secondDate;

            if (first.LendPlannedEnd.CompareTo("") != 0)
            {
                firstDate = Convert.ToDateTime(first.LendPlannedEnd);
            }
            else
            {
                firstDate = DateTime.MinValue;
            }
            if (second.LendPlannedEnd.CompareTo("") != 0)
            {
                secondDate = Convert.ToDateTime(second.LendPlannedEnd);
            }
            else
            {
                secondDate = DateTime.MinValue;
            }
            return(DateTime.Compare(firstDate, secondDate));
        }
Exemplo n.º 36
0
        private void lstCourses_Drop(object sender, System.Windows.DragEventArgs e)
        {
            try
            {
                if (e.Data.GetDataPresent("System.Windows.Controls.ListViewItem"))
                {
                    System.Windows.Controls.ListViewItem semester = e.Data.GetData("System.Windows.Controls.ListViewItem") as System.Windows.Controls.ListViewItem;
                    System.Windows.Controls.ListView     listView = sender as System.Windows.Controls.ListView;
                    SemesterControl control = GetSemesterControlFromListView(listView);
                    int             indexOf = mSemesters.IndexOf(control);
                    string          course  = CourseCanBeTaken(semester.Content.ToString(), indexOf);
                    if (course == "")
                    {
                        listView.Items.Add(semester);
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("Course cannot be moved to that semester.  Prerequisite class " + course + " has not yet been taken.");
                        mDraggedParent.Items.Add(mDraggedClass);
                    }

                    // contact.Background = System.Windows.Media.Brushes.Aqua;
                }
            }
            catch { }
        }
Exemplo n.º 37
0
        /// <summary>
        /// Kreiranje listview-a na temelju liste objetata u parametru.
        /// </summary>
        /// <param name="classesList"></param>
        public void CreateList(List<object> classesList)
        {
            foreach (String[] classArrayString in classesList) {
                Grid grid = new Grid();
                grid.ShowGridLines = true;
                grid.RowDefinitions.Add(new RowDefinition());
                grid.Margin = new Thickness(30, 10, 30, 0);

                for (int i=0; i < classArrayString.Length; i++) {
                    ColumnDefinition columnDef = new ColumnDefinition();
                    columnDef.Width = new GridLength(150);
                    grid.ColumnDefinitions.Add(columnDef);

                    Label label = new Label();
                    label.Content = classArrayString[i];
                    Grid.SetColumn(label, i);
                    Grid.SetRow(label, 0);

                    grid.Children.Add(label);
                }

                ListViewItem listItem = new ListViewItem();
                listItem.Content = grid;
                currentListView.Items.Add(listItem);
            }
        }
 private void AddList(Data.BOKhachHang item)
 {
     ListViewItem li = new ListViewItem();
     li.Content = item;
     li.Tag = item;
     lvData.Items.Add(li);
 }
Exemplo n.º 39
0
 void AddDependency(object pSender, RoutedEventArgs pEvents)
 {
   var lDialog = new Microsoft.Win32.OpenFileDialog()
   {
     Title = "Choose dependency Assembly",
     CheckFileExists = true,
     Filter = "Assemblies|*.dll;*.exe;*.winmd|All Files|*.*",
     Multiselect = true
   };
   if (lDialog.ShowDialog() == true)
   {
     foreach (string lName in lDialog.FileNames)
     {
       // Check if the dependency is already on the list.
       var lSameLib = (
           from ListViewItem lItem in DependencyList.Items
           where lItem.Content.Equals(lName)
           select lItem);
       if (lSameLib.Count() == 0)
       {
         ListViewItem lEntry = new ListViewItem();
         lEntry.Content = lName;
         DependencyList.Items.Add(lEntry);
       }
     }
   }
 }
Exemplo n.º 40
0
        public Bookmark(WebBrowser webBrowser)
        {
            this.InitializeComponent();

            wb = webBrowser;
            xmlPath = Directory.GetParent(Environment.CurrentDirectory).Parent.FullName+"\\bookmark.xml";

            xmlDoc = new XmlDocument();
            xmlDoc.Load(xmlPath);

            XmlNodeList bookmarkList = xmlDoc.GetElementsByTagName("Bookmark");

            foreach (XmlNode node in bookmarkList)
            {
                XmlElement bookmarkElement = (XmlElement) node;

                string title = bookmarkElement.GetElementsByTagName("Title")[0].InnerText;
                string url = bookmarkElement.GetElementsByTagName("Url")[0].InnerText;

                ListViewItem item = new ListViewItem();
                item.Content = title;
                item.ToolTip = url;
                item.Selected += new RoutedEventHandler(Select_bookmark);
                listView1.Items.Add(item);
            }
        }
        int CompareLendByPersonDescending(ListViewItem a, ListViewItem b)
        {
            LendList first  = (LendList)a.Content;
            LendList second = (LendList)b.Content;

            return(String.Compare(second.Person, first.Person));
        }
Exemplo n.º 42
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ListViewMenu = ((System.Windows.Controls.ListView)(target));

            #line 52 "..\..\..\usercontrols\usc_inventory.xaml"
                this.ListViewMenu.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.ListViewMenu_SelectionChanged_1);

            #line default
            #line hidden
                return;

            case 2:
                this.stStocks = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 3:
                this.stAddItem = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 4:
                this.stItemReq = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 5:
                this.mainSubColumn = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }
        int CompareCarDescending(ListViewItem a, ListViewItem b)
        {
            LendList first  = (LendList)a.Content;
            LendList second = (LendList)b.Content;

            return(String.Compare(second.Vehicle, first.Vehicle));
        }
Exemplo n.º 44
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.StackPanelMenu = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 2:
                this.listViewItem = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 3:
                this.listViewItem1 = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 4:
                this.listViewItem2 = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 5:
                this.listViewItem3 = ((System.Windows.Controls.ListViewItem)(target));
                return;

            case 6:
                this.grid = ((System.Windows.Controls.Grid)(target));
                return;

            case 7:
                this.MenuClose = ((System.Windows.Controls.Button)(target));

            #line 233 "..\..\MainWindow.xaml"
                this.MenuClose.Click += new System.Windows.RoutedEventHandler(this.MenuClose_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.MenuOpen = ((System.Windows.Controls.Button)(target));

            #line 238 "..\..\MainWindow.xaml"
                this.MenuOpen.Click += new System.Windows.RoutedEventHandler(this.MenuOpen_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.Shutdown = ((System.Windows.Controls.Button)(target));

            #line 304 "..\..\MainWindow.xaml"
                this.Shutdown.Click += new System.Windows.RoutedEventHandler(this.Shutdown_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        int CompareLendByDateReservationDescending(ListViewItem a, ListViewItem b)
        {
            LendList first  = (LendList)a.Content;
            LendList second = (LendList)b.Content;
            DateTime firstDate;
            DateTime secondDate;

            if (first.ReservationDate.CompareTo("") != 0)
            {
                firstDate = Convert.ToDateTime(first.ReservationDate);
            }
            else
            {
                firstDate = DateTime.MinValue;
            }
            if (second.ReservationDate.CompareTo("") != 0)
            {
                secondDate = Convert.ToDateTime(second.ReservationDate);
            }
            else
            {
                secondDate = DateTime.MinValue;
            }
            return(DateTime.Compare(secondDate, firstDate));
        }
Exemplo n.º 46
0
        private void lstCourses_PreviewMouseMove(object sender, System.Windows.Input.MouseEventArgs e)
        {
            try
            {
                // Get the current mouse position
                System.Windows.Point mousePos = e.GetPosition(null);
                Vector diff = startPoint - mousePos;

                if (e.LeftButton == MouseButtonState.Pressed && (
                        Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance ||
                        Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance))
                {
                    // Get the dragged ListViewItem
                    mDraggedParent = sender as System.Windows.Controls.ListView;
                    System.Windows.Controls.ListViewItem listViewItem =
                        FindAnchestor <System.Windows.Controls.ListViewItem>((DependencyObject)e.OriginalSource);

                    // Find the data behind the ListViewItem
                    System.Windows.Controls.ListViewItem contact = (System.Windows.Controls.ListViewItem)mDraggedParent.ItemContainerGenerator.
                                                                   ItemFromContainer(listViewItem);
                    mDraggedClass = contact;
                    // Initialize the drag & drop operation
                    System.Windows.DataObject dragData = new System.Windows.DataObject("System.Windows.Controls.ListViewItem", contact);
                    System.Windows.DragDrop.DoDragDrop(listViewItem, dragData, System.Windows.DragDropEffects.Move);
                }
            }
            catch { }
        }
 public void ListViewTest() {
     var containter = new ListViewItem() { DataContext = itemViewModel1 };
     containter.Content = originalSource;
     var itemsControl = new ListView();
     itemsControl.Items.Add(containter);
     var result = converter.TestConvert(itemsControl, originalSource);
     Assert.AreEqual(itemViewModel1, result);
 }
Exemplo n.º 48
0
        public void addUser(string nick)
        {
            ListViewItem item = new ListViewItem();
            item.Height = 30;
            item.Content = nick;

            ListViewUsers.Items.Add(item);
        }
Exemplo n.º 49
0
		internal void FocusItem(ListViewItem item)
		{
			if (item != null) {
				focusedItem = item;
				if (!item.IsFocused)
					item.Focus ();
			}
		}
        /* Plugin laden und ein Bild zur Toolbox hinzufügen */
        private void LoadIcon(int classid)
        {
            ListViewItem item = new ListViewItem();
            item.ToolTip = icons.getTooltip(classid);
            item.MaxWidth = 75;
            item.Content = icons.getImage(classid);

            this.Items.Add(item);
        }
 /// <summary>
 /// Gets the name of the mapping.
 /// </summary>
 /// <param name="listViewItem">The list view item.</param>
 /// <returns></returns>
 private static string GetMappingName(ListViewItem listViewItem)
 {
     string mapping = String.Empty;
     if (listViewItem.DataContext is KeyValuePair<string, IOItem>)
     {
         var item = (KeyValuePair<string, IOItem>)listViewItem.DataContext;
         mapping = item.Value.MappedTo;
     }
     return mapping;
 }
 private void AddAssembly(string[] fileNames)
 {
     foreach (string fileName in fileNames)
     {
         ListViewItem item = new ListViewItem();
         item.Content = System.IO.Path.GetFileName(fileName);
         item.ToolTip = fileName;
         lvAssemblies.Items.Add(item);
     }
 }
        public void RenderChampions(int ChampionId)
        {
            champions Champ = champions.GetChampion(ChampionId);
            TheChamp = Champ;
            if (TheChamp.IsFavourite)
                FavouriteLabel.Content = "Unfavourite";
            else
                FavouriteLabel.Content = "Favourite";
            ChampionName.Content = Champ.displayName;
            ChampionTitle.Content = Champ.title;
            ChampionProfileImage.Source = Champ.icon;
            AttackProgressBar.Value = Champ.ratingAttack;
            DefenseProgressBar.Value = Champ.ratingDefense;
            AbilityProgressBar.Value = Champ.ratingMagic;
            DifficultyProgressBar.Value = Champ.ratingDifficulty;

            HPLabel.Content = string.Format("HP: {0} (+{1} per level)", Champ.healthBase, Champ.healthLevel);
            ResourceLabel.Content = string.Format("{0}: {1} (+{2} per level)", Champ.ResourceType, Champ.manaBase, Champ.manaLevel);
            HPRegenLabel.Content = string.Format("HP/5: {0} (+{1} per level)", Champ.healthRegenBase, Champ.healthRegenLevel);
            ResourceRegenLabel.Content = string.Format("{0}/5: {1} (+{2} per level)", Champ.ResourceType, Champ.manaRegenBase, Champ.manaRegenLevel);
            MagicResistLabel.Content = string.Format("MR: {0} (+{1} per level)", Champ.magicResistBase, Champ.magicResistLevel);
            ArmorLabel.Content = string.Format("Armor: {0} (+{1} per level)", Champ.armorBase, Champ.armorLevel);
            AttackDamageLabel.Content = string.Format("AD: {0} (+{1} per level)", Champ.attackBase, Champ.attackLevel);
            RangeLabel.Content = string.Format("Range: {0}", Champ.range);
            MovementSpeedLabel.Content = string.Format("Speed: {0}", Champ.moveSpeed);

            foreach (Dictionary<string, object> Skins in Champ.Skins)
            {
                int Skin = Convert.ToInt32(Skins["id"]);
                ListViewItem item = new ListViewItem();
                Image skinImage = new Image();
                var uriSource = Path.Combine(Client.ExecutingDirectory, "Assets", "champions", championSkins.GetSkin(Skin).portraitPath);
                skinImage.Source = Client.GetImage(uriSource);
                skinImage.Width = 96.25;
                skinImage.Height = 175;
                skinImage.Stretch = Stretch.UniformToFill;
                item.Tag = Skin;
                item.Content = skinImage;
                SkinSelectListView.Items.Add(item);
            }

            foreach (Spell Sp in Champ.Spells)
            {
                ChampionDetailAbility detailAbility = new ChampionDetailAbility();
                detailAbility.DataContext = Sp;
                var uriSource = Path.Combine(Client.ExecutingDirectory, "Assets", "spell", Sp.Image);
                detailAbility.AbilityImage.Source = Client.GetImage(uriSource);
                AbilityListView.Items.Add(detailAbility);
            }

            ChampionImage.Source = Client.GetImage(Path.Combine(Client.ExecutingDirectory, "Assets", "champions", Champ.splashPath));

            LoreText.Text = Champ.Lore.Replace("<br>", Environment.NewLine);
            TipsText.Text = string.Format("Tips while playing {0}:{1}{2}{2}{2}Tips while playing aginst {0}:{3}", Champ.displayName, Champ.tips.Replace("*", Environment.NewLine + "*"), Environment.NewLine, Champ.opponentTips.Replace("*", Environment.NewLine + "*"));
        }
        public RelearnMoveWindow(IPokemon pokemon)
        {
            InitializeComponent();
            this.pokemon = pokemon;

            ushort[] moves = PokemonDatabase.GetRelearnableMoves(pokemon);

            foreach (ushort moveID in moves) {
                Move move = new Move(moveID);
                ListViewItem listViewItem = new ListViewItem();
                Grid grid = new Grid();
                grid.Width = 321;
                grid.Height = 27;
                Rectangle panel = new Rectangle();
                panel.Margin = new Thickness(1, 1, 0, 0);
                panel.Width = 319;
                panel.Height = 23;
                panel.RadiusX = 2;
                panel.RadiusY = 2;
                panel.Fill = new SolidColorBrush(Color.FromRgb(248, 248, 248));
                panel.Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0));
                panel.StrokeThickness = 1;
                PokemonTypeControl type = new PokemonTypeControl();
                type.Type = move.MoveData.Type;
                type.Margin = new Thickness(10, 4, 0, 0);
                ConditionTypeControl condition = new ConditionTypeControl();
                condition.Type = move.MoveData.ConditionType;
                condition.Margin = new Thickness(10, 4, 0, 0);
                condition.Visibility = Visibility.Hidden;
                Label name = new Label();
                name.Content = move.MoveData.Name;
                name.Margin = new Thickness(120, 0, 0, 0);
                name.FontWeight = FontWeights.Bold;
                Label pp = new Label();
                pp.Content = (move.MoveData.PP == 0 ? "--" : move.TotalPP.ToString());
                pp.Margin = new Thickness(281, 0, 0, 0);
                pp.FontWeight = FontWeights.Bold;
                grid.Children.Add(panel);
                grid.Children.Add(type);
                grid.Children.Add(condition);
                grid.Children.Add(name);
                grid.Children.Add(pp);
                listViewItem.Content = grid;
                listViewItem.Tag = move;
                listViewMoves.Items.Add(listViewItem);
            }

            this.labelMoveAccuracy.Content = "";
            this.labelMovePower.Content = "";
            this.labelMoveCategory.Content = "";
            this.labelMoveAppeal.Content = "";
            this.labelMoveJam.Content = "";
            this.textBlockMoveDescription.Text = "";
            buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden;
        }
Exemplo n.º 55
0
        private ListViewItem AddListViewItem(string name)
        {
            ListViewItem lvi = new ListViewItem();

            TextBlock tb = new TextBlock();
            tb.Text = name;

            lvi.Content = tb;

            return lvi;
        }
Exemplo n.º 56
0
        public RenameCollection(CollectionManagement cm)
        {
            InitializeComponent();
            collectionManagement = cm;
            item = (ListViewItem)collectionManagement.collectionList.Items.GetItemAt(collectionManagement.collectionList.SelectedIndex);
            collectionName.Text = item.Content.ToString();
            collectionName.Focus();
            collectionName.SelectionStart = 0;
            collectionName.SelectionLength = collectionName.Text.Length;

        }
Exemplo n.º 57
0
        void AddItem1( string str)
        {
            this.Dispatcher.BeginInvoke(DispatcherPriority.Send,
                                        (ThreadStart) delegate
                                                          {
                                                              ListViewItem newitem = new ListViewItem();
                                                              newitem.Content = str;

                                                              //listView1.Items.Add(newitem).subitem
                                                             // lstdiffview.Items.Add(newitem);
                                                          });
        }
        private StackPanel AddContentType(String fileType, String contentType)
        {
            StackPanel sp = new StackPanel()
            {
                Name = "Row" + nextTypeId.ToString(),
                Orientation = Orientation.Horizontal
            };

            CheckBox cb = new CheckBox()
            {
                Name = "CheckBox" + nextTypeId.ToString(),
                Width = 24,
                Margin = new Thickness(0, 4, 0, 0),
                Background = new SolidColorBrush(Colors.LightYellow)
            };
            sp.Children.Add(cb);

            TextBox tb1 = new TextBox()
            {
                Name = "TextBoxFileType" + nextTypeId.ToString(),
                Text = fileType,
                Width = 120,
                Margin = new Thickness(0, 0, 16, 0),
                Background = new SolidColorBrush(Colors.LightYellow)
            };
            sp.Children.Add(tb1);
            RegisterName(tb1.Name, tb1);

            TextBox tb2 = new TextBox()
            {
                Name = "TextBoxContentType" + nextTypeId.ToString(),
                Text = contentType,
                Width = 270,
                Background = new SolidColorBrush(Colors.LightYellow)
            };
            sp.Children.Add(tb2);
            RegisterName(tb2.Name, tb2);

            ListViewItem lvi = new ListViewItem()
            {
                Content = sp
            };

            ContentTypeListView.Items.Add(lvi);

            rowPanels.Add(nextTypeId, sp);
            checkboxes.Add(nextTypeId, cb);
            listViewItems.Add(nextTypeId, lvi);

            nextTypeId++;

            return sp;
        }
 /// <summary>
 /// This method creates a ListViewItem based on a given IListableItem
 /// </summary>
 /// <param name="item">The item to generate a ListViewItem for.</param>
 /// <returns>The created ListViewItem.</returns>
 private ListViewItem CreateListViewItem(IListableItem item)
 {
     StackPanel sp = new StackPanel() { Width = 50, Height = 50, Orientation = Orientation.Vertical, IsHitTestVisible = false };
     sp.Children.Add(new Image() { Source = item.GetIcon(), Width = 24, Height = 24 });
     sp.Children.Add(new Label() { Content = item.Title, MaxWidth = 50, HorizontalAlignment = HorizontalAlignment.Center });
     ListViewItem listViewItem = new ListViewItem() { Margin = new Thickness(2) };
     listViewItem.Content = sp;
     listViewItem.Tag = item;
     listViewItem.MouseDoubleClick += new MouseButtonEventHandler(
         (sender, e) => OnItemDoubleClicked(new ListableItemEventArgs((sender as ListViewItem).Tag as IListableItem)) //fire own event
     );
     return listViewItem;
 }
        public void activeUI()
        {
            foreach (var software in InstallList.Content) {
                var line = new ListViewItem();
                line.Tag = software;
                line.Content = software.Name;
                ListView_list.Items.Add(line);
                line.IsSelected = software.IsSelected;
                line.ToolTip = software.Description;
            }

            String baseText = "请选中需要安装的软件,点击\"安装\"。\n";
            int timeout = 10;
            TimerCallback timerCallback = (obj) =>
            {
                Dispatcher.Invoke(() =>
                {
                    /*for (int i = 0; i < timeout; ++i)
                    {
                        if (Button_Install.Visibility == Visibility.Hidden)
                        {
                            return;
                        }
                        TextBox_Msg.Text = baseText + (timeout - i) + "秒后执行默认安装" + Environment.NewLine;
                    }*/
                    TextBox_Msg.Text = baseText + (timeout) + "秒后执行默认安装" + Environment.NewLine;
                    if (timeout != 0)
                    {
                        timeout--;
                    }
                    else
                    {
                        timer.Dispose();
                        Button_Install_Click(new object(), new RoutedEventArgs());
                        //MessageBox.Show("123");
                    }

                });
            };
            /*TimerCallback timerCallback = (obj) =>
            {
                MessageBox.Show("show");
            };*/
            timer = new Timer(timerCallback, null, 0, 1000);

            TextBox_Msg.Text = baseText;

            ListView_list.IsEnabled = true;
            Button_Install.IsEnabled = true;
            ListView_list.Focus();
        }