Пример #1
0
        public RootFolder(OverviewShellFolderServer server, ShellItemIdList idList)
            : base(idList)
        {
            if (server == null)
            {
                throw new ArgumentNullException(nameof(server));
            }

            Server = server;
        }
Пример #2
0
#pragma warning disable CA1822 // Mark members as static
        public void Main(EventWaitHandle stop, string nativeDllPath)
#pragma warning restore CA1822 // Mark members as static
        {
            using (var server = new OverviewShellFolderServer())
            {
                var config = new ShellFolderConfiguration();
                config.NativeDllRegistration = RegistrationMode.User; // registration can also be done outside of ShellBoost (regsvr32, etc.)
                config.NativeDllPath         = nativeDllPath;

                server.Licensing += OnLicensing;
                Log("Starting listening");
                server.Start(config);
                Log("Started listening '" + ShellFolderServer.DisplayName + "' on proxy id " + ShellFolderServer.ProxyId + " Trace id " + ShellFolderServer.TraceId + ".");
                stop.WaitOne();

                // stop this instance, but keep global RPC listening
                server.Stop(ServerStopOptions.WaitForCallsToComplete | ServerStopOptions.DontStopListening);
                Log("Stopped listening");
                stop.Set();
            }
        }