Ejemplo n.º 1
0
        public GdiRenderingSettings Clone()
        {
            GdiRenderingSettings clonedSettings = new GdiRenderingSettings(this);

            if (!string.IsNullOrWhiteSpace(_defaultFontName))
            {
                clonedSettings._defaultFontName = new string(_defaultFontName.ToCharArray());
            }
            if (!string.IsNullOrWhiteSpace(_userCssFilePath))
            {
                clonedSettings._userCssFilePath = new string(_userCssFilePath.ToCharArray());
            }
            if (!string.IsNullOrWhiteSpace(_userAgentCssFilePath))
            {
                clonedSettings._userAgentCssFilePath = new string(_userAgentCssFilePath.ToCharArray());
            }
            if (_culture != null)
            {
                clonedSettings._culture = (CultureInfo)_culture.Clone();
            }
            if (_neutralCulture != null)
            {
                clonedSettings._neutralCulture = (CultureInfo)_neutralCulture.Clone();
            }

            return(clonedSettings);
        }
Ejemplo n.º 2
0
        public GdiRenderingSettings(GdiRenderingSettings settings)
        {
            if (settings == null)
            {
                return;
            }

            _defaultFontName = settings._defaultFontName;

            _neutralCulture = settings._neutralCulture;
            _culture        = settings._culture;

            _pixelWidth  = settings._pixelWidth;
            _pixelHeight = settings._pixelHeight;

            _ensureViewboxSize     = settings._ensureViewboxSize;
            _ensureViewboxPosition = settings._ensureViewboxPosition;
            _ignoreRootViewbox     = settings._ignoreRootViewbox;

            _userCssFilePath      = settings._userCssFilePath;
            _userAgentCssFilePath = settings._userAgentCssFilePath;

            _properties = settings._properties;
        }