Esempio n. 1
0
        public static void GetAllPreviewers()
        {
            using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers"))
            {
                CurrentPreviewers = new List <Previewer>();

                string[] guids = rk.GetValueNames();

                for (int i = 0; i < guids.Length; i++)
                {
                    bool repeated = false;
                    foreach (Previewer curPrv in CurrentPreviewers)
                    {
                        if (curPrv.CLSID.ToString() == guids[i])
                        {
                            repeated = true;
                        }
                    }
                    if (repeated)
                    {
                        break;
                    }

                    Previewer prv = new Previewer();
                    prv.CLSID = new Guid(guids[i]);
                    prv.Title = rk.GetValue(guids[i]).ToString();

                    CurrentPreviewers.Add(prv);
                }
            }
        }
        public static void GetAllPreviewers()
        {
            using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\PreviewHandlers"))
            {
                CurrentPreviewers = new List<Previewer>();

                string[] guids = rk.GetValueNames();

                for (int i = 0; i < guids.Length; i++)
                {
                    bool repeated = false;
                    foreach (Previewer curPrv in CurrentPreviewers)
                        if (curPrv.CLSID.ToString() == guids[i])
                            repeated = true;
                    if (repeated)
                        break;

                    Previewer prv = new Previewer();
                    prv.CLSID = new Guid(guids[i]);
                    prv.Title = rk.GetValue(guids[i]).ToString();

                    CurrentPreviewers.Add(prv);
                }

            }
        }