System.Net.Cache.ResponseCacheControl.ToString C# (CSharp) Method

ToString() public method

public ToString ( ) : string
return string
        public override string  ToString() {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            if (Public) {
                sb.Append(" public");
            }
            if (Private) {
                sb.Append(" private");
                if (PrivateHeaders != null) {
                    sb.Append('=');
                    for (int i = 0; i < PrivateHeaders.Length-1; ++i) {
                        sb.Append(PrivateHeaders[i]).Append(',');
                    }
                    sb.Append(PrivateHeaders[PrivateHeaders.Length-1]);
                }
            }
            if (NoCache) {
                sb.Append(" no-cache");
                if (NoCacheHeaders != null) {
                    sb.Append('=');
                    for (int i = 0; i < NoCacheHeaders.Length-1; ++i) {
                        sb.Append(NoCacheHeaders[i]).Append(',');
                    }
                    sb.Append(NoCacheHeaders[NoCacheHeaders.Length-1]);
                }
            }
            if (NoStore) {
                sb.Append(" no-store");
            }
            if (MustRevalidate) {
                sb.Append(" must-revalidate");
            }
            if (ProxyRevalidate) {
                sb.Append(" proxy-revalidate");
            }
            if (MaxAge != -1) {
                sb.Append(" max-age=").Append(MaxAge);
            }
            if (SMaxAge != -1) {
                sb.Append(" s-maxage=").Append(SMaxAge);
            }
            return sb.ToString();
        }
    }