• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# AccessRights类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AccessRights的典型用法代码示例。如果您正苦于以下问题:C# AccessRights类的具体用法?C# AccessRights怎么用?C# AccessRights使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AccessRights类属于命名空间,在下文中一共展示了AccessRights类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: IotHubConnection

 public IotHubConnection(IotHubConnectionString connectionString, AccessRights accessRights)
 {
     this.connectionString = connectionString;
     this.accessRights = accessRights;
     this.faultTolerantSession = new FaultTolerantAmqpObject<AmqpSession>(this.CreateSessionAsync, this.CloseConnection);
     this.refreshTokenTimer = new IOThreadTimer(s => ((IotHubConnection)s).OnRefreshToken(), this, false);
 }
开发者ID:rashidredcley,项目名称:azure-iot-sdks,代码行数:7,代码来源:IotHubConnection.cs


示例2: BaseRole

 public BaseRole(string sName, string sID, string sPath, AccessRights AccessRights)
 {
     _sName = sName;
     _sID = sID;
     _sPath = sPath;
     _AccessRight = AccessRights;
 }
开发者ID:Cabana,项目名称:CMSConverter,代码行数:7,代码来源:BaseRole.cs


示例3: ServiceBusQueueListenerFactory

 public ServiceBusQueueListenerFactory(ServiceBusAccount account, string queueName, ITriggeredFunctionExecutor executor, AccessRights accessRights)
 {
     _namespaceManager = account.NamespaceManager;
     _messagingFactory = account.MessagingFactory;
     _queueName = queueName;
     _executor = executor;
     _accessRights = accessRights;
 }
开发者ID:zero-byte,项目名称:azure-webjobs-sdk,代码行数:8,代码来源:ServiceBusQueueListenerFactory.cs


示例4: VKApiManager

 public VKApiManager(int appId, AccessRights rights, bool xmlNeeded = true)
 {
     AuthorizationDetails details = new AuthorizationDetails();
     details.appId = appId;
     details.rights = rights;
     IsXmlResponseNeeded = xmlNeeded;
     status = Init(details);
 }
开发者ID:salterok,项目名称:VK-2-years-old-,代码行数:8,代码来源:VKApiManager.cs


示例5: AccessControl

		/// <summary>
		/// Initializes a new instance of the <see cref="MailKit.AccessControl"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new <see cref="MailKit.AccessControl"/> with the given name and
		/// access rights.
		/// </remarks>
		/// <param name="name">The identifier name.</param>
		/// <param name="rights">The access rights.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <paramref name="name"/> is <c>null</c>.
		/// </exception>
		public AccessControl (string name, IEnumerable<AccessRight> rights)
		{
			if (name == null)
				throw new ArgumentNullException ("name");

			Rights = new AccessRights (rights);
			Name = name;
		}
开发者ID:Gekctek,项目名称:MailKit,代码行数:20,代码来源:AccessControl.cs


示例6: AccessControl

		/// <summary>
		/// Initializes a new instance of the <see cref="MailKit.AccessControl"/> class.
		/// </summary>
		/// <remarks>
		/// Creates a new <see cref="MailKit.AccessControl"/> with the given name and
		/// access rights.
		/// </remarks>
		/// <param name="name">The identifier name.</param>
		/// <param name="rights">The access rights.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="name"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="rights"/> is <c>null</c>.</para>
		/// </exception>
		public AccessControl (string name, string rights)
		{
			if (name == null)
				throw new ArgumentNullException (nameof (name));

			Rights = new AccessRights (rights);
			Name = name;
		}
开发者ID:jstedfast,项目名称:MailKit,代码行数:22,代码来源:AccessControl.cs


示例7: CreateAsync_AccessRightsNotManage_DoesNotCreateQueue

        public async Task CreateAsync_AccessRightsNotManage_DoesNotCreateQueue(AccessRights accessRights)
        {
            ServiceBusAccount account = new ServiceBusAccount();
            Mock<ITriggeredFunctionExecutor> mockExecutor = new Mock<ITriggeredFunctionExecutor>(MockBehavior.Strict);
            ServiceBusQueueListenerFactory factory = new ServiceBusQueueListenerFactory(account, "testqueue", mockExecutor.Object, accessRights);

            IListener listener = await factory.CreateAsync(CancellationToken.None);
            Assert.NotNull(listener);
        }
