當前位置: 首頁>>代碼示例>>C#>>正文


C# Core.PhpResource類代碼示例

本文整理匯總了C#中PHP.Core.PhpResource的典型用法代碼示例。如果您正苦於以下問題:C# PhpResource類的具體用法?C# PhpResource怎麽用?C# PhpResource使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PhpResource類屬於PHP.Core命名空間,在下文中一共展示了PhpResource類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: RegisterResource

        /// <summary>
        /// Registers a resource that should be disposed of when the request is over.
        /// </summary>
        /// <param name="res">The resource.</param>
        internal static LinkedListNode<WeakReference> RegisterResource(PhpResource/*!*/res)
        {
            Debug.Assert(res != null);
            //Debug.Assert(this method can only be called on the request thread)

            return StaticInfo.Get.Resources.AddFirst(new WeakReference(res));
        }
開發者ID:kendallb,項目名稱:Phalanger,代碼行數:11,代碼來源:PhpResourceManager.cs

示例2: ValidResult

		internal static PhpSqlDbResult ValidResult(PhpResource handle)
		{
			PhpSqlDbResult result = handle as PhpSqlDbResult;
			if (result != null && result.IsValid) return result;

			PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_result_resource"));
			return null;
		}
開發者ID:hansdude,項目名稱:Phalanger,代碼行數:8,代碼來源:PhpSqlDbResult.cs

示例3: ValidConnection

		/// <summary>
		/// Validates whether the specified handler is instance of PhpDbConnection type.
		/// </summary>
		/// <param name="handle"></param>
		/// <returns></returns>
		internal static PhpSqlDbConnection ValidConnection(PhpResource handle)
		{
			PhpSqlDbConnection connection = handle as PhpSqlDbConnection;
			if (connection != null && connection.IsValid) return connection;

			PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_connection_resource"));
			return null;
		}
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:13,代碼來源:PhpSqlDbConnection.cs

示例4: ValidProcedure

		internal static PhpSqlDbProcedure ValidProcedure(PhpResource handle)
		{
			PhpSqlDbProcedure result = handle as PhpSqlDbProcedure;
			if (result != null && result.IsValid) return result;

			PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_stored_procedure_resource"));
			return null;
		}
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:8,代碼來源:PhpSqlDbProcedure.cs

示例5: Close

 public static void Close(PhpResource linkIdentifier)
 {
     PhpSQLiteDbConnection connection = PhpSQLiteDbConnection.ValidConnection(linkIdentifier);
     if (connection != null)
     {
         connection.Close();
     }
 }
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:8,代碼來源:SQLite.cs

示例6: RegisterResource

		/// <summary>
		/// Registers a resource that should be disposed of when the request is over.
		/// </summary>
		/// <param name="res">The resource.</param>
		internal LinkedListNode<PhpResource> RegisterResource(PhpResource/*!*/res)
		{
            Debug.Assert(res != null);

            if (resources == null)
                resources = new LinkedList<PhpResource>();

            return resources.AddFirst(res);
		}
開發者ID:jdluzen,項目名稱:Phalanger,代碼行數:13,代碼來源:RequestContext.cs

示例7: Close

        public static void Close(PhpResource ch)
        {
            PhpCurlResource curlHandle = ch as PhpCurlResource;

            if (curlHandle == null)
                return;

            curlHandle.Close();
        }
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:9,代碼來源:Curl.cs

示例8: RegisterResource

        /// <summary>
        /// Registers a resource that should be disposed of when the request is over.
        /// </summary>
        /// <param name="res">The resource.</param>
        internal static LinkedListNode<PhpResource> RegisterResource(PhpResource/*!*/res)
        {
            Debug.Assert(res != null);
            //Debug.Assert(this method can only be called on the request thread)

            if (resources == null)
                resources = new LinkedList<PhpResource>();

            return resources.AddFirst(res);
        }
開發者ID:kripper,項目名稱:Phalanger,代碼行數:14,代碼來源:PhpResourceManager.cs

示例9: Validate

		internal static PhpProcessHandle Validate(PhpResource resource)
		{
			PhpProcessHandle result = resource as PhpProcessHandle;

			if (result == null || !result.IsValid)
			{
				PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_process_resource"));
				return null;
			}

			return result;
		}
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:12,代碼來源:Process.CLR.cs

示例10: Errno

        public static object Errno(PhpResource ch)
        {
            //PhpException.FunctionNotSupported(PhpError.Warning);

            PhpCurlResource curlHandle = ch as PhpCurlResource;

            if (curlHandle == null)
                return null;

            return (int)curlHandle.ErrorCode;

        }
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:12,代碼來源:Curl.cs

示例11: ValidConnection

        internal static PhpSQLiteDbConnection ValidConnection(PhpResource handle)
        {
            PhpSQLiteDbConnection connection;

            if (handle != null && handle.GetType() == typeof(PhpSQLiteDbConnection))
                connection = (PhpSQLiteDbConnection)handle;
            else
                connection = null;

            if (connection != null && connection.IsValid)
                return connection;

            PhpException.Throw(PhpError.Warning, LibResources.GetString("invalid_connection_resource"));
            return null;
        }
開發者ID:Ashod,項目名稱:Phalanger,代碼行數:15,代碼來源:PhpSQLiteDbConnection.cs

示例12: Accept

		public static bool Accept(PhpResource serverSocket)
		{
			string peerName;
			return Accept(serverSocket, Configuration.Local.FileSystem.DefaultSocketTimeout, out peerName);
		}
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:5,代碼來源:Streams.Sockets.CLR.cs

示例13: ConnectServer

		public static PhpResource ConnectServer(string localSocket, out int errno, out string errstr,
		  double timeout, SocketOptions flags, PhpResource context)
		{
			StreamContext sc = StreamContext.GetValid(context);
			if (sc == null)
			{
				errno = -1;
				errstr = null;
				return null;
			}

			int port;
			SplitSocketAddressPort(ref localSocket, out port);
			return Connect(localSocket, port, out errno, out errstr, timeout, flags, sc);
		}
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:15,代碼來源:Streams.Sockets.CLR.cs

示例14: SetStreamContexts

 public static void SetStreamContexts(PhpResource streams_context)
 {
 }
開發者ID:tiaohai,項目名稱:Phalanger,代碼行數:3,代碼來源:LibXml.cs

示例15: SetBlocking

		public static bool SetBlocking(PhpResource stream, int mode)
		{
			return PhpStreams.SetBlocking(stream, mode);
		}
開發者ID:dw4dev,項目名稱:Phalanger,代碼行數:4,代碼來源:Network.CLR.cs


注:本文中的PHP.Core.PhpResource類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。