本文整理汇总了C#中AccessMode类的典型用法代码示例。如果您正苦于以下问题:C# AccessMode类的具体用法?C# AccessMode怎么用?C# AccessMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccessMode类属于命名空间,在下文中一共展示了AccessMode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: VistaDBConnection
/// <summary>
/// Constructor.
/// </summary>
public VistaDBConnection()
{
VistaDBErrorMsgs.SetErrorFunc();
this.connectionState = ConnectionState.Closed;
this.accessMode = AccessMode.Local;
this.vistaDBSQL = null;
this.dataSource = null;
this.database = null;
this.cypher = CypherType.None;
this.password = null;
this.exclusive = false;
this.readOnly = false;
this.loginUser = "";
this.loginPassword = "";
}
开发者ID:nguyenhuuhuy,项目名称:mygeneration,代码行数:19,代码来源:vnConnection.cs
示例17: LockingObject
public LockingObject(ReaderWriterLock _lock, AccessMode _lockMode)
{
this.readerWriterLock = _lock;
this.accessMode = _lockMode;
if (this.accessMode == AccessMode.Read)
{
this.readerWriterLock.AcquireReaderLock(-1);
}
else if (this.accessMode == AccessMode.Write)
{
this.readerWriterLock.AcquireWriterLock(-1);
}
else //UpAndDowngrade
{
this.lockCookie = this.readerWriterLock.UpgradeToWriterLock(-1);
}
}
开发者ID:maanshancss,项目名称:ClassLibrary,代码行数:18,代码来源:LockingObject.cs
示例18: TestBandwidth
private void TestBandwidth(Context context, Device[] devices, int start, int end, int increment, TestMode testMode, MemoryCopyKind memoryCopyKind, PrintMode printMode, AccessMode accessMode, MemoryMode memoryMode, int startDevice, int endDevice)
{
switch (testMode)
{
case TestMode.Quick:
TestBandwidthQuick(context, devices, DefaultSize, memoryCopyKind, printMode, accessMode, memoryMode, startDevice, endDevice);
break;
case TestMode.Range:
TestBandwidthRange(context, devices, start, end, increment, memoryCopyKind, printMode, accessMode, memoryMode, startDevice, endDevice);
break;
case TestMode.Shmoo:
TestBandwidthShmoo(context, devices, memoryCopyKind, printMode, accessMode, memoryMode, startDevice, endDevice);
break;
default:
break;
}
}
开发者ID:JamesLinus,项目名称:Asm4GCN,代码行数:20,代码来源:Bandwidth.cs
示例19: HasModeAccess
/// <summary>
/// Gets a specific access of a Specific mode for a user.
/// </summary>
/// <param name="aUserKey">A user key composite.</param>
/// <param name="aFunction">A function.</param>
/// <param name="aAccessMode">A access mode.</param>
/// <returns></returns>
public static bool HasModeAccess(UserKey aUserKey, string aFunction, AccessMode aAccessMode)
{
UserFunctionAccess vUserFunctionAccess = new UserFunctionAccess() { UsrKey = aUserKey.UsrKey };
vUserFunctionAccess.FunctionAccess.Function = aFunction;
Load(vUserFunctionAccess);
bool vAccess = false;
switch (aAccessMode)
{
case AccessMode.List:
{
vAccess = vUserFunctionAccess.FunctionAccess.Access.List;
break;
}
case AccessMode.Read:
{
vAccess = vUserFunctionAccess.FunctionAccess.Access.Read;
break;
}
case AccessMode.Create:
{
vAccess = vUserFunctionAccess.FunctionAccess.Access.Create;
break;
}
case AccessMode.Update:
{
vAccess = vUserFunctionAccess.FunctionAccess.Access.Update;
break;
}
case AccessMode.Delete:
{
vAccess = vUserFunctionAccess.FunctionAccess.Access.Delete;
break;
}
default:
{
vAccess = false;
break;
}
}
return vAccess;
}
开发者ID:heinschulie,项目名称:z2z,代码行数:48,代码来源:UserFunctionAccessData.cs
示例20: Open
/// <summary>
/// Retrieve a Stream for the given path (Read or Write access can be specified)
/// Stream.Close() should be called when you are finished using the Stream.
/// </summary>
/// <param name="file">Heirarchical path designating stream location (uses "/" as
/// path designator)</param>
/// <param name="mode">Read or Write. Write will overwrite any exising path of
/// the same name.</param>
/// <returns>Stream that can be used to access the path (Stream.Close() must be
/// called when you are finished using the Stream).</returns>
public override Stream Open(string file, AccessMode mode)
{
// validate the path (throws an exception if it is invalid)
ValidatePath(file);
// convert the path to lower-case
string pathLower = file.ToLower(CultureInfo.InvariantCulture);
// return the approrpiate stream
switch (mode)
{
case AccessMode.Read:
return OpenMemoryStreamForRead(pathLower);
case AccessMode.Write:
return OpenMemoryStreamForWrite(pathLower);
default:
Debug.Assert(false, "Invalid AccessMode");
return null;
}
}
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:32,代码来源:MemoryBasedSiteStorage.cs
注:本文中的AccessMode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论