开发者ID:alpaix,项目名称:azure-webjobs-sdk,代码行数:9,代码来源:ServiceBusQueueListenerFactoryTests.cs


示例8: ServiceBusSubscriptionListenerFactory

 public ServiceBusSubscriptionListenerFactory(ServiceBusAccount account, string topicName, string subscriptionName, ITriggeredFunctionExecutor executor, AccessRights accessRights)
 {
     _namespaceManager = account.NamespaceManager;
     _messagingFactory = account.MessagingFactory;
     _topicName = topicName;
     _subscriptionName = subscriptionName;
     _executor = executor;
     _accessRights = accessRights;
 }
开发者ID:zero-byte,项目名称:azure-webjobs-sdk,代码行数:9,代码来源:ServiceBusSubscriptionListenerFactory.cs


示例9: CreateAsync_AccessRightsNotManage_DoesNotCreateTopicOrSubscription

        public async Task CreateAsync_AccessRightsNotManage_DoesNotCreateTopicOrSubscription(AccessRights accessRights)
        {
            ServiceBusAccount account = new ServiceBusAccount();
            Mock<ITriggeredFunctionExecutor> mockExecutor = new Mock<ITriggeredFunctionExecutor>(MockBehavior.Strict);
            ServiceBusSubscriptionListenerFactory factory = new ServiceBusSubscriptionListenerFactory(account, "testtopic", "testsubscription", mockExecutor.Object, accessRights, new ServiceBusConfiguration());

            IListener listener = await factory.CreateAsync(CancellationToken.None);
            Assert.NotNull(listener);
        }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:9,代码来源:ServiceBusSubscriptionListenerFactoryTests.cs


示例10: ServiceBusBinding

 public ServiceBusBinding(string parameterName, IArgumentBinding<ServiceBusEntity> argumentBinding, ServiceBusAccount account, IBindableServiceBusPath path, AccessRights accessRights)
 {
     _parameterName = parameterName;
     _argumentBinding = argumentBinding;
     _account = account;
     _namespaceName = ServiceBusClient.GetNamespaceName(account);
     _path = path;
     _accessRights = accessRights;
     _converter = CreateConverter(account, path, accessRights);
 }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:10,代码来源:ServiceBusBinding.cs


示例11: AuthorizationDetails

 /// <summary>
 /// Констуктор по умолчанию.
 /// </summary>
 public AuthorizationDetails()
 {
     appId = -1;
     secureKey = String.Empty;
     rights = AccessRights.NO_RIGHTS;
     userId = -1;
     accessToken = String.Empty;
     expiresIn = -1;
     issuedTime = DateTime.MinValue;
 }
开发者ID:salterok,项目名称:VK-2-years-old-,代码行数:13,代码来源:AuthorizationDetails.cs


示例12: ServiceBusTriggerBinding

 public ServiceBusTriggerBinding(string parameterName, ITriggerDataArgumentBinding<BrokeredMessage> argumentBinding,
     ServiceBusAccount account, string topicName, string subscriptionName, AccessRights accessRights)
 {
     _parameterName = parameterName;
     _argumentBinding = argumentBinding;
     _account = account;
     _namespaceName = ServiceBusClient.GetNamespaceName(account);
     _topicName = topicName;
     _subscriptionName = subscriptionName;
     _entityPath = SubscriptionClient.FormatSubscriptionPath(topicName, subscriptionName);
     _accessRights = accessRights;
 }
开发者ID:zero-byte,项目名称:azure-webjobs-sdk,代码行数:12,代码来源:ServiceBusTriggerBinding.cs


示例13: FixReferencedMemberAccess

        private void FixReferencedMemberAccess(AccessRights memberAccessRights)
        {
            var declaration =
                _highlighting.LessVisibleReferencedMember.DeclaredElement
                    .GetDeclarations().FirstOrDefault();

            Contract.Assert(declaration != null);

            ModifiersUtil.SetAccessRights(
                declaration,
                memberAccessRights);
        }
开发者ID:breki,项目名称:ReSharperContractExtensions,代码行数:12,代码来源:RequiresInconsistentVisibiityQuickFix.cs


