Наследование: MonoBehaviour
Пример #1
0
 // Use this for initialization
 void Start()
 {
     DontDestroyOnLoad(gameObject);
     //	PlayerPrefs.DeleteAll ();
     //make sure only one optionsmanager loads ever
     if(instance == null) instance = this;
     if(instance != this) Destroy(gameObject);
 }
Пример #2
0
 private void Awake()
 {
     // if the singleton hasn't been initialized yet
     if (instance != null && instance != this)
     {
         Destroy(this.gameObject);
         return;//Avoid doing anything else
     }
     instance = this;
     DontDestroyOnLoad(this.gameObject);
 }
        private static RpcFunctionInvocationDispatcher GetTestFunctionDispatcher(int maxProcessCountValue = 1, bool addWebhostChannel = false, Mock <IWebHostRpcWorkerChannelManager> mockwebHostLanguageWorkerChannelManager = null, bool throwOnProcessStartUp = false)
        {
            var eventManager            = new ScriptEventManager();
            var metricsLogger           = new Mock <IMetricsLogger>();
            var mockApplicationLifetime = new Mock <IApplicationLifetime>();
            var testEnv = new TestEnvironment();

            testEnv.SetEnvironmentVariable(RpcWorkerConstants.FunctionsWorkerProcessCountSettingName, maxProcessCountValue.ToString());

            var loggerFactory = MockNullLoggerFactory.CreateLoggerFactory();

            var options = new ScriptJobHostOptions
            {
                RootLogPath = Path.GetTempPath()
            };

            IOptions <ScriptJobHostOptions> scriptOptions = new OptionsManager <ScriptJobHostOptions>(new TestOptionsFactory <ScriptJobHostOptions>(options));

            var workerConfigOptions = new LanguageWorkerOptions
            {
                WorkerConfigs = TestHelpers.GetTestWorkerConfigs(processCountValue: maxProcessCountValue)
            };
            IRpcWorkerChannelFactory        testLanguageWorkerChannelFactory        = new TestRpcWorkerChannelFactory(eventManager, _testLogger, scriptOptions.Value.RootScriptPath, throwOnProcessStartUp);
            IWebHostRpcWorkerChannelManager testWebHostLanguageWorkerChannelManager = new TestRpcWorkerChannelManager(eventManager, _testLogger, scriptOptions.Value.RootScriptPath, testLanguageWorkerChannelFactory);
            IJobHostRpcWorkerChannelManager jobHostLanguageWorkerChannelManager     = new JobHostRpcWorkerChannelManager(loggerFactory);

            if (addWebhostChannel)
            {
                testWebHostLanguageWorkerChannelManager.InitializeChannelAsync("java");
            }
            if (mockwebHostLanguageWorkerChannelManager != null)
            {
                testWebHostLanguageWorkerChannelManager = mockwebHostLanguageWorkerChannelManager.Object;
            }
            var mockFunctionDispatcherLoadBalancer = new Mock <IRpcFunctionInvocationDispatcherLoadBalancer>();

            _javaTestChannel = new TestRpcWorkerChannel(Guid.NewGuid().ToString(), "java", eventManager, _testLogger, false);
            var optionsMonitor = TestHelpers.CreateOptionsMonitor(workerConfigOptions);

            return(new RpcFunctionInvocationDispatcher(scriptOptions,
                                                       metricsLogger.Object,
                                                       testEnv,
                                                       mockApplicationLifetime.Object,
                                                       eventManager,
                                                       loggerFactory,
                                                       testLanguageWorkerChannelFactory,
                                                       optionsMonitor,
                                                       testWebHostLanguageWorkerChannelManager,
                                                       jobHostLanguageWorkerChannelManager,
                                                       new OptionsWrapper <ManagedDependencyOptions>(new ManagedDependencyOptions()),
                                                       mockFunctionDispatcherLoadBalancer.Object));
        }
