예제 #1
0
파일: TclIO.cs 프로젝트: BclEx/GpuStructs
        internal static void registerChannel(Interp interp, Channel chan)
        {

            if (interp != null)
            {
                Hashtable chanTable = getInterpChanTable(interp);
                SupportClass.PutElement(chanTable, chan.ChanName, chan);
                chan.refCount++;
            }
        }
예제 #2
0
파일: TclIO.cs 프로젝트: BclEx/GpuStructs
        internal static void unregisterChannel(Interp interp, Channel chan)
        {

            Hashtable chanTable = getInterpChanTable(interp);
            SupportClass.HashtableRemove(chanTable, chan.ChanName);

            if (--chan.refCount <= 0)
            {
                try
                {
                    chan.Close();
                }
                catch (IOException e)
                {
                    throw new TclRuntimeError("TclIO.unregisterChannel() Error: IOException when closing " + chan.ChanName + ": " + e.Message, e);
                }
            }
        }
예제 #3
0
파일: Program.cs 프로젝트: BclEx/GpuStructs
 private void put(Channel channel, string s)
 // The String to print.
 {
   try
   {
     channel.Write(interp, s);
     channel.Flush(interp);
   }
   catch (System.IO.IOException ex)
   {
     System.Console.Error.WriteLine("IOException in Shell.put()");
     SupportClass.WriteStackTrace(ex, System.Console.Error);
   }
   catch (TclException ex)
   {
     System.Console.Error.WriteLine("TclException in Shell.put()");
     SupportClass.WriteStackTrace(ex, System.Console.Error);
   }
 }
예제 #4
0
파일: Program.cs 프로젝트: BclEx/GpuStructs
    internal ConsoleThread(Interp i)
    {
      Name = "ConsoleThread";
      interp = i;
      sbuf = new System.Text.StringBuilder(100);

      out_Renamed = TclIO.GetStdChannel(StdChannel.STDOUT);
      err = TclIO.GetStdChannel(StdChannel.STDERR);
    }