示例14: MemberWithAccess

        internal MemberWithAccess(IClrDeclaredElement declaredElement, AccessRights typeAccessRights,
            MemberType memberType, AccessRights memberAccessRights)
        {
            Contract.Requires(declaredElement != null);

            _declaredElement = declaredElement;

            MemberName = declaredElement.ShortName;
            TypeAccessRights = typeAccessRights;
            MemberType = memberType;
            _memberAccessRights = memberAccessRights;
        }
开发者ID:remyblok,项目名称:ReSharperContractExtensions,代码行数:12,代码来源:MemberWithAccess.cs


示例15: AccessRightsToStringArray

        public static string[] AccessRightsToStringArray(AccessRights accessRights)
        {
            var values = new List<string>(2);
            foreach (AccessRights right in Enum.GetValues(typeof(AccessRights)))
            {
                if (accessRights.HasFlag(right))
                {
                    values.Add(right.ToString());
                }
            }

            return values.ToArray();
        }
开发者ID:Fricsay,项目名称:azure-iot-sdks,代码行数:13,代码来源:AccessRights.cs


示例16: FixReferencedTypeAccess

        private void FixReferencedTypeAccess(AccessRights newTypeAccess)
        {
            var declaration =
                _highlighting.LessVisibleReferencedMember.DeclaredElement
                .With(x => x.GetContainingType())
                .With(x => x.GetDeclarations().FirstOrDefault());

            Contract.Assert(declaration != null);

            ModifiersUtil.SetAccessRights(
                declaration,
                newTypeAccess);
        }
开发者ID:breki,项目名称:ReSharperContractExtensions,代码行数:13,代码来源:RequiresInconsistentVisibiityQuickFix.cs


示例17: SendAndCreateQueueIfNotExistsAsync

        public static async Task SendAndCreateQueueIfNotExistsAsync(this MessageSender sender, BrokeredMessage message,
            Guid functionInstanceId, NamespaceManager namespaceManager, AccessRights accessRights, CancellationToken cancellationToken)
        {
            if (sender == null)
            {
                throw new ArgumentNullException("sender");
            }
            else if (namespaceManager == null)
            {
                throw new ArgumentNullException("namespaceManager");
            }

            ServiceBusCausalityHelper.EncodePayload(functionInstanceId, message);

            bool threwMessgingEntityNotFoundException = false;
            cancellationToken.ThrowIfCancellationRequested();

            try
            {
                await sender.SendAsync(message);
                return;
            }
            catch (MessagingEntityNotFoundException)
            {
                if (accessRights != AccessRights.Manage)
                {
                    // if we don't have the required rights to create the queue,
                    // rethrow the exception
                    throw;
                }

                threwMessgingEntityNotFoundException = true;
            }

            Debug.Assert(threwMessgingEntityNotFoundException);
            cancellationToken.ThrowIfCancellationRequested();

            try
            {
                await namespaceManager.CreateQueueAsync(sender.Path);
            }
            catch (MessagingEntityAlreadyExistsException)
            {
            }

            // Clone the message because it was already consumed before (when trying to send)
            // otherwise, you get an exception
            message = message.Clone();
            cancellationToken.ThrowIfCancellationRequested();
            await sender.SendAsync(message);
        }
开发者ID:ConnorMcMahon,项目名称:azure-webjobs-sdk,代码行数:51,代码来源:MessageSenderExtensions.cs


示例18: ChannelCreatedMessage

        public byte[] ChannelCreatedMessage(int clientId, int serverId, EpicsType dataType, int dataCount, AccessRights access)
        {
            MemoryStream mem = new MemoryStream();
            BinaryWriter writer = new BinaryWriter(mem);

            mem.Capacity = 32;

            writer.Write(((UInt16)CommandID.CA_PROTO_ACCESS_RIGHTS).ToByteArray());
            writer.Write(new byte[6]);
            writer.Write(((UInt32)clientId).ToByteArray());
            writer.Write(((UInt32)access).ToByteArray());

            writer.Write(((UInt16)CommandID.CA_PROTO_CREATE_CHAN).ToByteArray());
            if (dataCount > 30000)
                writer.Write(new byte[] { 0xFF, 0xFF });
            else
                writer.Write(new byte[2]);
            writer.Write(((UInt16)dataType).ToByteArray());
            if (dataCount > 30000)
                writer.Write(new byte[] { 0x00, 0x00 });
            else
                writer.Write(((UInt16)dataCount).ToByteArray());
            writer.Write(((UInt32)clientId).ToByteArray());
            writer.Write(((UInt32)serverId).ToByteArray());
            if (dataCount > 30000)
            {
                // Size
                writer.Write(((UInt32)0).ToByteArray());
                // Data count
                writer.Write(((UInt32)dataCount).ToByteArray());
            }

            byte[] buffer = mem.ToArray();
            writer.Close();
            mem.Dispose();

            return buffer;
        }
