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


C# AccessMode類代碼示例

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


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

示例1: ZpAccessException

 /// <summary>
 /// Initializes a new instance of the <see cref="ZpAccessException"/> class.
 /// </summary>
 /// <param name="aMessage">The AccessException message.</param>
 /// <param name="aUserID">The UserID of the access controlled user.</param>
 /// <param name="aAccessMode">The AccessMode.</param>
 /// <param name="aObject">The access controlled object.</param>
 public ZpAccessException(string aMessage, string aUserID, AccessMode aAccessMode, string aObject)
     : base(aMessage)
 {
     _userID = aUserID;
     _accessMode = aAccessMode;
     _object = aObject;
 }
開發者ID:heinschulie,項目名稱:z2z,代碼行數:14,代碼來源:ZpAccessException.cs

示例2: GXDLT645Property

 /// <summary>
 /// Constructor.
 /// </summary>
 public GXDLT645Property(ulong dataID, string name, DataType type, AccessMode access) : 
     base(name)
 {
     this.DataID = dataID;
     Type = type;
     this.AccessMode = access;
 }
開發者ID:giapdangle,項目名稱:Gurux.DLT645.AddIn,代碼行數:10,代碼來源:GXDLT645Property.cs

示例3: ImageMapSegment

		public ImageMapSegment(string name, uint size, AccessMode access) : base(size) 
		{
			if (name == null)
				throw new ArgumentNullException("name", "Segments must have names.");
			this.Name = name;
			this.Access = access;
		}
開發者ID:melbcat,項目名稱:reko,代碼行數:7,代碼來源:ImageMapSegment.cs

示例4: AddSegment

 public ImageSegment AddSegment(MemoryArea mem, string segmentName, AccessMode mode)
 {
     var segment = new ImageSegment(
             segmentName,
             mem,
             mode);
     AddSegment(segment);
     return segment;
 }
開發者ID:relaxar,項目名稱:reko,代碼行數:9,代碼來源:SegmentMap.cs

示例5: OpenStreamAsync

		public Task<Stream> OpenStreamAsync(string boardName, AccessMode accessMode)
		{
			// Note that we do not need any preconditions here. They are inherited from
			// the base interface.

			return Task.FromResult(new FileStream(
				Path.Combine(this.boardsDirectory.Value, boardName),
				accessMode == AccessMode.Read ? FileMode.Open : FileMode.OpenOrCreate) as Stream);
		}
開發者ID:mkandroid15,項目名稱:Samples,代碼行數:9,代碼來源:FileStreamManager.cs

示例6: ImageSegment

 public ImageSegment(string name, Address addr, long size, AccessMode access)
 {
     if (name == null)
         throw new ArgumentNullException("name", "Segments must have names.");
     this.Name = name;
     this.Size = (uint) size;
     this.Address = addr;
     this.Access = access;
 }
開發者ID:relaxar,項目名稱:reko,代碼行數:9,代碼來源:ImageSegment.cs

示例7: Access

		/// <summary>
		/// Checks if the caller has access to the inode 
		/// </summary>
		/// <param name="path">The resource to check permissions for.</param>
		/// <returns>True if the requested access mode combination is available to the immediate caller. If any one requested access mode is not available, the result is false.</returns>
		public static bool Access(string path, AccessMode mode)
		{
			DirectoryEntry entry = PathResolver.Resolve(rootNode, ref path, PathResolutionFlags.DoNotThrowNotFoundException);
			if (null != entry) {
				return AccessCheck.Perform(entry, mode, AccessCheckFlags.NoThrow);
			}

			return false;
		}
開發者ID:sharpos,項目名稱:SharpOS,代碼行數:14,代碼來源:VirtualFileSystem.cs

示例8: Lock

        public LockingObject Lock(AccessMode accessMode, bool enableSynchronize)
        {
            if (!enableSynchronize)
            {
                return null;
            }

            return this.Lock(accessMode);
        }
開發者ID:maanshancss,項目名稱:ClassLibrary,代碼行數:9,代碼來源:SmartRWLocker.cs

