Esempio n. 1
0
 public void Dispose()
 {
     if (Interlocked.Decrement(ref refCount) <= 0)
     {
         Inner.Clear();
     }
 }
 public void Clear()
 {
     if (inner != null)
     {
         Inner.Clear();
     }
 }
Esempio n. 3
0
            private void Purge()
            {
                if (this.compilation is null)
                {
                    if (RefCount == 0)
                    {
                        Inner.Clear();
                    }

                    return;
                }

                lock (this.gate)
                {
                    if (this.compilation is null)
                    {
                        return;
                    }

                    if (Interlocked.Decrement(ref RefCount) > 0)
                    {
                        foreach (var tree in this.compilation.SyntaxTrees)
                        {
                            Inner.TryRemove(tree, out _);
                        }
                    }
                    else
                    {
                        Inner.Clear();
                    }

                    this.compilation = null;
                }
            }
Esempio n. 4
0
 public void Clear()
 {
     if (inner == null)
     {
         inner = this.query.ToList();
     }
     Inner.Clear();
 }
 public void Clear()
 {
     Lock.EnterWriteLock();
     try
     {
         Inner.Clear();
     }
     catch
     {
         Lock.ExitWriteLock();
     }
 }
Esempio n. 6
0
        public static void Main()
        {
            MultiHashDictionary <int, string, Inner> mdict = new MultiHashDictionary <int, string, Inner>
            {
                { 2, "to" },
                { 2, "deux" },
                { 2, "two" },
                { 20, "tyve" },
                { 20, "tyve" },
                { 20, "twenty" }
            };

            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Console.WriteLine("mdict.Count (keys) is {0}",
                              ((IDictionary <int, Inner>)mdict).Count);
            Console.WriteLine("mdict[2].Count is {0}", mdict[2].Count);
            mdict.Remove(20, "tyve");
            mdict.Remove(20, "twenty");
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Inner zwei = new Inner
            {
                "zwei"
            };

            mdict[2]  = zwei;
            mdict[-2] = zwei;
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            zwei.Add("kaksi");
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Inner empty = new Inner();

            mdict[0] = empty;
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            Console.WriteLine("mdict contains key 0: {0}", mdict.Contains(0));
            mdict.Remove(-2);
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            zwei.Remove("kaksi");
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
            zwei.Clear();
            Console.WriteLine(mdict);
            Console.WriteLine("mdict.Count is {0}", mdict.Count);
        }
Esempio n. 7
0
        public override bool Clear()
        {
            using (var @lock = new MonitorLockScope(SyncRoot, AccessTimeout))
            {
                if ([email protected])
                {
                    if (g_traceInfo.IsWarningEnabled)
                    {
                        TraceHelper.TraceWarning(g_traceInfo, "{0} - Clear timed out", Name);
                    }

                    return(false);
                }

                return(Inner.Clear());
            }
        }
 public override void Clear()
 {
     Inner.Clear();
 }
Esempio n. 9
0
 /// <inheritdoc cref="SortedSet{T}.Clear"/>
 public void Clear()
 {
     Set.Clear();
     Inner.Clear();
 }
Esempio n. 10
0
 /// <summary>
 /// Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
 /// </summary>
 /// <exception cref="T:System.NotSupportedException">The <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only. </exception>
 public virtual void Clear()
 {
     Inner.Clear();
 }
Esempio n. 11
0
 public override void Clear()
 {
     m_owner.SetDirty();
     Inner.Clear();
 }
Esempio n. 12
0
 public void Clear()
 {
     Inner.Clear();
 }
Esempio n. 13
0
 public override void Clear()
 {
     Inner.Clear();
     Inner = null;
 }
Esempio n. 14
0
 /// <summary>
 /// Очищает вывод, например, окно.
 /// Надо переопределить в потомке.
 /// </summary>
 public override AbstractOutput Clear()
 {
     Inner.Clear();
     return(this);
 }
Esempio n. 15
0
 public virtual bool Clear()
 {
     return(Inner.Clear());
 }