Example #1
0
        public static SasServer FromXml(string xml)
        {
            SasServer s = new SasServer();

            try
            {
                XElement settings = XElement.Parse(xml);
                if (settings.Attribute("name") != null)
                {
                    s.Name = settings.Attribute("name").Value;
                }
                if (settings.Attribute("host") != null)
                {
                    s.Host = settings.Attribute("host").Value;
                }
                if (settings.Attribute("port") != null)
                {
                    s.Port = settings.Attribute("port").Value;
                }
                if (settings.Attribute("userid") != null)
                {
                    s.UserId = settings.Attribute("userid").Value;
                }
                if (settings.Attribute("useLocal") != null)
                {
                    s.UseLocal = XmlConvert.ToBoolean(settings.Attribute("useLocal").Value);
                }
            }
            catch (System.Exception)
            {
                // no need to bomb if this goes poorly because of bad XML
            }

            return(s);
        }
Example #2
0
        private static string ConnectToSAS()
        {
            string statusMsg = "";

            activeSession = new SasServer();

            try
            {
                activeSession.Connect();

                if (activeSession.UseLocal)
                {
                    statusMsg = "Connected to local SAS session";
                }
            }
            catch (Exception ex)
            {
                statusMsg = string.Format("Connection failure {0}", ex.Message);
            }

            return(statusMsg);
        }
Example #3
0
 public SASService()
 {
     _sasServer = new SasServer();
 }