示例9: OpenStreamAsync

		public async Task<Stream> OpenStreamAsync(string boardName, AccessMode accessMode)
		{
			// Note that we do not need any preconditions here. They are inherited from
			// the base interface.

			// Get reference to requested blob and open stream
			var blob = this.container.GetBlockBlobReference(boardName);
			return accessMode == AccessMode.Read
				? await blob.OpenReadAsync().ConfigureAwait(false)
				: await blob.OpenWriteAsync().ConfigureAwait(false);
		}
開發者ID:mkandroid15,項目名稱:Samples,代碼行數:11,代碼來源:CloudBlobStreamManager.cs

示例10: getAccessString

	    public static String getAccessString(AccessMode access_mode) {
		    switch (access_mode) {
		    case AccessMode.ACCESS_READWRITE:
			    return "Read/Write";
            //case AccessMode.ACCESS_WRITEONLY:
			//    return "Write only";
            case AccessMode.ACCESS_READONLY:
			    return "Read only";
		    default:
			    return "unknowm Access Mode";
		    }
	    }
開發者ID:nguyenhunga5,項目名稱:UavObject-.Net-Parser,代碼行數:12,代碼來源:UAVObjectMetaData.cs

示例11: ChangeAccessMode

 async Task ChangeAccessMode(AccessMode changeAccessMode, int portNo) {
     var s3f24 = await EAP.SendAsync(new SecsMessage(3, 23, "ChangeAccessMode",
         Item.L(
             Item.A("ChangeAccess"),
             Item.A(portNo.ToString()),
             Item.L(
                 Item.L(
                     Item.A("AccessMode"),
                     Item.B((byte)changeAccessMode))))));
     byte returnCode = (byte)s3f24.SecsItem.Items[0];
     if (returnCode != 0 && returnCode != 4)
         throw new ScenarioException("Change Loadport[" + portNo + "] access mode fial: " + s3f24.SecsItem.Items[1].Items[0].Items[1].GetValue<string>());
 }
開發者ID:mkjeff,項目名稱:secs4net,代碼行數:13,代碼來源:TCS.AccessModeChange.cs

示例12: DocumentStoreWrapper

        internal DocumentStoreWrapper(
            string name, 
            AccessMode accessMode,
            Action<DocumentStoreWrapper> updateInnerStore)
        {
            name.Ensure("name").IsNotNullOrWhiteSpace();
            updateInnerStore.Ensure("updateInnerStore").IsNotNull();

            this.Name = name;
            this.AccessMode = accessMode;
            this.IsInitialized = false;
            this.UpdateInnerStore = updateInnerStore;
        }
開發者ID:tzarger,項目名稱:brnkly,代碼行數:13,代碼來源:DocumentStoreWrapper.cs

示例13: Lock

        public LockingObject Lock(AccessMode accessMode)
        {
            if (accessMode == AccessMode.Read)
            {
                this.lastRequireReadTime = DateTime.Now;
            }
            else
            {
                this.lastRequireWriteTime = DateTime.Now;
            }

            return new LockingObject(this.readerWriterLock, accessMode);
        } 
開發者ID:summer-breeze,項目名稱:ChengGouHui,代碼行數:13,代碼來源:SmartRWLocker.cs

示例14: OpenStreamAsync

		public Task<Stream> OpenStreamAsync(string boardName, AccessMode accessMode)
		{
			// Note that we cannot make this precondition a legacy-requires in our sample.
			Contract.Requires(boardName != null);

			// The following postcondition checks the resulting task.
			Contract.Ensures(Contract.Result<Task<Stream>>() != null);

			// The following postcondition checks the result once the Task has been completed.
			Contract.Ensures(Contract.Result<Task<Stream>>().Result != null);

			return default(Task<Stream>);
		}
開發者ID:mkandroid15,項目名稱:Samples,代碼行數:13,代碼來源:StreamManagerContract.cs

示例15: LockingObject

        public LockingObject(ReaderWriterLock _lock, AccessMode _lockMode)
        {
            readerWriterLock = _lock;
            accessMode = _lockMode;

            if (accessMode == AccessMode.Read)
            {
                readerWriterLock.AcquireReaderLock(-1);
            }
            else
            {
                readerWriterLock.AcquireWriterLock(-1);
            }
        }
開發者ID:wxgb9801,項目名稱:Measurer,代碼行數:14,代碼來源:LockingObject.cs


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