Пример #1
0
 void OnReceivedJob(string fileName, PrintJobProperties properties)
 {
     if (ReceivedJob != null){
         lock(ReceivedJob){
             PclPrintingArgs args = new PclPrintingArgs(fileName, properties);
             ReceivedJob(this,args);
         }
     }
 }
Пример #2
0
 void OnReceivedJob(string fileName, PrintJobProperties properties)
 {
     if (ReceivedJob != null)
     {
         lock (ReceivedJob){
             PclPrintingArgs args = new PclPrintingArgs(fileName, properties);
             ReceivedJob(this, args);
         }
     }
 }
        void ReceivedJob(object sender, PclPrintingArgs e)
        {
            logger.Invoke(e.FileName);
            var p = new Process();
            var si = p.StartInfo;
            si.FileName = execute;
            si.UseShellExecute = false;
            si.CreateNoWindow = true;
            si.Arguments = string.Format("{0} {1} {2}", e.FileName, e.Properties.ColorMode, e.Properties.PlexMode);

            logger.Invoke(si.FileName);
            logger.Invoke(si.Arguments);

            p.Start();
            p.WaitForExit();

            if (p.ExitCode != 0)
                throw new Exception(string.Format("returned with abnormal return code {0}", p.ExitCode));
        }