Пример #4
0
        public static void PrePatch(HarmonyInstance _)
        {
            // this is weird and should not be done in normal mods
            OptionsManager.MergeOptions(OptionsProvider);
            OptionsManager.SaveOptions(OptionsProvider);
            if (Options.EnableDeveloperConsole)
            {
                UnityEngine.Debug.LogError("Invoking error to show the developer console");
            }
            Logger.Info("Using options: {0}", Options.ToString());

            Logger.Info("Hooked into harmony, watching for assemblies to be patched in...");
        }
Пример #5
0
 public void init()
 {
     //update sound
     if (OptionsManager.GetOptions().IsNotificationSoundActivate)
     {
         this.Windows.StartSound();
     }
     else
     {
         this.Windows.StopSound();
     }
     this.StartServices();
 }
Пример #6
0
        public static UserManager <TUser> TestUserManager <TUser>(IUserStore <TUser> store) where TUser : class
        {
            var options     = new OptionsManager <IdentityOptions>(null);
            var validator   = new Mock <UserValidator <TUser> >();
            var userManager = new UserManager <TUser>(store, options, new PasswordHasher <TUser>(new PasswordHasherOptionsAccessor()),
                                                      null, null, new UpperInvariantUserNameNormalizer(), null, null);

            userManager.UserValidators.Add(validator.Object);
            userManager.PasswordValidators.Add(new PasswordValidator <TUser>());
            validator.Setup(v => v.ValidateAsync(userManager, It.IsAny <TUser>(), CancellationToken.None))
            .Returns(Task.FromResult(IdentityResult.Success)).Verifiable();
            return(userManager);
        }
Пример #7
0
        public AddressModelTests()
        {
            AutoMapperBootStrapper.CreateMapperConfiguration();
            IOptions <SiteDbContext> dataBaseConfig =
                new OptionsManager <SiteDbContext>(new IConfigureOptions <SiteDbContext> [0]);

            dataBaseConfig.Value.DefaultConnectionString =
                @"Data Source=haw.trustteam.be,41433; Initial Catalog=bocotransapp; Integrated Security=false;User ID =sa;Password=abit@complicated35; MultipleActiveResultSets=True";

            IUnitOfWork unitOfWork = new UnitOfWork(dataBaseConfig);

            _addressesService = new AddressesService(unitOfWork, null);
        }
Пример #8
0
    void Awake()
    {
        if (Instance != null)
        {
            Destroy(Instance);
        }
        else
        {
            Instance = this;
        }

        DontDestroyOnLoad(this);
    }
Пример #9
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }
Пример #10
0
        public DataManager()
        {
            var optionsManager = new OptionsManager();

            OptionsLib.PathOptions    = optionsManager.GetConfiguredOptionsModel <PathOptions>();
            OptionsLib.ServiceOptions = optionsManager.GetConfiguredOptionsModel <ServiceOptions>();

            InitializeComponent();

            this.CanStop             = OptionsLib.ServiceOptions.CanStop;
            this.CanPauseAndContinue = OptionsLib.ServiceOptions.CanPauseAndContinue;
            this.AutoLog             = OptionsLib.ServiceOptions.AutoLog;
        }
Пример #11
0
    //On Start, get the options from GlobalVars.
    void Start()
    {
        instance = this;

        musicVolume = GlobalVars.instance.musicVolume;
        fxVolume    = GlobalVars.instance.fxVolume;

        if (SceneManager.GetActiveScene().name.Equals("Menu"))
        {
            musicSlider.value = musicVolume;
            fxSlider.value    = fxVolume;
        }
    }
Пример #12
0
    IEnumerator OpenRight(float time)
    {
        yield return(new WaitForSeconds(time));

        Destroy(_wall);
        _wall = MyInstantiate(
            Levels[Level].Walls.StaticWallsRight,
            _room_current.transform.position.x,
            _room_current.transform.position.y);

        _room_current.GetComponent <AudioSource>().volume = UnlockSFXVolume * OptionsManager.GetSoundVolume();
        _room_current.GetComponent <AudioSource>().PlayOneShot(UnlockSFX);
    }
Пример #13
0
    void Start()
    {
        blocNote = GetComponent <BlocNoteManager>();
        UIPhoto  = GetComponent <Photo.UIPhoto>();
        options  = GetComponent <OptionsManager>();

        // Coefficient du rescale de l'UI

        isActive = book.activeSelf;

        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;
    }
