public USyncConfigurationProvider(string uSyncConfigPath, IRelativePathResolver pathResolver)
		{
			this.uSyncConfigPath = uSyncConfigPath;
			this.pathResolver = pathResolver;
		}
		/// <summary>
		/// Constructs a instance of URL rewriting CSS-postprocessor
		/// </summary>
		/// <param name="relativePathResolver">Relative path resolver</param>
		public UrlRewritingCssPostProcessor(IRelativePathResolver relativePathResolver)
		{
			_relativePathResolver = relativePathResolver;
		}
Пример #3
0
 /// <summary>
 /// Constructs a instance of URL rewriting CSS postprocessor
 /// </summary>
 /// <param name="relativePathResolver">Relative path resolver</param>
 public UrlRewritingCssPostProcessor(IRelativePathResolver relativePathResolver)
 {
     _relativePathResolver = relativePathResolver;
 }
 public USyncConfigurationProvider(string uSyncConfigPath, IRelativePathResolver pathResolver)
 {
     this.uSyncConfigPath = uSyncConfigPath;
     this.pathResolver    = pathResolver;
 }
        /// <summary>
        /// Constructs a instance of TypeScript-translator
        /// </summary>
        /// <param name="createJsEngineInstance">Delegate that creates an instance of JavaScript engine</param>
        /// <param name="virtualFileSystemWrapper">Virtual file system wrapper</param>
        /// <param name="relativePathResolver">Relative path resolver</param>
        /// <param name="tsConfig">Configuration settings of TypeScript-translator</param>
        public TypeScriptTranslator(Func<IJsEngine> createJsEngineInstance,
            IVirtualFileSystemWrapper virtualFileSystemWrapper,
            IRelativePathResolver relativePathResolver, TypeScriptSettings tsConfig)
        {
            _virtualFileSystemWrapper = virtualFileSystemWrapper;
            _relativePathResolver = relativePathResolver;
            _tsScriptCache = new Dictionary<string, TsScript>();

            ExperimentalAsyncFunctions = tsConfig.ExperimentalAsyncFunctions;
            NewLine = tsConfig.NewLine;
            NoEmit = tsConfig.NoEmit;
            NoEmitHelpers = tsConfig.NoEmitHelpers;
            NoEmitOnError = tsConfig.NoEmitOnError;
            NoImplicitAny = tsConfig.NoImplicitAny;
            NoLib = tsConfig.NoLib;
            PreserveConstEnums = tsConfig.PreserveConstEnums;
            RemoveComments = tsConfig.RemoveComments;
            SkipDefaultLibCheck = tsConfig.SkipDefaultLibCheck;
            StripInternal = tsConfig.StripInternal;
            SuppressExcessPropertyErrors = tsConfig.SuppressExcessPropertyErrors;
            SuppressImplicitAnyIndexErrors = tsConfig.SuppressImplicitAnyIndexErrors;
            Target = tsConfig.Target;

            if (createJsEngineInstance == null)
            {
                string jsEngineName = tsConfig.JsEngine.Name;
                if (string.IsNullOrWhiteSpace(jsEngineName))
                {
                    throw new ConfigurationErrorsException(
                        string.Format(CoreStrings.Configuration_JsEngineNotSpecified,
                            "typeScript",
                            @"
              * JavaScriptEngineSwitcher.Msie
              * JavaScriptEngineSwitcher.V8",
                            "MsieJsEngine")
                    );
                }

                createJsEngineInstance = (() =>
                    JsEngineSwitcher.Current.CreateJsEngineInstance(jsEngineName));
            }
            _createJsEngineInstance = createJsEngineInstance;
        }
		/// <summary>
		/// Constructs a instance of LESS-translator
		/// </summary>
		/// <param name="createJsEngineInstance">Delegate that creates an instance of JavaScript engine</param>
		/// <param name="virtualFileSystemWrapper">Virtual file system wrapper</param>
		/// <param name="relativePathResolver">Relative path resolver</param>
		/// <param name="lessConfig">Configuration settings of LESS-translator</param>
		public LessTranslator(Func<IJsEngine> createJsEngineInstance,
			IVirtualFileSystemWrapper virtualFileSystemWrapper,
			IRelativePathResolver relativePathResolver,
			LessSettings lessConfig)
		{
			_virtualFileSystemWrapper = virtualFileSystemWrapper;
			_relativePathResolver = relativePathResolver;
			_lessStylesheetCache = new Dictionary<string, LessStylesheet>();

			UseNativeMinification = lessConfig.UseNativeMinification;
			IeCompat = lessConfig.IeCompat;
			StrictMath = lessConfig.StrictMath;
			StrictUnits = lessConfig.StrictUnits;
			DumpLineNumbers = lessConfig.DumpLineNumbers;
			JavascriptEnabled = lessConfig.JavascriptEnabled;
			GlobalVariables = lessConfig.GlobalVariables;
			ModifyVariables = lessConfig.ModifyVariables;

			if (createJsEngineInstance == null)
			{
				string jsEngineName = lessConfig.JsEngine.Name;
				if (string.IsNullOrWhiteSpace(jsEngineName))
				{
					throw new ConfigurationErrorsException(
						string.Format(CoreStrings.Configuration_JsEngineNotSpecified,
							"less",
							@"
  * JavaScriptEngineSwitcher.Msie
  * JavaScriptEngineSwitcher.V8",
							"MsieJsEngine")
					);
				}

				createJsEngineInstance = (() =>
					JsEngineSwitcher.Current.CreateJsEngineInstance(jsEngineName));
			}
			_createJsEngineInstance = createJsEngineInstance;
		}