/// <summary> /// CTOR - create an argument from a field /// </summary> public Argument(Field field) { _fld = field; _type = ConstInterface.ARG_TYPE_FIELD; _exp = null; _skip = false; }
/// <summary> /// CTOR that creates a "Value" type argument from a given Expression Value /// </summary> /// <param name = "expVal">the source expression value</param> protected internal Argument(GuiExpressionEvaluator.ExpVal expVal) { _type = ConstInterface.ARG_TYPE_VALUE; _fld = null; _exp = null; _skip = false; if (expVal.IsNull) { _val = null; } else { _val = expVal.ToMgVal(); if (expVal.Attr == StorageAttribute.DOTNET && (String.IsNullOrEmpty(_val) || !BlobType.isValidDotNetBlob(_val))) { _dnObjectCollectionKey = DNManager.getInstance().DNObjectsCollection.CreateEntry(null); _val = BlobType.createDotNetBlobPrefix(_dnObjectCollectionKey); if (expVal.DnMemberInfo != null) { DNManager.getInstance().DNObjectsCollection.Update(_dnObjectCollectionKey, expVal.DnMemberInfo.value); } // add this key into 'tempDNObjectsCollectionKeys', so that it can be freed later. ClientManager.Instance.getTempDNObjectCollectionKeys().Add(_dnObjectCollectionKey); } } _valueIsNull = (_val == null); _valueAttr = expVal.Attr; }
/// <summary> /// CTOR /// </summary> protected internal Argument() { _type = (char)(0); _fld = null; _exp = null; _skip = false; }
/// <summary> /// Parsing Argument string and fill inner objects /// </summary> /// <param name = "arg">string to parse </param> /// <param name = "srcTask">of the argument to find expression argument </param> protected internal void fillData(String arg, Task srcTask) { _type = arg[0]; String argElements = arg.Substring(2); switch (_type) { case ConstInterface.ARG_TYPE_FIELD: { string[] fieldId = argElements.Split(','); int parent = Int32.Parse(fieldId[0]); int fldIdx = Int32.Parse(fieldId[1]); _fld = (Field)srcTask.getField(parent, fldIdx); } break; case ConstInterface.ARG_TYPE_EXP: int expNum = Int32.Parse(argElements); _exp = srcTask.getExpById(expNum); break; case ConstInterface.ARG_TYPE_SKIP: _skip = true; break; default: Logger.Instance.WriteExceptionToLog("in Argument.FillData() illegal type: " + arg); break; } }
/// <summary> /// CTOR - creates a new run time event by copying the member variables of a given /// event and the member variables of a given run time event /// </summary> /// <param name = "evt">a reference to the event to be used </param> /// <param name = "rtEvt">a reference to the run time event to be used </param> internal RunTimeEvent(Event evt, RunTimeEvent rtEvt) : base(evt) { _taskTag = rtEvt._taskTag; _task = rtEvt._task; Control = rtEvt.Control; _eventFld = rtEvt._eventFld; _mgdId = rtEvt._mgdId; _displayLine = rtEvt._displayLine; _reversibleExit = rtEvt._reversibleExit; _argList = rtEvt._argList; _immediate = rtEvt._immediate; _mprgCreator = rtEvt._mprgCreator; _priority = rtEvt._priority; _guiTriggeredEvent = rtEvt._guiTriggeredEvent; _isIdleTimer = rtEvt._isIdleTimer; _val = rtEvt._val; _selectionStart = rtEvt._selectionStart; _selectionEnd = rtEvt._selectionEnd; _controlsList = rtEvt._controlsList; _direction = rtEvt._direction; _dotNetObject = rtEvt._dotNetObject; DotNetArgs = rtEvt.DotNetArgs; LastFocusedVal = rtEvt.LastFocusedVal; _imeParam = rtEvt._imeParam; }
/// <summary> /// CTOR /// </summary> /// <param name = "fldRef">a reference to the field</param> internal RunTimeEvent(Field fldRef) : base() { _eventFld = fldRef; init(fldRef != null ? (Task)fldRef.getTask() : null); }
/// <summary> /// This method fills the argument data from the mainProgVar strings /// </summary> /// <param name = "mainProgVar">- a vector of strings of main program variables</param> /// <param name = "mainProgTask">- the main program task</param> internal void fillDataByMainProgVars(String mainProgVar, Task mainProgTask) { if (mainProgVar.Equals("Skip")) { _skip = true; } else { int fldId = Int32.Parse(mainProgVar) - 1; _type = ConstInterface.ARG_TYPE_VALUE; _fld = (Field)mainProgTask.getField(fldId); _val = _fld.getValue(true); _valueIsNull = _fld.isNull(); _valueAttr = _fld.getType(); } }
/// <summary> /// set the value of this argument to a given field /// </summary> /// <param name = "destFld">the destination field /// </param> internal void setValueToField(Field destFld) { String val; bool isNull; switch (_type) { case ConstInterface.ARG_TYPE_FIELD: val = _fld.getValue(true); val = convertArgs(val, _fld.getType(), destFld.getType()); isNull = _fld.isNull() || val == null; break; case ConstInterface.ARG_TYPE_EXP: val = _exp.evaluate(destFld.getType(), destFld.getSize()); isNull = (val == null); if (isNull) { val = getEmptyValue((destFld.getType() == StorageAttribute.BLOB || destFld.getType() == StorageAttribute.BLOB_VECTOR)); } break; case ConstInterface.ARG_TYPE_VALUE: val = convertArgs(_val, _valueAttr, destFld.getType()); isNull = _valueIsNull || val == null; break; default: return; } // Update destination field's _isNULL with the value from record. This is needed to identify // if the variable is modified. destFld.takeValFromRec(); destFld.setValueAndStartRecompute(val, isNull, ((Task)destFld.getTask()).DataViewWasRetrieved, false, true); }