Пример #14
0
 void OnLevelWasLoaded()
 {
     if (SceneManager.GetActiveScene().name.Equals("LevelScene"))
     {
         playStartTime = Time.time;
         if (playerName == null || playerName.Length == 0)
         {
             playerName = "Unbekannt";
         }
         OptionsManager.setReflectionQualityOptions();
         OptionsManager.setVolumeSettings();
     }
 }
Пример #15
0
        private void btnTestOptionsManager_Click(object sender, EventArgs e)
        {
            OptionsManager.Initialize(Application.StartupPath + "\\prometheus.ini", Application.StartupPath + "\\user.ini");
            bool   isItTrue    = (bool)OptionsManager.Core["Test Group", "Value1", false];
            string path        = (string)OptionsManager.Core["Paths", "HaloCEPath", @"C:\STFU\Halo"];
            int    someInteger = (int)OptionsManager.Core["Test Group", "IntegerTest", 12345];
            float  someFloat   = (float)OptionsManager.Core["Test Group", "FloatTest", (float)Math.PI];

            OptionsManager.Core["Stuff", "Something"]        = false;
            OptionsManager.Core["Test Group", "IntegerTest"] = 555;
            OptionsManager.User["GUI", "Stuff"]       = "MB";
            OptionsManager.User["GUI", "Nick is gay"] = true;
        }
        public JavaScriptBrowserControl()
        {
            InitializeComponent();
            CreateDefaultDocuments();
            OptionsManager manager = new OptionsManager();

            this.Load  += new EventHandler(JavaScriptBrowserControl_Load);
            optionsForm = new OptionsForm();

            webBrowser.ScriptErrorsSuppressed = true;
            webBrowser.NewWindow += new CancelEventHandler(webBrowser_NewWindow);
            ChangeOrientation();
        }
    /*
     * If hit with a normal attack from the front, the skeleton warrior should block and take no damage
     * If hit with a normal attack from the back, the skeleton warrior should take damage
     * If hit with a stun attack, should be stun regardless if blocking or not
     */
    public void OnHit(int damage, bool stun, Vector3 particlePosition)
    {
        if (Health <= 0)
        {
            return;
        }

        bool facing_player = false;

        //if facing right and to the left of player
        if (transform.eulerAngles.y == 0 && transform.position.x < _player.transform.position.x)
        {
            facing_player = true;
        }
        if (transform.eulerAngles.y == 180 && transform.position.x > _player.transform.position.x)
        {
            facing_player = true;
        }

        if (!stun && facing_player && !_stunned && Health > 0)
        {
            _animator.ResetTrigger("Attack");
            _animator.SetBool("Block", true);
            _time_of_block_start = Time.time;

            GetComponent <AudioSource>().volume = 0.2f * OptionsManager.GetSoundVolume();
            GetComponent <AudioSource>().PlayOneShot(BlockSFX);
            return;
        }

        Instantiate(Particles, particlePosition, new Quaternion());
        GetComponent <AudioSource>().volume = (stun ? 0.5f : 0.2f) * OptionsManager.GetSoundVolume();
        GetComponent <AudioSource>().PlayOneShot(HitSFX);

        Health -= damage;
        if (Health <= 0)
        {
            _animator.SetBool("Dead", true);
            return;
        }

        else if (stun)
        {
            _animator.SetBool("Block", false);
            _animator.SetTrigger("Stun");

            _stunned = true;
            StopCoroutine(ResetStun());
            StartCoroutine(ResetStun());
        }
    }
Пример #18
0
    // Use this for initialization
    void Awake()
    {
        if (manager == null)
        {
            DontDestroyOnLoad(transform.gameObject);
            manager = this;

            loadOptions();
        }
        else if (manager != this)
        {
            Destroy(transform.gameObject);
        }
    }