开发者ID:ISISComputingGroup,项目名称:EPICS-epicssharp,代码行数:38,代码来源:CAServerFilter.cs


示例19: CAServerChannel

 public CAServerChannel(CAServer cAServer, int serverId, int clientId, string channelName, CATcpConnection tcpConnection)
 {
     // TODO: Complete member initialization
     this.Server = cAServer;
     this.ServerId = serverId;
     this.ClientId = clientId;
     this.ChannelName = channelName;
     this.TcpConnection = tcpConnection;
     tcpConnection.Closing += new EventHandler(tcpConnection_Closing);
     Property = "VAL";
     if (channelName.Contains("."))
     {
         string[] splitted = channelName.Split('.');
         Record = Server.records[splitted[0]];
         Property = splitted[1].ToUpper();
     }
     else
         Record = Server.records[ChannelName];
     if (!Record.CanBeRemotlySet)
         Access = AccessRights.ReadOnly;
     TcpConnection.Send(Server.Filter.ChannelCreatedMessage(ClientId, ServerId, FindType(Record), Record.dataCount, Access));
     //TcpConnection.Send(Server.Filter.ChannelCreatedMessage(ClientId, ServerId, FindType(Record[Property].GetType()), Record.dataCount, Access));
 }
开发者ID:ISISComputingGroup,项目名称:EPICS-epicssharp,代码行数:23,代码来源:CAServerChannel.cs


示例20: SetAccessRightsAsync

		/// <summary>
		/// Asynchronously set the access rights for the specified identity.
		/// </summary>
		/// <remarks>
		/// Asynchronously sets the access rights for the specified identity.
		/// </remarks>
		/// <returns>An asynchronous task context.</returns>
		/// <param name="name">The identity name.</param>
		/// <param name="rights">The access rights.</param>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <exception cref="System.ArgumentNullException">
		/// <para><paramref name="name"/> is <c>null</c>.</para>
		/// <para>-or-</para>
		/// <para><paramref name="rights"/> is <c>null</c>.</para>
		/// </exception>
		/// <exception cref="System.ObjectDisposedException">
		/// The <see cref="IMailStore"/> has been disposed.
		/// </exception>
		/// <exception cref="ServiceNotConnectedException">
		/// The <see cref="IMailStore"/> is not connected.
		/// </exception>
		/// <exception cref="ServiceNotAuthenticatedException">
		/// The <see cref="IMailStore"/> is not authenticated.
		/// </exception>
		/// <exception cref="System.NotSupportedException">
		/// The mail store does not support the ACL extension.
		/// </exception>
		/// <exception cref="System.OperationCanceledException">
		/// The operation was canceled via the cancellation token.
		/// </exception>
		/// <exception cref="System.IO.IOException">
		/// An I/O error occurred.
		/// </exception>
		/// <exception cref="ProtocolException">
		/// The server's response contained unexpected tokens.
		/// </exception>
		/// <exception cref="CommandException">
		/// The command failed.
		/// </exception>
		public virtual Task SetAccessRightsAsync (string name, AccessRights rights, CancellationToken cancellationToken = default (CancellationToken))
		{
			if (name == null)
				throw new ArgumentNullException ("name");

			if (rights == null)
				throw new ArgumentNullException ("rights");

			return Task.Factory.StartNew (() => {
				lock (SyncRoot) {
					SetAccessRights (name, rights, cancellationToken);
				}
			}, cancellationToken, TaskCreationOptions.None, TaskScheduler.Default);
		}
开发者ID:naeemkhedarun,项目名称:MailKit,代码行数:53,代码来源:MailFolder.cs



注:本文中的AccessRights类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AccessSpecifierDecl类代码示例发布时间:2022-05-24
下一篇:
C# AccessModifier类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap