Esempio n. 1
0
        /// <summary>
        /// The cb grep_ selected index changed.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void cbGrep_SelectedIndexChanged(object sender, EventArgs e)
        {
            var f = this.cbGrep.SelectedItem as FieldInfo;
            if (f != null)
            {
                var type = f.DeclaringType;
                if (this._activeGrep == null || this._activeGrep.GetType() != type)
                {
                    var decInstance = Activator.CreateInstance(type);
                    this._activeGrep = f.GetValue(decInstance) as DataGrep;
                }

                this.GenerateData(sender);
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PTFareDataProvider"/> class.
 /// </summary>
 public PTFareDataProvider()
 {
     this._dataGrep = new DataGrep(Seed);
     this._root_ = this._dataGrep.Convert(RootBase);
     this._request_ = this._dataGrep.Convert(RequestBase);
     this._domain_ = this._dataGrep.Convert(DomainBase);
     this._cookie_ = this._dataGrep.Convert(CookieBase);
     this._result_ = this._dataGrep.Convert(ResultBase);
     this._intermediateResult_ = this._dataGrep.Convert(IntermediateResultBase);
     this._resultReferal_ = this._dataGrep.Convert(ResultReferalBase);
 }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DropBoxConfigDialog"/> class.
        /// </summary>
        /// <param name="apiKey">
        /// The api key.
        /// </param>
        /// <param name="apiSecret">
        /// The api secret.
        /// </param>
        /// <param name="curConfig">
        /// The cur config.
        /// </param>
        /// <param name="dataGrep">
        /// The data grep.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        public DropBoxConfigDialog(byte[] apiKey, byte[] apiSecret, DropBoxSyncerConfig curConfig, DataGrep dataGrep, ILogger logger)
        {
            this.InitializeComponent();
            this._dataGrep = dataGrep;
            this._client = new DropNetClient(
                this._dataGrep.Convert(apiKey),
                this._dataGrep.Convert(apiSecret),
                this._dataGrep.Convert(curConfig.UserToken),
                this._dataGrep.Convert(curConfig.UserSecret));
            this._authorizeClient = new DropNetClient(this._dataGrep.Convert(apiKey), this._dataGrep.Convert(apiSecret));
            this.ResultConfig = curConfig == null ? new DropBoxSyncerConfig() : curConfig.ReflectionDeepClone(logger);
            this.ResultConfig.ApiKey = apiKey;
            this.ResultConfig.ApiSecret = apiSecret;
            this.txtDropBoxFolder.DataBindings.Clear();
            this.txtDropBoxFolder.DataBindings.Add("Text", this.ResultConfig, "DropBoxBaseFolder");

            if (curConfig.ApiKey != null && curConfig.ApiSecret != null)
            {
                this._needSave = !ObjectExtension.AreEquals(curConfig.ApiKey, apiKey) || !ObjectExtension.AreEquals(curConfig.ApiSecret, apiSecret);
            }

            this._logger = logger;
        }