public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            MonoFileSystem t = (MonoFileSystem)target;

            EditorGUI.BeginDisabledGroup(EditorApplication.isPlayingOrWillChangePlaymode);
            {
                m_FileSystemHelperInfo.Draw();
            }
            EditorGUI.EndDisabledGroup();

            if (EditorApplication.isPlaying && IsPrefabInHierarchy(t.gameObject))
            {
                EditorGUILayout.LabelField("File System Count", t.Count.ToString());

                IFileSystem[] fileSystems = t.GetAllFileSystems();
                foreach (IFileSystem fileSystem in fileSystems)
                {
                    DrawFileSystem(fileSystem);
                }
            }

            serializedObject.ApplyModifiedProperties();

            Repaint();
        }
Exemple #2
0
        private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options)
        {
            // Allow all https requests
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), false, false, appPaths.TempDirectory);

            fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));

            FileSystem = fileSystem;

            var environmentInfo = GetEnvironmentInfo();

            var imageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => _appHost.HttpClient, appPaths);

            _appHost = new MonoAppHost(appPaths,
                                       logManager,
                                       options,
                                       fileSystem,
                                       new PowerManagement(),
                                       "emby.mono.zip",
                                       environmentInfo,
                                       imageEncoder,
                                       new Startup.Common.SystemEvents(logManager.GetLogger("SystemEvents")),
                                       new MemoryStreamProvider(),
                                       new NetworkManager(logManager.GetLogger("NetworkManager")),
                                       GenerateCertificate,
                                       () => Environment.UserName);

            if (options.ContainsOption("-v"))
            {
                Console.WriteLine(_appHost.ApplicationVersion.ToString());
                return;
            }

            Console.WriteLine("appHost.Init");

            var initProgress = new Progress <double>();

            var task = _appHost.Init(initProgress);

            Task.WaitAll(task);

            Console.WriteLine("Running startup tasks");

            task = _appHost.RunStartupTasks();
            Task.WaitAll(task);

            task = ApplicationTaskCompletionSource.Task;

            Task.WaitAll(task);
        }
Exemple #3
0
        private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options)
        {
            // Allow all https requests
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            var environmentInfo = GetEnvironmentInfo();

            var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), environmentInfo, appPaths.TempDirectory);

            FileSystem = fileSystem;

            using (var appHost = new MonoAppHost(appPaths,
                                                 logManager,
                                                 options,
                                                 fileSystem,
                                                 new PowerManagement(),
                                                 "emby.mono.zip",
                                                 environmentInfo,
                                                 new NullImageEncoder(),
                                                 new SystemEvents(logManager.GetLogger("SystemEvents")),
                                                 new NetworkManager(logManager.GetLogger("NetworkManager"))))
            {
                if (options.ContainsOption("-v"))
                {
                    Console.WriteLine(appHost.ApplicationVersion.ToString());
                    return;
                }

                Console.WriteLine("appHost.Init");

                var initProgress = new Progress <double>();

                var task = appHost.Init(initProgress);

                Task.WaitAll(task);

                appHost.ImageProcessor.ImageEncoder = ImageEncoderHelper.GetImageEncoder(_logger, logManager, fileSystem, options, () => appHost.HttpClient, appPaths, environmentInfo);

                Console.WriteLine("Running startup tasks");

                task = appHost.RunStartupTasks();
                Task.WaitAll(task);

                task = ApplicationTaskCompletionSource.Task;

                Task.WaitAll(task);
            }
        }
Exemple #4
0
        /// <summary>
        /// Runs the application.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="logManager">The log manager.</param>
        /// <param name="options">The options.</param>
        private static void StartApplication(ServerApplicationPaths appPaths,
                                             ILogManager logManager,
                                             StartupOptions options)
        {
            // Allow all https requests
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), false, false, appPaths.TempDirectory);

            fileSystem.AddShortcutHandler(new MbLinkShortcutHandler(fileSystem));

            _fileSystem = fileSystem;

            var environmentInfo = GetEnvironmentInfo();

            var imageEncoder = ImageEncoderHelper.GetImageEncoder(_logger,
                                                                  logManager,
                                                                  fileSystem,
                                                                  options,
                                                                  () => AppHost.HttpClient,
                                                                  appPaths);

            AppHost = new MacAppHost(appPaths,
                                     logManager,
                                     options,
                                     fileSystem,
                                     new PowerManagement(),
                                     "Emby.Server.Mac.pkg",
                                     environmentInfo,
                                     imageEncoder,
                                     new Startup.Common.SystemEvents(logManager.GetLogger("SystemEvents")),
                                     new MemoryStreamProvider(),
                                     new NetworkManager(logManager.GetLogger("NetworkManager")),
                                     GenerateCertificate,
                                     () => Environment.UserName);

            if (options.ContainsOption("-v"))
            {
                Console.WriteLine(AppHost.ApplicationVersion.ToString());
                return;
            }

            Console.WriteLine("appHost.Init");

            Task.Run(() => StartServer(CancellationToken.None));
        }
Exemple #5
0
        /// <summary>
        /// Runs the application.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="logManager">The log manager.</param>
        /// <param name="options">The options.</param>
        private static void StartApplication(ServerApplicationPaths appPaths,
                                             ILogManager logManager,
                                             StartupOptions options)
        {
            // Allow all https requests
            ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return(true); });

            var environmentInfo = GetEnvironmentInfo();

            var fileSystem = new MonoFileSystem(logManager.GetLogger("FileSystem"), environmentInfo, appPaths.TempDirectory);

            _fileSystem = fileSystem;

            var imageEncoder = GetImageEncoder(appPaths, fileSystem, logManager);

            AppHost = new MacAppHost(appPaths,
                                     logManager,
                                     options,
                                     fileSystem,
                                     new PowerManagement(),
                                     "Emby.Server.Mac.pkg",
                                     environmentInfo,
                                     imageEncoder,
                                     new SystemEvents(logManager.GetLogger("SystemEvents")),
                                     new NetworkManager(logManager.GetLogger("NetworkManager")));

            if (options.ContainsOption("-v"))
            {
                Console.WriteLine(AppHost.ApplicationVersion.ToString());
                return;
            }

            Console.WriteLine("appHost.Init");

            Task.Run(() => StartServer(CancellationToken.None));
        }