コード例 #1
0
ファイル: Upnp.cs プロジェクト: CaptainTF/bukkitgui2
 public static void Forward(PortMappingEntry fwi)
 {
     try
     {
         _lastInstance.Add(fwi);
     }
     catch (Exception ex)
     {
         Logger.Log(LogLevel.Warning, "PortForwarder", "Error while loading mapping: " + ex.Message);
     }
     if (PortForwardApplied != null)
     {
         PortForwardApplied();
     }
 }
コード例 #2
0
ファイル: Upnp.cs プロジェクト: CaptainTF/bukkitgui2
 /// <summary>
 ///     Adds a port mapping to the UPnP enabled device.
 /// </summary>
 /// <param name="entry">The PortMappingEntry to add</param>
 /// <exception cref="ApplicationException">This exception is thrown when UPnP is disabled.</exception>
 /// <exception cref="ObjectDisposedException">This exception is thrown when this class has been disposed.</exception>
 /// <exception cref="ArgumentException">This exception is thrown when any of the supplied arguments are invalid.</exception>
 /// <remarks></remarks>
 public void Add(PortMappingEntry entry)
 {
     Add(entry.Ip, entry.Port, entry.Protocol, entry.Name);
 }