コード例 #1
0
ファイル: DataSet.cs プロジェクト: ManuelPolus/XRDC
 public void Add(T objectToAdd)
 {
     try
     {
         Set.Add(objectToAdd);
     }
     catch (Exception e)
     {
         throw ErrorLaucher.Launch(e);
     }
 }
コード例 #2
0
ファイル: DataSet.cs プロジェクト: ManuelPolus/XRDC
 public T Find(T searchedObject)
 {
     try
     {
         return(Set.FirstOrDefault <T>(t => t.Equals(searchedObject)));
     }
     catch (Exception e)
     {
         throw ErrorLaucher.Launch(new Exception("you really f****d up..."));
     }
 }
コード例 #3
0
 private new void  CloseConnection()
 {
     try
     {
         _connection.Dispose();
         _connection.Close();
     }
     catch (Exception e)
     {
         throw ErrorLaucher.Launch(e);
     }
 }
コード例 #4
0
 private new void OpenConnection()
 {
     try
     {
         _connection = new NpgsqlConnection(connectionString);
         _connection.Open();
     }
     catch (Exception e)
     {
         throw ErrorLaucher.Launch(e);
     }
 }
コード例 #5
0
ファイル: DemandAnalyzer.cs プロジェクト: ManuelPolus/XRDC
 private static Request SplitRequest(string demand)
 {
     try
     {
         Request r = new Request();
         r = JsonUtility.Deserialize <Request>(demand);
         return(r);
     }
     catch (Exception e)
     {
         throw ErrorLaucher.Launch(e);
     }
 }
コード例 #6
0
 public void SendRequest(string ip, int port)
 {
     using (_client = new TCPClient(ip, port))
     {
         if (ManagerRequest != null)
         {
             _client.SendContent(ManagerRequest.ToString());
         }
         else
         {
             throw ErrorLaucher.Launch(new EmptyRequestException("you must initialize the request before sending it"));
         }
     }
 }
コード例 #7
0
 public virtual string GetError()
 {
     throw ErrorLaucher.Launch(new ControllerMustBeSpecializedException("You must only execut request from specialized controllers instances"));
 }
コード例 #8
0
 public virtual bool ExecuteRequest(string status, string options)
 {
     throw ErrorLaucher.Launch(new ControllerMustBeSpecializedException("You must only execut request from specialized controllers instances"));
 }