Example #1
0
 private static void FillManagedContextOutput(SassContextBase context, ref Sass_Context ctx)
 {
     context.OutputString    = Sass_Api.sass_context_get_output_string(ctx);
     context.SourceMapString = Sass_Api.sass_context_get_source_map_string(ctx);
     context.IncludedFiles   = MarshallingHelpers.PtrToStringArray(
         Sass_Api.sass_context_get_included_files(ctx),
         Sass_Api.sass_context_get_included_files_size(ctx)
         );
 }
        private static void FillManagedContextError(SassContextBase context, ref Sass_Context ctx)
        {
            var error = new SassErrorInfo
            {
                Status  = Sass_Api.sass_context_get_error_status(ctx),
                Text    = Sass_Api.sass_context_get_error_text(ctx),
                Message = Sass_Api.sass_context_get_error_message(ctx),
                File    = Sass_Api.sass_context_get_error_file(ctx),
                Line    = Sass_Api.sass_context_get_error_line(ctx),
                Column  = Sass_Api.sass_context_get_error_column(ctx),
                Source  = Sass_Api.sass_context_get_error_src(ctx)
            };

            context.Error = error;
        }
 private static void FillManagedContextOutput(SassContextBase context, ref Sass_Context ctx)
 {
     context.OutputString    = Sass_Api.sass_context_get_output_string(ctx);
     context.SourceMapString = Sass_Api.sass_context_get_source_map_string(ctx);
     context.IncludedFiles   = Sass_Api.sass_context_get_included_files(ctx);
 }
        private static void FillUnmanagedContextOptions(ref Sass_Options ctx_options, SassContextBase context)
        {
            SassOptions options = context.Options;

            foreach (string importExtension in options.AdditionalImportExtensions)
            {
                Sass_Api.sass_option_push_import_extension(ctx_options, importExtension);
            }

            Sass_Api.sass_option_set_include_path(ctx_options, options.IncludePath);
            Sass_Api.sass_option_set_indent(ctx_options, options.Indent);
            Sass_Api.sass_option_set_input_path(ctx_options, context.InputPath);
            Sass_Api.sass_option_set_is_indented_syntax_src(ctx_options, context.IsIndentedSyntaxSource);
            Sass_Api.sass_option_set_linefeed(ctx_options, options.LineFeed);
            Sass_Api.sass_option_set_omit_source_map_url(ctx_options, options.OmitSourceMapUrl);
            Sass_Api.sass_option_set_output_path(ctx_options, context.OutputPath);
            Sass_Api.sass_option_set_output_style(ctx_options, (Sass_Output_Style)options.OutputStyle);
            Sass_Api.sass_option_set_precision(ctx_options, options.Precision);
            Sass_Api.sass_option_set_source_comments(ctx_options, options.SourceComments);
            Sass_Api.sass_option_set_source_map_contents(ctx_options, options.SourceMapContents);
            Sass_Api.sass_option_set_source_map_embed(ctx_options, options.SourceMapEmbed);
            Sass_Api.sass_option_set_source_map_file(ctx_options, context.SourceMapFile);
            Sass_Api.sass_option_set_source_map_file_urls(ctx_options, options.SourceMapFileUrls);
            Sass_Api.sass_option_set_source_map_root(ctx_options, options.SourceMapRoot);
        }