Ejemplo n.º 1
0
        void CopyCmdExecuted(object target, ExecutedRoutedEventArgs e)
        {
            ListView lv = e.OriginalSource as ListView;

            string copyContent = String.Empty;

            int count = 0;

            foreach (object item in lv.SelectedItems)
            {
                if (count > 0)
                {
                    copyContent += Environment.NewLine;
                }

                if (item is SearchableIEAKItem)
                {
                    SearchableIEAKItem policyItem = (SearchableIEAKItem)item;
                    copyContent += policyItem.ParentPolicy.Name + "\t" + policyItem.ParentSection.Name + "\t" + policyItem.Name + "\t" + policyItem.Value;
                }
                count++;
            }

            try
            {
                Clipboard.SetData(DataFormats.Text, copyContent);
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        public bool FilterListView(Object item)
        {
            SearchableIEAKItem Spi = (SearchableIEAKItem)item;

            // return (OUFilter.Text.Trim().Length == 0 || Spi.ParentPolicy.IsLinked(OUFilter.Text)) && ((FilterText.Text.Length < 1 || (Spi.Key.ToUpper().Contains(FilterText.Text.ToUpper()) ||
            return((FilterText.Text.Length < 1 || (Spi.Name.Contains(FilterText.Text.ToUpper()) ||
                                                   Spi.ParentPolicy.Name.ToUpper().Contains(FilterText.Text.ToUpper()) ||
                                                   Spi.Value.ToUpper().Contains(FilterText.Text.ToUpper()))) &&
                   (IncludeUnlink.IsChecked.Value ||
                    (!IncludeUnlink.IsChecked.Value && Spi.ParentPolicy.LinkedTo.Count > 0)));
        }
Ejemplo n.º 3
0
        private void Menu_Search_IEAK_Click(object sender, RoutedEventArgs e)
        {
            List <SearchableIEAKItem> SpItems = new List <SearchableIEAKItem>();

            foreach (Policy pol in polSet.Policies)
            {
                foreach (SecEditSection ses in pol.IEAKFileData.Sections)
                {
                    foreach (SecEditValuePair svp in ses.Entries)
                    {
                        SearchableIEAKItem ssei = new SearchableIEAKItem();

                        ssei.ParentPolicy   = pol;
                        ssei.Linkage        = -1;
                        ssei.Name           = svp.Name;
                        ssei.ParentSection  = ses;
                        ssei.Value          = svp.Value;
                        ssei.MachineSetting = false;

                        SpItems.Add(ssei);
                    }
                }

                foreach (SecEditSection ses in pol.IEAKMachineFileData.Sections)
                {
                    foreach (SecEditValuePair svp in ses.Entries)
                    {
                        SearchableIEAKItem ssei = new SearchableIEAKItem();

                        ssei.ParentPolicy   = pol;
                        ssei.Linkage        = -1;
                        ssei.Name           = svp.Name;
                        ssei.ParentSection  = ses;
                        ssei.Value          = svp.Value;
                        ssei.MachineSetting = true;

                        SpItems.Add(ssei);
                    }
                }
            }

            IEAKSearcher PolSearcher = new IEAKSearcher(SpItems);

            PolSearcher.Owner = this;
            PolSearcher.ShowDialog();
        }