private void ParseKeyinString(string sKeyin, MicroStationMessage msm)
        {
            string[] split = sKeyin.Split(new Char[] { ';' });

            foreach (string s in split)
            {
                if (s.Trim() != "")
                {
                    msm.AddKeyin(s);
                }
            }
        }
        /// <summary>
        /// this will load the mdl application and login to PW (Optional)
        /// then queue the command to execute on the "current" file.
        /// </summary>
        /// <param name="asContext"></param>
        /// <returns></returns>
        private MicroStationMessage GenerateMicroStationInstructions(ASContext asContext)
        {
            MicroStationMessage msm = new MicroStationMessage();

            msm.AddKeyin("rd=" + asContext.WorkingDocumentInfo.FilePath);

            // Retrieving custom data on a job definition as an XmlElement.
            XmlNode xmlNode = (XmlNode)asContext.JobDefinition.GetCustomData(DocumentProcessorGuid);

            if (xmlNode != null)
            {
                ConfigData myDocProcConfigData = new ConfigData((XmlElement)xmlNode);

                // by convention use this as then name of your mdl application
                if (0 < myDocProcConfigData.MDLAppName.Length)
                {
                    string sMDLPath;/* = PwApiWrapper.Util.GetProjectWisePath();
                                     * sMDLPath += @"bin\";*/
                    sMDLPath = myDocProcConfigData.MDLAppName;

                    string loadKeyin = "mdl silentload \"" + sMDLPath + "\"";

                    msm.AddKeyin(loadKeyin);
                }

                // by convention use this to log in to PW from MS
                if (0 < myDocProcConfigData.PWLoginCMD.Length)
                {
                    if (null != myDocProcConfigData.PWUser &&
                        null != myDocProcConfigData.PWPassword)
                    {
                        string sLoginCmd = myDocProcConfigData.PWLoginCMD + " " +
                                           asContext.JobDefinition.ProjectWiseDataSource + " " +
                                           myDocProcConfigData.PWUser + " " +
                                           myDocProcConfigData.PWPassword + " " +
                                           asContext.WorkingDocumentInfo.VaultID.ToString() + " " +
                                           asContext.WorkingDocumentInfo.DocumentID.ToString();

                        msm.AddKeyin(sLoginCmd);
                    }
                    else
                    {
                        if (0 < myDocProcConfigData.MSKeyin4.Length)
                        {
                            ParseKeyinString(myDocProcConfigData.MSKeyin4 + " " +
                                             asContext.WorkingDocumentInfo.VaultID.ToString() + " " +
                                             asContext.WorkingDocumentInfo.DocumentID.ToString()
                                             , msm);
                        }
                    }
                }

                if (0 < myDocProcConfigData.AppKeyin.Length)
                {
                    ParseKeyinString(myDocProcConfigData.AppKeyin + " " +
                                     asContext.WorkingDocumentInfo.VaultID.ToString() + " " +
                                     asContext.WorkingDocumentInfo.DocumentID.ToString(), msm);
                }



                if (0 < myDocProcConfigData.MSKeyin5.Length)
                {
                    ParseKeyinString(myDocProcConfigData.MSKeyin5, msm);
                }
                //turn off the save design feature
                //msm.AddKeyin("SAVE DESIGN");
            }

            return(msm);
        }