/// <summary>
        /// The upload.
        /// </summary>
        /// <param name="sourceFileName">
        /// The source file name.
        /// </param>
        /// <param name="targetFileName">
        /// The target file name.
        /// </param>
        /// <param name="itemId">
        /// The item id.
        /// </param>
        /// <param name="options">
        /// The options.
        /// </param>
        /// <param name="uploadCompleted">
        /// The upload completed.
        /// </param>
        public static void Upload(
            string sourceFileName,
            string targetFileName,
            string itemId,
            string options,
            SubroutineCallCompleted uploadCompleted)
        {
            // SUBROUTINE TU.UPLOAD(DOS.FILE.NAME, F.RXFILE, ITEMID, OPTIONS, DESCRIPTION, STATUS.REC)
            // MESSAGE = DOS.FILE.NAME : @AM : @AM : FILE.NAME : @AM : ITEMID
            // FT.OPTIONS = OPTIONS : "O"
            // DATA = ""
            // CALL SB.FT.MASTER(3, MESSAGE, DATA, FT.OPTIONS, STATUS.REC)
            if (!File.Exists(sourceFileName))
            {
                return;
            }
            var message = new SBString();
            message.SBInsert(1, sourceFileName);
            message.SBInsert(3, targetFileName);
            message.SBInsert(4, itemId);

            SbProcessHandler.CallSubroutine(
                uploadCompleted,
                "SB.FT.MASTER",
                new[] { new SBString("3"), message, new SBString(), new SBString(options + "O"), new SBString() },
                new object[] { sourceFileName, targetFileName, itemId, options });

            /*
            SbProcessHandler.CallSubroutine(
                "SB.FT.MASTER",
                5,
                new[] { new SBString("3"), message, new SBString(), new SBString(options + "O"), new SBString() },
                new object[] { sourceFileName, targetFileName, itemId, options },
                uploadCompleted);
            */
        }
Beispiel #2
0
        /// <summary>
        /// Writes the specified file name.
        /// </summary>
        /// <param name="fileName">
        /// Name of the file.
        /// </param>
        /// <param name="id">
        /// The identifier.
        /// </param>
        /// <param name="attribute">
        /// The attribute.
        /// </param>
        /// <param name="mode">
        /// The mode.
        /// </param>
        /// <param name="record">
        /// The record.
        /// </param>
        /// <param name="subroutineCallCompleted">
        /// The subroutine call completed.
        /// </param>
        public static void Write(
            string fileName,
            string id,
            string attribute,
            string mode,
            SBString record,
            SubroutineCallCompleted subroutineCallCompleted)
        {
            /*
            FILE.NAME = PARAM1<1>
            ID = PARAM1<2>
            ATTR = PARAM1<3>
            MODE = PARAM1<4>
            REC = PARAM2
             *
             * SUBROUTINE XUI.DEBUG(MODE, PARAM1, PARAM2, PARAM3, STATUS, STATUSDESC)
             */
            var param1 = new SBString();
            param1.SBInsert(1, fileName);
            param1.SBInsert(2, id);
            param1.SBInsert(3, attribute);
            param1.SBInsert(4, mode);

            if (Thread.CurrentThread.ManagedThreadId != Application.Current.Dispatcher.Thread.ManagedThreadId)
            {
                JobManager.RunInUIThread(DispatcherPriority.Input, () => XuiDebug.WriteRecord(subroutineCallCompleted, param1, record));
            }
            else
            {
                XuiDebug.WriteRecord(subroutineCallCompleted, param1, record);
            }
        }