System.Net.CookieCollection.TimeStamp C# (CSharp) Метод

TimeStamp() приватный Метод

private TimeStamp ( Stamp how ) : DateTime
how Stamp
Результат DateTime
        internal DateTime TimeStamp(Stamp how)
        {
            switch (how)
            {
                case Stamp.Set:
                    _timeStamp = DateTime.Now;
                    break;
                case Stamp.SetToMaxUsed:
                    _timeStamp = DateTime.MaxValue;
                    break;
                case Stamp.SetToUnused:
                    _timeStamp = DateTime.MinValue;
                    break;
                case Stamp.Check:
                default:
                    break;
            }
            return _timeStamp;
        }

Usage Example

Пример #1
0
        private void BuildCookieCollectionFromDomainMatches(Uri uri, bool isSecure, int port, CookieCollection cookies, List <string> domainAttribute, bool matchOnlyPlainCookie)
        {
            for (int i = 0; i < domainAttribute.Count; i++)
            {
                bool     found        = false;
                bool     defaultAdded = false;
                PathList pathList;
                lock (m_domainTable.SyncRoot) {
                    pathList = (PathList)m_domainTable[domainAttribute[i]];
                }

                if (pathList == null)
                {
                    continue;
                }

                lock (pathList.SyncRoot) {
                    foreach (DictionaryEntry entry in pathList)
                    {
                        string path = (string)entry.Key;
                        if (uri.AbsolutePath.StartsWith(CookieParser.CheckQuoted(path)))
                        {
                            found = true;

                            CookieCollection cc = (CookieCollection)entry.Value;
                            cc.TimeStamp(CookieCollection.Stamp.Set);
                            MergeUpdateCollections(cookies, cc, port, isSecure, matchOnlyPlainCookie);

                            if (path == "/")
                            {
                                defaultAdded = true;
                            }
                        }
                        else if (found)
                        {
                            break;
                        }
                    }
                }

                if (!defaultAdded)
                {
                    CookieCollection cc = (CookieCollection)pathList["/"];

                    if (cc != null)
                    {
                        cc.TimeStamp(CookieCollection.Stamp.Set);
                        MergeUpdateCollections(cookies, cc, port, isSecure, matchOnlyPlainCookie);
                    }
                }

                // Remove unused domain
                // (This is the only place that does domain removal)
                if (pathList.Count == 0)
                {
                    AddRemoveDomain(domainAttribute[i], null);
                }
            }
        }
All Usage Examples Of System.Net.CookieCollection::TimeStamp