本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: AddSegment
public ImageSegment AddSegment(MemoryArea mem, string segmentName, AccessMode mode)
{
var segment = new ImageSegment(
segmentName,
mem,
mode);
AddSegment(segment);
return segment;
}
示例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);
}
示例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;
}
示例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;
}
示例8: Lock
public LockingObject Lock(AccessMode accessMode, bool enableSynchronize)
{
if (!enableSynchronize)
{
return null;
}
return this.Lock(accessMode);
}
示例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);
}
示例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";
}
}
示例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>());
}
示例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;
}
示例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);
}
示例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>);
}
示例15: LockingObject
public LockingObject(ReaderWriterLock _lock, AccessMode _lockMode)
{
readerWriterLock = _lock;
accessMode = _lockMode;
if (accessMode == AccessMode.Read)
{
readerWriterLock.AcquireReaderLock(-1);
}
else
{
readerWriterLock.AcquireWriterLock(-1);
}
}