Beispiel #1
0
        /// <summary>
        /// Brings the MLifter to front.
        /// </summary>
        /// <remarks>Documented by Dev05, 2007-11-28</remarks>
        public static void BringMLifterToFront()
        {
            RemotingConfiguration.RegisterWellKnownClientType(typeof(GlobalDictionaryLoader), ClientURL);
            GlobalDictionaryLoader loader = new GlobalDictionaryLoader();

            loader.BringToFront();
        }
Beispiel #2
0
        /// <summary>
        /// Sends the path to the IPC-Server.
        /// </summary>
        /// <param name="Path">The path.</param>
        /// <remarks>Documented by Dev05, 2007-11-28</remarks>
        public static void SendPathToIPC(string Path)
        {
            RemotingConfiguration.RegisterWellKnownClientType(typeof(GlobalDictionaryLoader), ClientURL);
            GlobalDictionaryLoader loader = new GlobalDictionaryLoader();

            loader.LoadDictionary(Path);
        }
Beispiel #3
0
 /// <summary>
 /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
 /// </summary>
 /// <remarks>Documented by Dev02, 2009-06-29</remarks>
 public void Dispose()
 {
     if (loader != null)
     {
         loader = null;
     }
 }
Beispiel #4
0
        /// <summary>
        /// Connects this instance.
        /// </summary>
        /// <remarks>Documented by Dev02, 2009-06-26</remarks>
        /// <exception cref="MLCouldNotBeStartedException">Occurs when MemoryLifter did not start or did not react to connection attempts.</exception>
        /// <exception cref="MLNotReadyException">Occurs when MemoryLifter is not ready for being remote controlled.</exception>
        private void Connect()
        {
            Debug.WriteLine("Connecting to MemoryLifter...");
            MLifter.Program.GetIPCData(out UniqueChannelName, out UniqueChannelPortName, out ClientURL, out ServiceURL);
            loader = (GlobalDictionaryLoader)RemotingServices.Connect(typeof(GlobalDictionaryLoader), ClientURL);

            int tries;

            try
            {
                tries = 20;
                while (!loader.IsMLReady())
                {
                    Thread.Sleep(50);
                    if (tries-- < 0)
                    {
                        throw new MLNotReadyException();
                    }
                }
            }
            catch (RemotingException)
            {
                StartML();
                Thread.Sleep(200);

                try
                {
                    tries = 100;
                    while (!loader.IsMLReady())
                    {
                        Thread.Sleep(50);
                        if (tries-- < 0)
                        {
                            throw new MLNotReadyException();
                        }
                    }
                }
                catch (RemotingException)
                {
                    throw;
                }
            }

            return;
        }