コード例 #1
0
 public static void RequestParse(IPermissionHandler handler, XmlNodeEventArgs args)
 {
     if (OnParseElement != null)
     {
         OnParseElement.Invoke(handler, args);
     }
 }
コード例 #2
0
 public NewRoundCommand(IBingoService bingoService, ILogger logger,
                        IPermissionHandler permissionHandler)
 {
     _bingoService      = bingoService;
     _logger            = logger;
     _permissionHandler = permissionHandler;
 }
コード例 #3
0
 public StartCommand(IBingoService bingoService, CommandService commandService,
                     IConfigurationRoot configuration, IPermissionHandler permissionHandler)
 {
     _bingoService      = bingoService;
     _commandService    = commandService;
     _configuration     = configuration;
     _permissionHandler = permissionHandler;
 }
コード例 #4
0
 public PermissionMiddleware(
     RequestDelegate next,
     IPermissionRoleProvider permissionRoleProvider,
     IPermissionHandler permissionHandler)
 {
     _next = next;
     _permissionRoleProvider = permissionRoleProvider;
     _permissionHandler      = permissionHandler;
 }
コード例 #5
0
        /// <summary>
        /// Sets the permission handler
        /// </summary>
        /// <param name="handler"></param>
        public static void SetHandler(IPermissionHandler handler)
        {
//            var prev = _handler;
            if (_handler == null)
            {
                _handler = handler;
            }
            else
            {
                lock (_handler) _handler = handler;
            }
        }
コード例 #6
0
        public static void ParseWebUser(IPermissionHandler handler, System.Xml.XmlNode node)
        {
            var player = new XmlPlayer()
            {
                Attributes = new System.Collections.Generic.Dictionary <String, String>()
            };

            if (node.Attributes != null && node.Attributes.Count > 0)
            {
                foreach (System.Xml.XmlAttribute attr in node.Attributes)
                {
                    if (!player.Attributes.ContainsKey(attr.Name))
                    {
                        player.Attributes.Add(attr.Name, attr.Value);
                    }
                }
            }

            foreach (System.Xml.XmlNode child in node)
            {
                switch (child.Name)
                {
                case "Name":
                    player.Name = child.InnerText;
                    break;

                case "Nodes":
                    player.Nodes = handler.ParseNodes(child);
                    break;

                case "Groups":
                    player.Groups = handler.ParseArray(child);
                    break;
                }
            }

            if (_store == null)
            {
                _store = new System.Collections.Generic.List <XmlPlayer>()
                {
                    player
                }
            }
            ;
            else
            {
                _store.Add(player);
            }
        }
コード例 #7
0
 public static void RequestParse(IPermissionHandler handler, XmlNodeEventArgs args)
 {
     if (OnParseElement != null)
         OnParseElement.Invoke(handler, args);
 }
コード例 #8
0
 /// <summary>
 /// Sets the permission handler
 /// </summary>
 /// <param name="handler"></param>
 public static void SetHandler(IPermissionHandler handler)
 {
     //            var prev = _handler;
     if (_handler == null) _handler = handler;
     else lock (_handler) _handler = handler;
 }
コード例 #9
0
 public StopCommand(IBingoService bingoService, IPermissionHandler permissionHandler)
 {
     _bingoService      = bingoService;
     _permissionHandler = permissionHandler;
 }
コード例 #10
0
        public static void ParseWebUser(IPermissionHandler handler, System.Xml.XmlNode node)
        {
            var player = new XmlPlayer()
            {
                Attributes = new System.Collections.Generic.Dictionary<String, String>()
            };

            if (node.Attributes != null && node.Attributes.Count > 0)
            {
                foreach (System.Xml.XmlAttribute attr in node.Attributes)
                {
                    if (!player.Attributes.ContainsKey(attr.Name)) player.Attributes.Add(attr.Name, attr.Value);
                }
            }

            foreach (System.Xml.XmlNode child in node)
            {
                switch (child.Name)
                {
                    case "Name":
                        player.Name = child.InnerText;
                        break;
                    case "Nodes":
                        player.Nodes = handler.ParseNodes(child);
                        break;
                    case "Groups":
                        player.Groups = handler.ParseArray(child);
                        break;
                }
            }

            if (_store == null) _store = new System.Collections.Generic.List<XmlPlayer>() { player };
            else _store.Add(player);
        }