protected override UnitloadList UnitloadListSelection(UnitloadList unitloads) { UnitloadList unitloadsinQueue = new UnitloadList(); UnitloadList consideredunitloads = new UnitloadList(); foreach (Unitload unit in unitloads) { if (unit.IsCompleted == false) { OperationList consideredOperations = new OperationList(); foreach (JobRoute currentRoute in unit.Alternates) { Operation operation = currentRoute.Operations[unit.Completed.Count]; if (consideredOperations.Contains(operation) == false && consideredunitloads.Contains(unit) == false) { //operation can be done in identical processors if (operation.Processor == null) { foreach (Processor processor in unit.Station.Processors) { if ((processor.IsAvailable == true) && (processor.Operations.Contains(operation))) { unitloadsinQueue.Add(unit); consideredOperations.Add(operation); consideredunitloads.Add(unit); break; } } } else //if the processor of the operation is determined from beginning (not identical) { if (operation.Processor.IsAvailable == true) { unitloadsinQueue.Add(unit); consideredOperations.Add(operation); consideredunitloads.Add(unit); break; } } } if (consideredunitloads.Contains(unit)) { break; } } } } return(unitloadsinQueue); }
/// <exception cref="ArgumentException"> /// <paramref name="operation"/> cannot be overridden. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="operation"/> is null. /// </exception> public override Operation Override(Operation operation) { if (operation == null) { throw new ArgumentNullException("operation"); } if (operation.Modifier == OperationModifier.None || operation.Modifier == OperationModifier.Sealed) { throw new ArgumentException("error_cannot_override"); } if (operation.Language != Language.CSharp) { throw new ArgumentException("error_languages_do_not_equal"); } Operation newOperation = (Operation)operation.Clone(); newOperation.Parent = this; newOperation.Modifier = OperationModifier.Override; OperationList.Add(newOperation); return(newOperation); }
internal ITransaction Map() { IOperationList operations = new OperationList(); foreach (var item in Operations) { var rel = new LinkRelation(item.Rel); operations.Add(new HttpOperation(item.Href, rel, item.Method, item.ContentType)); } var type = string.IsNullOrEmpty(Type)? TransactionType.Unknown : Type.ParseTo <TransactionType>(); var state = string.IsNullOrEmpty(State) ? "Unknown" : State; var id = new Uri(Id, UriKind.RelativeOrAbsolute); var problem = Problem?.Map(); var transaction = new Transaction(id, Created, Updated, type, state, Number, Amount, VatAmount, Description, PayeeReference, IsOperational, operations, Activity) { Problem = problem }; return(transaction); }
public Method AddDestructor() { Destructor destructor = new Destructor(this); OperationList.Add(destructor); return(destructor); }
public VerifyTransaction(VerifyTransactionDto dto) : base(dto.Id) { Amount = dto.Amount; VatAmount = dto.VatAmount; FailedReason = dto.FailedReason; FailedActivityName = dto.FailedActivityName; FailedErrorCode = dto.FailedErrorCode; FailedErrorDescription = dto.FailedErrorDescription; Activities = dto.Activities; Created = dto.Created; Updated = dto.Updated; Activity = dto.Activity; Description = dto.Description; IsOperational = dto.IsOperational; Number = dto.Number; PayeeReference = dto.PayeeReference; State = dto.State; Type = string.IsNullOrEmpty(dto.Type) ? TransactionType.Unknown : dto.Type.ParseTo <TransactionType>(); Problem = dto.Problem?.Map(); IOperationList operations = new OperationList(); foreach (var item in dto.Operations) { var rel = new LinkRelation(item.Rel); operations.Add(new HttpOperation(item.Href, rel, item.Method, item.ContentType)); } Operations = operations; }
/// <exception cref="BadSyntaxException"> /// The <paramref name="name"/> does not fit to the syntax. /// </exception> public Property AddProperty(string name) { Property property = new Property(name, this); property.AccessModifier = AccessModifier.Public; OperationList.Add(property); return(property); }
public void AddDelete() { var operation = new HydraOperation { Method = HttpMethod.DELETE }; OperationList.Add(operation); }
public void AddEmptyPut() { var operation = new HydraOperation { Method = HttpMethod.PUT }; OperationList.Add(operation); }
public override Method AddConstructor() { Constructor constructor = new CSharpConstructor(this); constructor.AccessModifier = AccessModifier.Public; OperationList.Add(constructor); return(constructor); }
/// <exception cref="BadSyntaxException"> /// The <paramref name="name"/> does not fit to the syntax. /// </exception> public override Method AddMethod(string name) { Method method = new CSharpMethod(name, this); method.AccessModifier = AccessModifier.Public; OperationList.Add(method); return(method); }
/// <exception cref="BadSyntaxException"> /// The <paramref name="name"/> does not fit to the syntax. /// </exception> public Event AddEvent(string name) { Event newEvent = new Event(name, this); newEvent.AccessModifier = AccessModifier.Public; OperationList.Add(newEvent); return(newEvent); }
public void AddGet() { var operation = new HydraOperation { Method = HttpMethod.GET }; OperationList.Add(operation); }
protected void AddOperation(Operation operation) { if (operation != null && !OperationList.Contains(operation)) { OperationList.Add(operation); operation.Changed += delegate { Modified(); }; Modified(); } }
public void AddGet(IEnumerable <SupportingProperty> properties) { var operation = new HydraOperation { Method = HttpMethod.GET }; properties.ToList().ForEach(operation.AddPropery); OperationList.Add(operation); }
public ForaturaCommonOperazioniViewModel(DrillBaseClass drillBaseClass, EditWorkViewModel parent) : base("Operation", parent) { _drillBaseClass = drillBaseClass; foreach (var operazione in _drillBaseClass.Operazioni) { OperationList.Add(GetViewModel(operazione, drillBaseClass, parent)); } }
protected void AddOperation(Operation operation) { if (operation != null && !OperationList.Contains(operation)) { OnBeginUndoableOperation(); OperationList.Add(operation); operation.BeginUndoableOperation += delegate { OnBeginUndoableOperation(); }; operation.Modified += delegate { Changed(); }; Changed(); } }
public IOperationList Map() { var list = new OperationList(); foreach (var item in this) { var rel = new LinkRelation(item.Rel); list.Add(new HttpOperation(item.Href, rel, item.Method, item.ContentType)); } return(list); }
public override ProcessorOperationCouple Select(Unitload unit) { ProcessorOperationCouple decision = new ProcessorOperationCouple(); Operation selectedOperation = null; Processor selectedProcessor = null; double shortesttime = double.PositiveInfinity; OperationList consideredOperations = new OperationList(); foreach (JobRoute currentRoute in unit.Alternates) { Operation operation = currentRoute.Operations[unit.Completed.Count]; if (consideredOperations.Contains(operation) == false) { if (operation.Processor == null) { if (unit.Station.BinMagazine.CheckComponent(operation.ComponentUsages)) { foreach (Processor processor in unit.Station.Processors) { if ((processor.IsAvailable == true) && (processor.Operations.Contains(operation))) { if (shortesttime > operation.GetExpectedProcessTime(unit.Station)) { selectedOperation = operation; selectedProcessor = processor; shortesttime = operation.GetExpectedProcessTime(unit.Station); } break; } } } } else //operation's processor not null but have a unique processor { if (operation.Processor.IsAvailable == true) { if (unit.Station.BinMagazine.CheckComponent(operation.ComponentUsages)) { if (shortesttime > operation.GetExpectedProcessTime(unit.Station)) { selectedOperation = operation; selectedProcessor = operation.Processor; shortesttime = operation.GetExpectedProcessTime(unit.Station); //fonksiyon boş, nasıl stationa bağlı process time yazılabilir? } } } } consideredOperations.Add(operation); } } decision.Operation = selectedOperation; decision.Processor = selectedProcessor; return(decision); }
public override Method AddConstructor() { Constructor constructor = new CSharpConstructor(this); if (Modifier == InheritanceModifier.Abstract) { constructor.AccessModifier = AccessModifier.Protected; } else if (Modifier != InheritanceModifier.Static) { constructor.AccessModifier = AccessModifier.Public; } OperationList.Add(constructor); return(constructor); }
/*************************************************************************/ public IDisposable StartOperation(string operationName) { var ops = new OperationList(); foreach (var logger in _logs) { var op = logger.Log.StartOperation(operationName); if (op != null) { ops.Add(op); } } return(ops); }
public void Sync(IMp3File file, Mask mask, ISyncRule rule) { var errorFlag = true; _tager.CurrentFile = file; foreach (var operation in rule.OperationsList) { if (operation.Call(mask, _tager, file)) { OperationList.Add(operation); ModifiedFiles.Add(_tager.CurrentFile); errorFlag = false; break; } } if (errorFlag) { ErrorFiles.Add(_tager.CurrentFile.Name, "Can't sync this file"); } }
/// <exception cref="ArgumentException"> /// The language of <paramref name="operation"/> does not equal. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="operation"/> is null. /// </exception> public Operation Implement(Operation operation) { if (operation == null) { throw new ArgumentNullException("operation"); } if (operation.Language != Language) { throw new ArgumentException("error_languages_do_not_equal"); } Operation newOperation = (Operation)operation.Clone(); newOperation.Parent = this; newOperation.AccessModifier = AccessModifier.Public; newOperation.Modifier = OperationModifier.None; newOperation.IsStatic = false; OperationList.Add(newOperation); return(newOperation); }