Exemplo n.º 1
0
 internal static extern int IpcGetTemplateList(
     [In, MarshalAs(UnmanagedType.LPStruct)] IpcConnectionInfo connectionInfo,
     [In, MarshalAs(UnmanagedType.U4)] uint dwFlags,
     [In, MarshalAs(UnmanagedType.U4)] uint lcid,
     [In, MarshalAs(UnmanagedType.LPStruct)] IpcPromptContext pContext,
     [In] IntPtr reserved,
     [Out] out IntPtr pTil);
 private static IpcConnectionInfo ConnectionInfoToIpcConnectionInfo(ConnectionInfo connectionInfo)
 {
     IpcConnectionInfo ipcConnectionInfo = null;
     if (connectionInfo != null)
     {
         ipcConnectionInfo = new IpcConnectionInfo();
         if (connectionInfo.IntranetUrl != null)
             ipcConnectionInfo.IntranetUrl = connectionInfo.IntranetUrl.OriginalString;
         if (connectionInfo.ExtranetUrl != null)
             ipcConnectionInfo.ExtranetUrl = connectionInfo.ExtranetUrl.OriginalString;
     }
     return ipcConnectionInfo;
 }
 private static ConnectionInfo IpcConnectionInfoToConnectionInfo(IpcConnectionInfo ipcConnectionInfo)
 {
     ConnectionInfo connectionInfo = null;
     if (ipcConnectionInfo == null)
     {
         connectionInfo = null;
     }
     else if (String.IsNullOrEmpty(ipcConnectionInfo.ExtranetUrl) && String.IsNullOrEmpty(ipcConnectionInfo.IntranetUrl))
     {
         connectionInfo = null;
     }
     else
     {
         Uri extranetUrl = null;
         if (!String.IsNullOrEmpty(ipcConnectionInfo.ExtranetUrl))
             extranetUrl = new Uri(ipcConnectionInfo.ExtranetUrl);
         Uri intranetUrl = null;
         if (!String.IsNullOrEmpty(ipcConnectionInfo.IntranetUrl))
             intranetUrl = new Uri(ipcConnectionInfo.IntranetUrl);
         connectionInfo = new ConnectionInfo(extranetUrl, intranetUrl);
     }
     return connectionInfo;
 }