Exemple #1
0
 public FileParserController(ILogger <FileParserController> logger, IXmlHandler xmlHandler, IJsonHandler jsonHandler, IEmailSender emailSender)
 {
     _logger      = logger;
     _xmlHandler  = xmlHandler;
     _jsonHandler = jsonHandler;
     _emailSender = emailSender;
 }
Exemple #2
0
 /**
  * Creates a new instance with the specified character set.
  *
  * @param charset
  */
 public EncryptedJsonEncoder(Encoding charset, IEncryptionKeyHolder encryptionKeyHolder, IJsonHandler jsonHandler)
 {
     encoder                  = new LineEndStringEncoder(charset);
     this.charset             = charset;
     this.encryptionKeyHolder = encryptionKeyHolder;
     this.jsonHandler         = jsonHandler;
     StaticHandler.Core.Logger.Debug("Using charset {0} for encrypting", charset.EncodingName);
 }
 public OFXRepository(
     IJsonHandler jsonHandler,
     IConfiguration configuration)
 {
     JsonHandler = jsonHandler ??
                   throw new ArgumentNullException(nameof(jsonHandler));
     Configuration = configuration ??
                     throw new ArgumentNullException(nameof(configuration));
     JsonPath = Configuration.GetSection("JsonPath").Value;
 }
Exemple #4
0
        /// <summary>添加处理器</summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public Json AddHandler(IJsonHandler handler)
        {
            if (handler != null)
            {
                handler.Host = this;
                Handlers.Add(handler);
                // 根据优先级排序
                (Handlers as List <IJsonHandler>).Sort();
            }

            return(this);
        }
Exemple #5
0
        /// <summary>添加处理器</summary>
        /// <param name="handler"></param>
        /// <returns></returns>
        public Json AddHandler(IJsonHandler handler)
        {
            if (handler != null)
            {
                handler.Host = this;
                Handlers.Add(handler);
                // 根据优先级排序
                Handlers = Handlers.OrderBy(e => e.Priority).ToList();
            }

            return(this);
        }
Exemple #6
0
        /// <summary>
        /// Binds the node.
        /// </summary>
        /// <param name="returnNodeId">The return node id.</param>
        private void BindNode(string returnNodeId)
        {
            string tabId = String.Empty;

            if (Request["tab"] != null)
            {
                tabId = Request["tab"];
            }
            if (String.IsNullOrEmpty(tabId))
            {
                return;
            }

            string staticNodeId = returnNodeId;
            string innerNodeId  = returnNodeId;

            if (Request.Form["id"] != null && !String.IsNullOrEmpty(Request.Form["id"]) && Request.Form["id"] != "null")
            {
                innerNodeId = Request.Form["id"].ToString();
            }
            if (Request.Form["staticParentId"] != null && !String.IsNullOrEmpty(Request.Form["staticParentId"]) && Request.Form["staticParentId"] != "null")
            {
                staticNodeId = Request.Form["staticParentId"].ToString();
            }

            IXPathNavigable navigable = Mediachase.Ibn.XmlTools.XmlBuilder.GetXml(StructureType.Navigation);
            XPathNavigator  link      = navigable.CreateNavigator().SelectSingleNode(String.Format("//Link[@id='{0}']", staticNodeId));

            if (link != null)
            {
                string treeLoader = link.GetAttribute("treeLoader", string.Empty);
                if (!String.IsNullOrEmpty(treeLoader))
                {
                    IJsonHandler jsHandler = (IJsonHandler)AssemblyUtil.LoadObject(treeLoader);
                    WriteArray(jsHandler.GetJsonDataSource(innerNodeId));
                }
            }
        }
 public JsonReportService(IJsonHandler jsonHandler)
 {
     this.jsonHandler = jsonHandler;
 }
 public BasketQueryHandler(IJsonHandler jsonHandler)
 {
     _jsonHandler = jsonHandler;
 }
Exemple #9
0
 /**
  * Creates a new instance with the current system character set.
  */
 public EncryptedJsonEncoder(IEncryptionKeyHolder encryptionKeyHolder, IJsonHandler jsonHandler) : this(StaticHandler.encoding, encryptionKeyHolder, jsonHandler)
 {
 }
Exemple #10
0
 /**
  * Creates a new instance with the specified character set.
  *
  * @param charset
  */
 public EncryptedJSONDecoder(Encoding charset, IEncryptionKeyHolder encryptionKeyHolder, IJsonHandler jsonHandler) : base(charset)
 {
     this.charset             = charset;
     this.encryptionKeyHolder = encryptionKeyHolder;
     this.jsonHandler         = jsonHandler;
 }
Exemple #11
0
 /**
  * Creates a new instance with the current system character set.
  */
 public EncryptedJSONDecoder(IEncryptionKeyHolder encryptionKeyHolder, IJsonHandler jsonHandler) : this(StaticHandler.encoding, encryptionKeyHolder, jsonHandler)
 {
     StaticHandler.Core.Logger.Debug("Using charset {0} for decrypting", charset.EncodingName);
 }