コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="token"></param>
        /// <param name="logger"></param>
        public virtual void Apply(ProxyToken token, Logger logger)
        {
            token.Status = Block ? NetStatusCodes.Blocked : NetStatusCodes.Success;
            token.Graph  = Graph;
            token.Client = Client;

            List <INetworkLayer> layers = new List <INetworkLayer>(Layers.CreateLayers(logger));

            if (token.Layers != null)
            {
                switch (MergePolicy)
                {
                case LayerMergePolicy.Prefix:
                    layers.AddRange(token.Layers);
                    break;

                case LayerMergePolicy.Suffix:
                    layers.InsertRange(0, token.Layers);
                    break;

                default:
                    // Do nothing
                    break;
                }
            }

            token.Layers = layers.ToArray();
        }