Beispiel #1
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 #2
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);
        }