Beispiel #1
0
 /// <summary>
 ///   remove DNObjectsCollection entries made by dot net parameters for the event
 /// </summary>
 internal void removeDotNetArgs()
 {
     // free the object table entry
     for (int i = 0; i < _argList.getSize(); i++)
     {
         string val = _argList.getArg(i).getValue(StorageAttribute.DOTNET, 0);
         DNManager.getInstance().DNObjectsCollection.Remove(BlobType.getKey(val));
     }
 }
Beispiel #2
0
        /// <summary>
        ///   creates only a real refresh event command
        /// </summary>
        /// <returns>newly created command.</returns>
        internal static RefreshEventCommand CreateRealRefreshCommand(String taskId, int magicEvent, int currentRow, ArgumentsList argList, int currentRecId)
        {
            RefreshEventCommand cmd = new RefreshEventCommand(magicEvent)
            {
                TaskTag          = taskId,
                RefreshMode      = ViewRefreshMode.CurrentLocation,
                KeepUserSort     = false,
                ClientRecId      = currentRecId,
                CurrentRecordRow = currentRow
            };

            if (argList != null && argList.getSize() != 0)
            {
                try
                {
                    var refreshMode = new NUM_TYPE(argList.getArgValue(0, StorageAttribute.NUMERIC, 0));
                    cmd.RefreshMode = (ViewRefreshMode)refreshMode.NUM_2_LONG() + 1;
                }
                catch (Exception)
                {
                    cmd.RefreshMode = ViewRefreshMode.CurrentLocation;
                }

                if (argList.getSize() > 1)
                {
                    try
                    {
                        cmd.KeepUserSort = (argList.getArgValue(1, StorageAttribute.BOOLEAN, 0) == "1");
                    }
                    catch (Exception)
                    {
                        cmd.KeepUserSort = false;
                    }
                }
            }

            return(cmd);
        }
Beispiel #3
0
        /// <summary>
        /// update changes in called task to fields in arguments from calling task
        /// </summary>
        /// <param name="task"></param>
        /// <param name="args"></param>
        internal override void UpdateArguments(Task task, ArgumentsList args)
        {
            FieldsTable fieldsTable = task.DataView.GetFieldsTab() as FieldsTable;

            int  numberOfArguments = (args != null) ? args.getSize() : 0;
            int  currentArgIndex   = 0; // index of currently handled argument
            bool taskHasParameters = ((DataView)task.DataView).ParametersExist();

            if (numberOfArguments > 0)
            {
                int dvPos  = ((DataView)task.DataView).GetRecordMainIdx();
                int dvSize = ((DataView)task.DataView).GetRecordMainSize();

                // Go over the fields, find the fields which had arguments set to
                for (int i = dvPos; (i < dvSize) && (currentArgIndex < numberOfArguments); i++)
                {
                    Field field = fieldsTable.getField(i) as Field;

                    if (!field.IsForArgument(taskHasParameters))
                    {
                        continue;
                    }

                    // get the argument
                    Argument arg = args.getArg(currentArgIndex);
                    currentArgIndex++;

                    // ignore skipped arguments
                    if (arg.skipArg())
                    {
                        continue;
                    }

                    // ignore arguments which are not fields
                    Field argField = arg.getField();
                    if (argField == null)
                    {
                        continue;
                    }

                    SetArgumentToField(field, argField);
                }
            }
        }
Beispiel #4
0
        ///   creates an Index Change event command
        /// </summary>
        /// <returns>newly created command.</returns>
        internal static IndexChangeEventCommand CreateIndexChangeCommand(string taskTag, int recId, ArgumentsList argList)
        {
            IndexChangeEventCommand cmd = new IndexChangeEventCommand
            {
                TaskTag     = taskTag,
                ClientRecId = recId
            };

            // 1 parameter : The new Key Index
            if (argList != null && argList.getSize() != 0)
            {
                try
                {
                    var keyIndex = new NUM_TYPE(argList.getArgValue(0, StorageAttribute.NUMERIC, 0));
                    cmd.KeyIndex = keyIndex.NUM_2_LONG();
                }
                catch (Exception)
                {
                    cmd.KeyIndex = 0;
                }
            }

            return(cmd);
        }