Пример #19
0
 //Displays a string in a dialouge box depending on the object in front of the player.
 public void HandleExaminationTags(RaycastHit2D[] hits)
 {
     for (int i = 0; i < hits.Length; i++)
     {
         if (hits[i].collider != null && hits[i].collider.CompareTag("Gate") && manager.CheckEqual(hits[i].collider))
         {
             myAction  = Action.Options;
             myOptions = new OptionsManager(new string[] { "" });
             dialogueManager.MainText.text = "The gate in front of you is currently " + manager.GetComponent <GameManagerScript>().GetEqual(hits[i].collider).GetComponent <GateScript>().GetColor() + ".";
             dialogueManager.Show();
             optionsObject = manager.GetEqual(hits[i].collider);
         }
     }
 }
Пример #20
0
    private void SaveRollValues()
    {
        float pValue = float.Parse(_pidInputRollP.GetComponent <InputField>().text, CultureInfo.InvariantCulture.NumberFormat);

        OptionsManager.SetPIDRollP(pValue);

        float iValue = float.Parse(_pidInputRollI.GetComponent <InputField>().text, CultureInfo.InvariantCulture.NumberFormat);

        OptionsManager.SetPIDRollI(iValue);

        float dValue = float.Parse(_pidInputRollD.GetComponent <InputField>().text, CultureInfo.InvariantCulture.NumberFormat);

        OptionsManager.SetPIDRollD(dValue);
    }
Пример #21
0
    private void SavePitchValues()
    {
        float pValue = float.Parse(_pidInputPitchP.GetComponent <InputField>().text, CultureInfo.InvariantCulture.NumberFormat);

        OptionsManager.SetPIDPitchP(pValue);

        float iValue = float.Parse(_pidInputPitchI.GetComponent <InputField>().text, CultureInfo.InvariantCulture.NumberFormat);

        OptionsManager.SetPIDPitchI(iValue);

        float dValue = float.Parse(_pidInputPitchD.GetComponent <InputField>().text, CultureInfo.InvariantCulture.NumberFormat);

        OptionsManager.SetPIDPitchD(dValue);
    }
Пример #22
0
        public static ContainerBuilder ConfigureBuilder(string componentName, AlertsSettings settings)
        {
            var builder = new ContainerBuilder();

            IConfigureOptions <LoggerOptions> configureOptions = new ConfigureOptions <LoggerOptions>(x =>
            {
                x.ConnectionString = settings.Logger.ConnectionString;
                x.ErrorTableName   = settings.Logger.ErrorTableName;
                x.InfoTableName    = settings.Logger.InfoTableName;
                x.WarningTableName = settings.Logger.WarningTableName;
            });

            var loggerOptions = new OptionsManager <LoggerOptions>(new List <IConfigureOptions <LoggerOptions> > {
                configureOptions
            });

            builder.Register(ctx => new SlackNotifier(new AzureQueueExt(settings.SlackQueue.ConnectionString, settings.SlackQueue.Name))).As <ISlackNotifier>().SingleInstance();

            builder.Register(ctx => new TableLogger(ctx.Resolve <ISlackNotifier>(), loggerOptions, settings.VerboseLogging)).As <ILog>().SingleInstance();

            var            client     = new MongoClient($"{settings.Mongo.Host}:{settings.Mongo.Port}");
            IMongoDatabase mongo      = client.GetDatabase(settings.Mongo.DbName);
            var            collection = mongo.GetCollection <TransactionMongoEntity>(settings.Mongo.CollectionName);

            //builder.Register(ctx => new AzureQueueExt(settings.TransitQueue.ConnectionString, settings.TransitQueue.Name)).As<IQueueExt>().SingleInstance();

            builder.Register(ctx => new MonitoringRepository(new AzureTableStorage <MonitoringEntity>(settings.Monitoring.ConnectionString, settings.Monitoring.Name, ctx.Resolve <ILog>()))).As <IMonitoringRepository>().SingleInstance();

            builder.Register(ctx => new EmailNotifier(new List <string> {
                "*****@*****.**"
            }, new AzureQueueExt(settings.EmailQueue.ConnectionString, settings.EmailQueue.Name))).As <IEmailNotifier>().SingleInstance();;

            builder.Register(ctx => new AlertsJob(
                                 componentName,
                                 collection,
                                 new AzureQueueExt(settings.TransitQueue.ConnectionString, settings.TransitQueue.Name),
                                 new AzureQueueExt(settings.CashOutQueue.ConnectionString, settings.CashOutQueue.Name),
                                 ctx.Resolve <ILog>(),
                                 ctx.Resolve <IEmailNotifier>()
                                 )).As <AlertsJob>().SingleInstance();

            builder.Register(ctx => new AlertsMonitoring(
                                 componentName,
                                 ctx.Resolve <IMonitoringRepository>(),
                                 ctx.Resolve <ILog>())).As <AlertsMonitoring>().SingleInstance();

            builder.AddTriggers();

            return(builder);
        }
