예제 #1
0
            public int Spawn(Byte[] filename, mgnat.adalib.standard.ada_string[] Args, bool insertInList)
            {
                string theArgs = to_string(Args);

                this.StartInfo.FileName  = to_string(filename);
                this.StartInfo.Arguments = theArgs;

                try {
                    if (this.Start())
                    {
#if !COMPACT
                        if (insertInList)
                        {
                            if (Processes == null)
                            {
                                Processes = new ProcessDictionary();
                            }
                            Processes.Add(this.Id, this);
                        }

                        this.BeginOutputReadLine();
                        this.BeginErrorReadLine();
#endif

                        return(this.Id);
                    }
                    else
                    {
                        return(-1);
                    }
                } catch {
                    return(-1);
                }
            }
        public IGenericProcess GetGenericProcess(ProcessType processType)
        {
            IGenericProcess genericProcess = null;

            switch (processType)
            {
            case ProcessType.Buffer:
                genericProcess = new ProcessBuffer();
                break;

            case ProcessType.CircularBuffer:
                genericProcess = new ProcessCircularBuffer();
                break;

            case ProcessType.Array:
                genericProcess = new ProcessArray();
                break;

            case ProcessType.List:
                genericProcess = new ProcessList();
                break;

            case ProcessType.Queue:
                genericProcess = new ProcessQueue();
                break;

            case ProcessType.Stack:
                genericProcess = new ProcessStack();
                break;

            case ProcessType.HashSet:
                genericProcess = new ProcessHashSet();
                break;

            case ProcessType.LinkedList:
                genericProcess = new ProcessLinkedList();
                break;

            case ProcessType.Dictionary:
                genericProcess = new ProcessDictionary();
                break;

            case ProcessType.Sort:
                genericProcess = new ProcessSort();
                break;

            case ProcessType.ComparingEmployees:
                genericProcess = new ProcessComparingEmployees();
                break;

            case ProcessType.Delegates:
                genericProcess = new ProcessDelegates();
                break;

            case ProcessType.Constraints:
                genericProcess = new ProcessConstraints();
                break;

            case ProcessType.GenericMethods:
                genericProcess = new ProcessGenericMethods();
                break;

            case ProcessType.IocContainer:
                genericProcess = new ProcessIocContainer();
                break;

            case ProcessType.GenericEnum:
                genericProcess = new ProcessGenericEnum();
                break;

            case ProcessType.BaseTypes:
                genericProcess = new ProcessBaseTypes();
                break;

            case ProcessType.GenericStatics:
                genericProcess = new ProcessGenericStatics();
                break;

            default:
                break;
            }
            return(genericProcess);
        }