Beispiel #1
0
        public bool Initialize(ProcessorInitializationParameter parameter)
        {
            if (parameter == null) return false;

            _param = parameter;
            _config = XObjectManager.CreateObject<XSLTConfig>(parameter.ConfigXmlString);

            if (_config == null)
            {
                WriteLog(LogType.Error, "Deserialize configuration object failed.");
                return false;
            }

            try
            {
                string XSLTFile = _param.GetFullPath(_config.XSLTFileName);

                xslt = new XslCompiledTransform();
                xslt.Load(XSLTFile);
            }catch(Exception ex)
            {
                _param.Log.Write(ex);
                return false;
            }
            return true;
        }
Beispiel #2
0
        public FormXSLTConfig(ConfigurationInitializationParameter param, XSLTConfig config)
        {
            InitializeComponent();
            _param  = param;
            _config = config;

            if (_config == null)
            {
                _config = new XSLTConfig();
            }

            LoadSetting();
        }
Beispiel #3
0
        public bool EditConfig(Form parentForm, ref string configXmlString)
        {
            XSLTConfig cfg = XObjectManager.CreateObject <XSLTConfig>(configXmlString);

            if (cfg == null)
            {
                WriteLog(LogType.Error, "Deserialize configuration object failed.");
                return(false);
            }
            else
            {
                FormXSLTConfig frm = new FormXSLTConfig(_param, cfg);
                if (frm.ShowDialog(parentForm) != DialogResult.OK)
                {
                    return(false);
                }
                configXmlString = frm.Config.ToXMLString();
                return(true);
            }
        }