示例#1
0
 static SassCompiler()
 {
     SassInfo = new VersionInfo
     {
         LibSassNetVersion   = typeof(SassCompiler).Assembly.GetName().Version.ToString(),
         LibSassVersion      = SassSafeContextHandle.LibsassVersion(),
         SassLanguageVersion = SassSafeContextHandle.SassLanguageVersion()
     };
 }
示例#2
0
        /// <summary>
        /// Provides an instance of LibSass wrapper class.
        /// </summary>
        /// <param name="sassOptions">Sass options object for compilation.</param>
        /// <remarks>
        /// Replicates LibSass behaviour for context resolution, that is;
        /// if data is provided, make data context and set input file as
        /// supplementary option. Otherwise make a file context.
        /// </remarks>
        public SassCompiler(ISassOptions sassOptions)
        {
            if (string.IsNullOrEmpty(sassOptions.Data))
            {
                _internalContext = new SassSafeFileContextHandle(sassOptions);
            }
            else
            {
                _internalContext = new SassSafeDataContextHandle(sassOptions);
            }

            _internalContext.SetOptions(sassOptions);
        }
示例#3
0
 internal static IntPtr sass_context_get_included_files(SassSafeContextHandle @context)
 {
     return(IntPtr.Size == 4
         ? SassExterns32.sass_context_get_included_files(@context)
         : SassExterns64.sass_context_get_included_files(@context));
 }
示例#4
0
 internal static int sass_context_get_error_column(SassSafeContextHandle @context)
 {
     return(IntPtr.Size == 4
         ? SassExterns32.sass_context_get_error_column(@context)
         : SassExterns64.sass_context_get_error_column(@context));
 }
示例#5
0
 internal static IntPtr sass_context_get_source_map_string(SassSafeContextHandle @context)
 {
     return(IntPtr.Size == 4
         ? SassExterns32.sass_context_get_source_map_string(@context)
         : SassExterns64.sass_context_get_source_map_string(@context));
 }
示例#6
0
 internal static extern IntPtr sass_context_get_error_text(SassSafeContextHandle @context);
示例#7
0
 internal static IntPtr sass_context_get_error_message(SassSafeContextHandle @context)
 {
     return(IntPtr.Size == 4
         ? SassExterns32.sass_context_get_error_message(@context)
         : SassExterns64.sass_context_get_error_message(@context));
 }
示例#8
0
 internal static extern int sass_context_get_error_status(SassSafeContextHandle @context);
示例#9
0
 internal static extern IntPtr sass_context_get_output_string(SassSafeContextHandle @context);
示例#10
0
 internal static extern IntPtr sass_context_get_options(SassSafeContextHandle @context);
示例#11
0
 internal static extern IntPtr sass_context_get_included_files(SassSafeContextHandle @context);
示例#12
0
 internal static extern IntPtr sass_context_get_source_map_string(SassSafeContextHandle @context);