Пример #23
0
    void Awake()
    {
        if (_Instance == null)
        {
            _Instance = this;
        }
        else if (_Instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
        LoadSoundOption();
    }
Пример #24
0
        private static IServiceProvider CreateServices()
        {
            var options = new OptionsManager<MvcOptions>(new IConfigureOptions<MvcOptions>[] { });
            options.Value.OutputFormatters.Add(new StringOutputFormatter());
            options.Value.OutputFormatters.Add(new JsonOutputFormatter());

            var services = new ServiceCollection();
            services.AddSingleton(new ObjectResultExecutor(
                options,
                new TestHttpResponseStreamWriterFactory(),
                NullLoggerFactory.Instance));

            return services.BuildServiceProvider();
        }
Пример #25
0
 // Use this for initialization
 void Start()
 {
     DontDestroyOnLoad(gameObject);
     //	PlayerPrefs.DeleteAll ();
     //make sure only one optionsmanager loads ever
     if (instance == null)
     {
         instance = this;
     }
     if (instance != this)
     {
         Destroy(gameObject);
     }
 }
 void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Room" || collision.tag == "Platform")
     {
         if (Grounded) //avoid case of sound playing when moving between rooms
         {
             return;
         }
         Grounded = true;
         _animator.SetBool("Grounded", true);
         _audio_source.volume = LandSFXVolume * OptionsManager.GetSoundVolume();
         _audio_source.PlayOneShot(LandSFX);
     }
 }
Пример #27
0
        public Logger()
        {
            var optionsManager = new OptionsManager(AppDomain.CurrentDomain.BaseDirectory);

            configOptions        = optionsManager.GetOptions <Options>();
            path                 = configOptions.PathToDirectory.SourceDirectory;
            watcher              = new FileSystemWatcher(path);
            watcher.NotifyFilter = NotifyFilters.LastAccess
                                   | NotifyFilters.LastWrite
                                   | NotifyFilters.FileName
                                   | NotifyFilters.DirectoryName;
            watcher.Filter   = "*.txt";
            watcher.Created += Watcher_Created;
        }
    private void SetupPidGains()
    {
        Vector3 pitchGains = new Vector3(OptionsManager.GetPIDPitchP(), OptionsManager.GetPIDPitchI(), OptionsManager.GetPIDPitchD());

        SetPitchGains(pitchGains);

        Vector3 rollGains = new Vector3(OptionsManager.GetPIDRollP(), OptionsManager.GetPIDRollI(), OptionsManager.GetPIDRollD());

        SetRollGains(rollGains);

        Vector3 yawGains = new Vector3(OptionsManager.GetPIDYawP(), OptionsManager.GetPIDYawI(), OptionsManager.GetPIDYawD());

        SetYawGains(yawGains);
    }
    private void Start()
    {
        Instance = this;

        // Set resolution after fullscreen.
        ConfigReader configReader = new ConfigReader(SETTINGS_FILE_NAME);

        _resolutions = Screen.resolutions;
        _resolutionDropdown.ClearOptions();
        List <string> resolutionOptions      = new List <string>();
        int           currentResolutionIndex = 0;

        for (int i = 0; i < _resolutions.Length; i++)
        {
            string option = _resolutions[i].width + " x " + _resolutions[i].height + " (" + _resolutions[i].refreshRate + "Hz)";
            resolutionOptions.Add(option);
            if (_resolutions[i].width == Screen.currentResolution.width && _resolutions[i].height == Screen.currentResolution.height && _resolutions[i].refreshRate == Screen.currentResolution.refreshRate)
            {
                currentResolutionIndex = i;
            }
        }
        _resolutionDropdown.AddOptions(resolutionOptions);
        _resolutionDropdown.value = configReader.GetInt(RESOLUTION_VALUE, currentResolutionIndex);
        _resolutionDropdown.RefreshShownValue();

        // Load rest of configurations.
        SetQuality(configReader.GetInt(QUALITY_VALUE, 2));
        _isFullscreenSave = configReader.GetString(FULLSCREEN_VALUE, TRUE_VALUE).Equals(TRUE_VALUE);
        SetFullscreen(_isFullscreenSave);
        _fullScreenToggle.isOn = _isFullscreenSave;

        // Set screen resolution after load settings.
        _resolutionIndexSave = _resolutionDropdown.value;
        Resolution resolution = _resolutions[_resolutionDropdown.value];

        Screen.SetResolution(resolution.width, resolution.height, _isFullscreenSave, resolution.refreshRate);

        float musicVolume = configReader.GetFloat(MUSIC_VOLUME_VALUE, 1);

        MasterVolume(musicVolume);
        _musicSlider.value = musicVolume;
        float sfxVolume = configReader.GetFloat(SFX_VOLUME_VALUE, 1);

        GameSFX(sfxVolume);
        _sfxSlider.value = sfxVolume;

        // Mute sound.
        AudioListener.volume = 0;
    }
