コード例 #1
0
        public FormSubscribePublishChannelConfig(ConfigurationInitializationParameter param, SubscribePublishChannelConfig config)
        {
            InitializeComponent();

            _param  = param;
            _config = config;

            if (_config == null)
            {
                _config = new SubscribePublishChannelConfig();
            }
        }
コード例 #2
0
        public bool Initialize(ChannelInitializationParameter parameter)
        {
            if (parameter == null)
            {
                return(false);
            }

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

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

            _pipeLine = new ProcessingPipeLine(_config.Processors, _param);
            return(_pipeLine.Initialize());
        }
コード例 #3
0
        public bool EditConfig(Form parentForm, ref string configXmlString)
        {
            SubscribePublishChannelConfig cfg = XObjectManager.CreateObject <SubscribePublishChannelConfig>(configXmlString);

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