Пример #1
0
        public SearchView(List <Information> info, FileManager.Graphics.Window window)
        {
            InitializeComponent();
            this.window = window;

            foreach (var result in info.Where(x => x.type != -1).ToList())
            {
                var elem = new Pair();
                elem.name   = result.name;
                elem.type   = Configuration.types[result.type];
                elem.id     = result.id;
                elem.typeid = result.type;
                List <Information> path = new List <Information>();
                GraphReader.getPtrParent(Kernel.getElement(elem.id), ref path);
                path.Reverse();
                string pathstr = "";
                int    count   = 0;
                foreach (var p in path)
                {
                    count++;
                    if (count == path.Count)
                    {
                        if (count == 1)
                        {
                            pathstr += $"{p.name.ToUpper()} :\\";
                        }
                        else
                        {
                            pathstr += $"{p.name}";
                        }
                    }
                    else
                    {
                        if (count == 1)
                        {
                            pathstr += $"{p.name.ToUpper()} :\\";
                        }
                        else
                        {
                            pathstr += $"{p.name} > ";
                        }
                    }
                }
                elem.path = pathstr;
                liste.Items.Add(elem);
            }

            liste.MouseDoubleClick += (e, v) =>
            {
                var element = (Pair)liste.SelectedItem;
                if (element.typeid != 4)
                {
                    window.open_id(element.id);
                }
            };
        }
Пример #2
0
 public Search(FileManager.Graphics.Window window)
 {
     InitializeComponent();
     this.window = window;
 }
Пример #3
0
 public Kernel(Canvas canvas, MainWindow content)
 {
     this.canvas = canvas;
     window      = new FileManager.Graphics.Window(canvas, content);
 }