コード例 #1
0
        private static DSXmlHelper CallService(string serviceName, DSXmlHelper request)
        {
            string Server;

            //if (Diagnostic.DebugMode && Diagnostic.Options.UseInsideGlobalConfigurationServer)
            //    Server = Diagnostic.Options.InsideGlobalConfigurationServer;
            //else
            Server = "quality";

            if (Connection == null)
            {
                try
                {
                    Connection = new DSConnection(Server, "anonymous", "");
                }
                catch (Exception)
                {
                    //ExceptionReport report = new ExceptionReport();
                    //report.AddType(typeof(HttpWebResponse), true);
                    //report.AddType(typeof(HttpWebRequest), true);

                    Console.WriteLine("嘗試連線到組態儲存主機失敗({0})。", Server);
                    //Console.WriteLine(report.Transform(ex));

                    throw;
                }
            }

            return(Connection.SendRequest(serviceName, request));
        }
コード例 #2
0
        private static DSXmlHelper CallService(string serviceName, DSXmlHelper request)
        {
            string Server;

            //if (Diagnostic.DebugMode && Diagnostic.Options.UseInsideGlobalConfigurationServer)
            //    Server = Diagnostic.Options.InsideGlobalConfigurationServer;
            //else
                Server = "quality";

            if (Connection == null)
            {
                try
                {
                    Connection = new DSConnection(Server, "anonymous", "");
                    Connection.Connect();
                }
                catch (Exception ex)
                {
                    ExceptionReport report = new ExceptionReport();
                    report.AddType(typeof(HttpWebResponse), true);
                    report.AddType(typeof(HttpWebRequest), true);

                    Console.WriteLine("嘗試連線到組態儲存主機失敗({0})。", Server);
                    Console.WriteLine(report.Transform(ex));

                    throw;
                }
            }

            return Connection.SendRequest(serviceName, request);
        }
コード例 #3
0
        public void createConnection()
        {
            DSConnection newConnection = new DSConnection(selectedInPoint, selectedOutPoint, this);
            DSConnection oldConnection = _connections.Find(x => x.outPoint == newConnection.outPoint);

            if (oldConnection != null)
            {
                _connections.Remove(oldConnection);
            }
            _connections.Add(newConnection);
        }
コード例 #4
0
ファイル: Service.cs プロジェクト: ischoolgg/iCampusManager
        private DSA()
        {
            try
            {
                Connection conn = new Connection();
                conn.EnableSession = false;
                conn.Connect(PRODUCTION_ACCESSPOINT, "", "anonymous", "");

                _conn = new DSConnection(conn);
            }
            catch (Exception)
            {
                //CurrentUser.ReportError(ex);
                MsgBox.Show("使用者回饋機制發生連線錯誤。");
            }
        }
コード例 #5
0
        public void simulate()
        {
            DSNode currentNode = _nodes.Find(x => x.title.Equals("Start"));

            while (currentNode != null)
            {
                currentNode.execute();
                DSConnection next = null;
                if (currentNode.isSelectionNode)
                {
                    DSSelectionNode currentSelectionNode = (DSSelectionNode)currentNode;
                    if (currentSelectionNode.result && currentSelectionNode.trueOutPoint != null)
                    {
                        next = _connections.Find(x => x.outPoint == currentSelectionNode.trueOutPoint);
                    }
                    else if (!currentSelectionNode.result && currentSelectionNode.falseOutPoint != null)
                    {
                        next = _connections.Find(x => x.outPoint == currentSelectionNode.falseOutPoint);
                    }
                    else
                    {
                        break;
                    }
                }
                else
                {
                    if (currentNode.outPoint == null)
                    {
                        break;
                    }
                    next = _connections.Find(x => x.outPoint == currentNode.outPoint);
                }
                if (next == null)
                {
                    break;
                }
                currentNode = _nodes.Find(x => x.id == next.inPoint.nodeID);
            }
        }
コード例 #6
0
 public ConfigProvider_Global()
 {
     Connection = null;
 }
コード例 #7
0
 public void removeConnection(DSConnection connection)
 {
     _connections.Remove(connection);
 }
コード例 #8
0
 public ConfigProvider_Global()
 {
     Connection = null;
 }