Пример #30
0
 public void updateManagers()
 {
     if (_instance == null)
     {
         _instance = this;
     }
     if (healthManagerInstance == null)
     {
         healthManagerInstance = HealthManager._instance;
     }
     if (optionsManagerInstance == null)
     {
         optionsManagerInstance = OptionsManager._instance;
     }
 }
Пример #31
0
 protected override void OnStart(string[] args)
 {
     try
     {
         OptionsManager optionsManager = new OptionsManager(@"D:\Lab4\DataManagerService\bin\Release\AppSettings.json");
         options = optionsManager.GetOptions <FileManagerOptions>();
         logger  = new Logger(options);
         Thread loggerThread = new Thread(new ThreadStart(logger.Start));
         loggerThread.Start();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #32
0
        public void InitializesEmptyOrMissingDirectorySnapshot(string rootScriptPath)
        {
            var scriptConfig = new ScriptJobHostOptions()
            {
                RootScriptPath = rootScriptPath
            };

            IOptions <ScriptJobHostOptions>  scriptOptions         = new OptionsManager <ScriptJobHostOptions>(new TestOptionsFactory <ScriptJobHostOptions>(scriptConfig));
            IOptions <LanguageWorkerOptions> languageWorkerOptions = new OptionsManager <LanguageWorkerOptions>(new TestOptionsFactory <LanguageWorkerOptions>(new LanguageWorkerOptions()));

            var functionMetadataManager = new FunctionMetadataManager(scriptOptions, languageWorkerOptions, NullLoggerFactory.Instance);

            Assert.False(functionMetadataManager.Functions.IsDefault);
            Assert.True(functionMetadataManager.Functions.IsEmpty);
        }
Пример #33
0
 public TemplateRazorEngine(
     TemplateFactoryProvider pageFactory,
     IRazorPageActivator pageActivator,
     HtmlEncoder htmlEncoder,
     OptionsManager <TemplateOptions> optionsAccessor,
     RazorProjectFileSystem razorFileSystem,
     ILoggerFactory loggerFactory,
     DiagnosticSource diagnosticSource)
     : base(
         pageFactory, pageActivator, htmlEncoder,
         optionsAccessor, razorFileSystem,
         loggerFactory,
         diagnosticSource)
 {
 }
Пример #34
0
    // Use this for initialization
    void Start()
    {
        lerping = false;
        lerpRate = 0.2f;

        goingRight = false;
        goingLeft = false;
        goingUp = false;
        goingDown = false;

        optionsScript = options.GetComponent<OptionsManager>();
        rotateSpeed = restingRotateSpeed;
        targetRotateSpeed = rotateSpeed;
        rotatingLeft = -1;

        float cursorDepth = -8.9f;

        float firstLineHeight = 1.0f;
        float secondLineHeight = -2.2f;
        float thirdLineHeight = -3.4f;

        float firstColumn = 2.85f;
        float secondColumn = 7.4f;
        float thirdColumn = 11.9f;

        float firstColumnBottom = 1.1f;
        float secondColumnBottom = 7.4f;
        float thirdColumnBottom = 14f;

        playersPos = new Vector3(firstColumn, firstLineHeight, cursorDepth);
        fogPos = new Vector3(secondColumn, firstLineHeight, cursorDepth);
        waterPos = new Vector3(thirdColumn, firstLineHeight, cursorDepth);

        speedPos = new Vector3(firstColumn, secondLineHeight, cursorDepth);
        sizePos = new Vector3(secondColumn, secondLineHeight, cursorDepth);
        tutorialPos = new Vector3(thirdColumn, secondLineHeight, cursorDepth);

        backPos = new Vector3(firstColumnBottom, thirdLineHeight, cursorDepth);
        resetPos = new Vector3(secondColumnBottom, thirdLineHeight, cursorDepth);
        startPos = new Vector3(thirdColumnBottom, thirdLineHeight, cursorDepth);
    }
Пример #35
0
		public Manager(CommandLineArguments args)
		{
			mAssemblies = new List<Assembly>();
			mPlugins = new PluginCollection();
			mOpenDocuments = new List<Document>();
			mFileTypes = new Dictionary<string, Type>();
			mActiveDocument = null;

			mFileWatcher = new FileWatcher();
			mFileWatcher.FileModified += new FileModifiedEventHandler(FileWatcher_FileModified);
			mFileWatcher.FileAttributesChanged += new FileAttributesChangedEventHandler(FileWatcher_FileAttributesChanged);

			mOptionsManager = new OptionsManager(this);
			mApplicationOptions = new ApplicationOptions();
			mOptionsManager.Options.Add(mApplicationOptions);

			mAssemblies.Add(Assembly.GetExecutingAssembly());

			mPluginPath = new List<string>();
			string currentDirectory = System.IO.Directory.GetCurrentDirectory();
			string exeDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			mPluginPath.Add(currentDirectory);
			if(currentDirectory != exeDirectory)
				mPluginPath.Add(exeDirectory);

			foreach (string path in args.GetValues("--pluginFolder"))
				mPluginPath.Add(path);

			foreach (string path in mPluginPath)
			{
				FindPlugins(path);
			}

			mRegistryRoot = Registry.CurrentUser.OpenSubKey("Software\\Tantalus\\Tilde", true);
			if (mRegistryRoot == null)
				mRegistryRoot = Registry.CurrentUser.CreateSubKey("Software\\Tantalus\\Tilde");

			CreatePlugins();
		}
Пример #36
0
        public void Setup_JsonFormattersUseSerializerSettings()
        {
            // Arrange
            var jsonOptionsAccessor = new OptionsManager<MvcJsonOptions>(
                Enumerable.Empty<IConfigureOptions<MvcJsonOptions>>());

            var mvcOptions = new MvcOptions();
            var setup = new JsonMvcOptionsSetup(jsonOptionsAccessor);

            // Act
            setup.Configure(mvcOptions);

            // Assert
            var jsonInputFormatters = mvcOptions.InputFormatters.OfType<JsonInputFormatter>();
            foreach (var jsonInputFormatter in jsonInputFormatters)
            {
                Assert.Same(jsonOptionsAccessor.Options.SerializerSettings, jsonInputFormatter.SerializerSettings);
            }

            var jsonOuputFormatters = mvcOptions.OutputFormatters.OfType<JsonOutputFormatter>();
            foreach (var jsonOuputFormatter in jsonOuputFormatters)
            {
                Assert.Same(jsonOptionsAccessor.Options.SerializerSettings, jsonOuputFormatter.SerializerSettings);
            }
        }
Пример #37
0
		public void Load(OptionsManager options)
		{
			options.Load(this);
		}
Пример #38
0
		public void Store(OptionsManager options)
		{
			options.Store(this);
		}