Exemplo n.º 1
0
        ///////////////////////////////////////////////////////////////////////

        public bool ClearMarks()
        {
            CheckDisposed();

            if ((tags != null) && (tags.Count > 0))
            {
                tags.Clear();

                //
                // NOTE: Yes, we cleared some tags.
                //
                return(true);
            }

            //
            // NOTE: For whatever reason, we did not clear the tags.
            //
            return(false);
        }
Exemplo n.º 2
0
 public static void Close()
 {
     if (_monitor != null)
     {
         _monitor.Abort();
         _monitor = null;
     }
     if (_refresher != null)
     {
         _refresher.Abort();
         _refresher = null;
     }
     if (ObjectList != null)
     {
         ObjectList.Clear();
         ObjectList = null;
     }
     if (ObjectDictionary != null)
     {
         ObjectDictionary.Clear();
         ObjectDictionary = null;
     }
 }
Exemplo n.º 3
0
 /// <summary>
 ///   Monitors this instance.
 /// </summary>
 private static void Monitor()
 {
     while (!Closing)
     {
         if (InGame && _processPid != -1)
         {
             Thread.Sleep(500);
             continue;
         }
         if (!DoesProcessExsist(_processPid) && !_alearted)
         {
             InterfaceHelper.StopUpdate();
             Logging.Write(LogType.Info, "No wow process, cannot attach");
             ObjectList.Clear();
             ObjectDictionary.Clear();
             if (NoAttach != null)
             {
                 NoAttach(new object(), new NotifyEventNoAttach("Not attached"));
             }
             _alearted = true;
         }
         Initialized = false;
         if (_refresher != null)
         {
             if (_refresher.IsAlive)
             {
                 _refresher.Abort();
                 _refresher = null;
             }
         }
         if (DoesProcessExsist(_processPid))
         {
             _alearted = false;
             ObjectList.Clear();
             ObjectDictionary.Clear();
             if (NoAttach != null)
             {
                 NoAttach(new object(), new NotifyEventNoAttach("Not attached"));
             }
             Logging.Write(LogType.Info, "Not ingame");
             Thread.Sleep(1500);
             while (DoesProcessExsist(_processPid) && !InGame)
             {
                 Thread.Sleep(1000);
             }
             if (InGame)
             {
                 Initialize(_processPid);
             }
             else
             {
                 _processPid = -1;
             }
         }
         else
         {
             _processPid = -1;
         }
         Thread.Sleep(2000);
     }
 }
Exemplo n.º 4
0
        ///////////////////////////////////////////////////////////////////////

        private /* protected virtual */ void Dispose(
            bool disposing
            )
        {
            if (!disposed)
            {
                if (disposing)
                {
                    ////////////////////////////////////
                    // dispose managed resources here...
                    ////////////////////////////////////

                    if (children != null)
                    {
                        foreach (INamespace child in children.Values)
                        {
                            if (child == null)
                            {
                                continue;
                            }

                            IDisposable disposable = child as IDisposable;

                            if (disposable != null)
                            {
                                disposable.Dispose();
                                disposable = null;
                            }
                        }

                        children.Clear();
                        children = null;
                    }

                    ///////////////////////////////////////////////////////////

                    if (exportNames != null)
                    {
                        exportNames.Clear();
                        exportNames = null;
                    }

                    ///////////////////////////////////////////////////////////

                    if (imports != null)
                    {
                        ReturnCode removeCode;
                        Result     removeError = null;

                        removeCode = RemoveImports(
                            null, false, ref removeError);

                        if (removeCode != ReturnCode.Ok)
                        {
                            DebugOps.Complain(
                                interpreter, removeCode, removeError);
                        }

                        imports.Clear();
                        imports = null;
                    }

                    ///////////////////////////////////////////////////////////

                    if (interpreter != null)
                    {
                        interpreter = null; /* NOT OWNED */
                    }
                    ///////////////////////////////////////////////////////////

                    parent  = null; /* NOT OWNED */
                    resolve = null; /* NOT OWNED */

                    ///////////////////////////////////////////////////////////

                    if (variableFrame != null)
                    {
                        variableFrame.Free(true);
                        variableFrame = null;
                    }

                    ///////////////////////////////////////////////////////////

                    unknown = null;

                    ///////////////////////////////////////////////////////////

                    qualifiedName  = null;
                    referenceCount = 0;
                    deleted        = false;

                    ///////////////////////////////////////////////////////////

                    kind        = IdentifierKind.None;
                    id          = Guid.Empty;
                    name        = null;
                    group       = null;
                    description = null;
                    clientData  = null;
                }

                //////////////////////////////////////
                // release unmanaged resources here...
                //////////////////////////////////////

                disposed = true;
            }
        }