private void OnInit(IInputProperty sender, SuccessEventArgs args) { this._inputReader = this.InputPointReader(this.Input.RecordInfo); if (this._inputReader == null) { args.Success = false; return; } this.Output?.Init( FieldDescription.CreateRecordInfo( this.Input.RecordInfo, new FieldDescription( this.ConfigObject.OutputBinXFieldName, FieldType.E_FT_Double, source: "HexBin: X Co-ordinate of Center"), new FieldDescription( this.ConfigObject.OutputBinYFieldName, FieldType.E_FT_Double, source: "HexBin: Y Co-ordinate of Center"))); this._outputBinXFieldBase = this.Output?[this.ConfigObject.OutputBinXFieldName]; this._outputBinYFieldBase = this.Output?[this.ConfigObject.OutputBinYFieldName]; args.Success = true; }
private void OnInit(IInputProperty sender, SuccessEventArgs args) { // Get Input Field var inputFieldBase = this.Input.RecordInfo.GetFieldByName(this.ConfigObject.InputFieldName, false); if (inputFieldBase == null) { args.Success = false; return; } // Create Output Format var fieldDescription = new FieldDescription( this.ConfigObject.OutputFieldName, FieldType.E_FT_V_WString, this.ConfigObject.OutputFieldLength, source: nameof(StringFormatterEngine)); this.Output?.Init(FieldDescription.CreateRecordInfo(this.Input.RecordInfo, fieldDescription)); this._outputFieldBase = this.Output?[this.ConfigObject.OutputFieldName]; // Create the Copier this._copier = this.RecordCopierFactory.CreateCopier( this.Input.RecordInfo, this.Output?.RecordInfo, this.ConfigObject.OutputFieldName); // Create the Formatter function this._formatter = this.CreateFormatter(inputFieldBase); args.Success = this._formatter != null; }
private void OnInit(IInputProperty sender, SuccessEventArgs args) { var fieldDescription = new FieldDescription( this.ConfigObject.OutputFieldName, this.ConfigObject.OutputType, source: $"NumberParser: {this.ConfigObject.InputFieldName} parsed as a number"); this._inputFieldBase = this.Input.RecordInfo.GetFieldByName(this.ConfigObject.InputFieldName, false); if (this._inputFieldBase == null) { args.Success = false; return; } this.Output?.Init(FieldDescription.CreateRecordInfo(this.Input.RecordInfo, fieldDescription)); this._outputFieldBase = this.Output?[this.ConfigObject.OutputFieldName]; // Create the Copier this._copier = this.RecordCopierFactory.CreateCopier( this.Input.RecordInfo, this.Output?.RecordInfo, this.ConfigObject.OutputFieldName); args.Success = true; }
private void OnInit(IInputProperty sender, SuccessEventArgs args) { // Get Input Field this._inputField = this.Input.RecordInfo.GetFieldByName(this.ConfigObject.InputFieldName, false); if (this._inputField == null) { args.Success = false; return; } // Create Output Format this.Output?.Init(FieldDescription.CreateRecordInfo(this.Input.RecordInfo, new FieldDescription(nameof(XmlUtils.NodeData.XPath), FieldType.E_FT_V_WString), new FieldDescription(nameof(XmlUtils.NodeData.InnerText), FieldType.E_FT_V_WString), new FieldDescription(nameof(XmlUtils.NodeData.InnerXml), FieldType.E_FT_V_WString))); // Create the Copier this._copier = this.RecordCopierFactory.CreateCopier( this.Input.RecordInfo, this.Output?.RecordInfo, nameof(XmlUtils.NodeData.XPath), nameof(XmlUtils.NodeData.InnerText), nameof(XmlUtils.NodeData.InnerXml)); this._xpathField = this.Output?[nameof(XmlUtils.NodeData.XPath)]; this._innerTextField = this.Output?[nameof(XmlUtils.NodeData.InnerText)]; this._innerXmlField = this.Output?[nameof(XmlUtils.NodeData.InnerXml)]; args.Success = true; }
void worker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { string url = e.Argument as string; SuccessEventArgs result = new SuccessEventArgs(); MyBackgroundWorker bgw = sender as MyBackgroundWorker; bgw.ReportProgress(0, "Checking for new version ..."); // Download xml file //using (XmlTextReader reader = new XmlTextReader(url)) using (WebClient wc = new WebClient()) { XmlDocument doc = new XmlDocument(); string s = wc.DownloadString(url); //+"?Unused="+random.Next() // to disable caching doc.LoadXml(s); bgw.ReportProgress(0, "Downloaded new version information."); try { result.LatestVersion = new Version(doc.SelectSingleNode("//latestversion").InnerText); result.DownloadURL = doc.SelectSingleNode("//downloadurl").InnerText; result.WebpageURL = doc.SelectSingleNode("//webpageurl").InnerText; } catch (Exception) { throw new Exception("The version info file has a wrong format."); } } e.Result = result; }
// called by engine static bool RaiseStart() { var e = new SuccessEventArgs (); if(Start != null) { Start (null, e); } return e.Success; }
public void OnSuccess(SuccessEventArgs e) { SuccessEventHandler handler = SuccessEvent; if (SuccessEvent != null) { handler(this, e); } }
/// <summary> /// Called by Alteryx to initialize the incoming connection. /// </summary> /// <param name="recordInfo">The record information.</param> /// <returns>True if OK</returns> public bool II_Init(RecordInfo recordInfo) { this.State = ConnectionState.InitCalled; this.RecordInfo = recordInfo; var args = new SuccessEventArgs(); this.InitCalled?.Invoke(this, args); return(args.Success); }
protected void _msAddTimeEntry_SearchSuccessful(object sender, SuccessEventArgs e) { _lblMessage.CssClass = "successMessage"; _lblMessage.Text = e.Message; if (_msAddTimeEntry.ClientRowCount == 0) { _ddlTimeType.Items.Clear(); } }
void worker_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { if (e.Cancelled) { if (Status != null) { Status(this, new StatusEventArgs() { HasFailed = true, Description = "Checking for new version cancelled" }); } } else if (e.Error != null) { if (Status != null) { Status(this, new StatusEventArgs() { HasFailed = true, Description = "Checking for new version failed: " + e.Error.Message }); } } else if (!(e.Result is SuccessEventArgs)) { if (Status != null) { Status(this, new StatusEventArgs() { HasFailed = true, Description = "Checking for new version failed." }); } } else { SuccessEventArgs sea = e.Result as SuccessEventArgs; System.Reflection.Assembly A = System.Reflection.Assembly.GetEntryAssembly(); if (A != null) { sea.CurrentVersion = A.GetName().Version; } else { sea.CurrentVersion = new Version(0, 0); // being here is an error.... However for the sake of unittests no error is reported } sea.HasNewerVersion = sea.LatestVersion > sea.CurrentVersion; if (Success != null) { Success(this, sea); } } }
private void OnInit(IInputProperty sender, SuccessEventArgs args) { this._nextValue = this.CreateRandomFunc(); var fieldDescription = new FieldDescription( this.ConfigObject.OutputFieldName, this.ConfigObject.OutputType, source: $"RandomNumber: {this.ConfigObject.ToString().Replace($"{this.ConfigObject.OutputFieldName}=", string.Empty)}"); this.Output?.Init(FieldDescription.CreateRecordInfo(this.Input.RecordInfo, fieldDescription)); this._outputFieldBase = this.Output?[this.ConfigObject.OutputFieldName]; args.Success = true; }
private void OnInit(IInputProperty sender, SuccessEventArgs args) { this._inputFieldBase = this.Input.RecordInfo.GetFieldByName(this.ConfigObject.InputFieldName, false); if (this._inputFieldBase == null) { args.Success = false; return; } var field = new FieldDescription( this.ConfigObject.OutputFieldName, FieldType.E_FT_V_String, 256, source: nameof(HashCodeGeneratorEngine)); this.Output.Init(FieldDescription.CreateRecordInfo(this.Input.RecordInfo, field)); this._outputFieldBase = this.Output[this.ConfigObject.OutputFieldName]; this._hashAlgorithm = this.GetAlgorithm(); args.Success = true; }
private void OnSuccessReceived(SuccessEventArgs e) { Success?.Invoke(e); }
private void Success(Response response, Request request) { var args = new SuccessEventArgs(response, request); OnResponseEvent(args); }
/// <summary> /// Called when an async result is returned /// </summary> /// <param name="e"></param> protected void OnResponseEvent(SuccessEventArgs e) { ResponseHandler?.Invoke(this, e); }
private void InputOnInitCalled(IInputProperty property, SuccessEventArgs args) { this._inputRecords = new Queue <Record>(); this.Output?.Init(this.Input.RecordInfo); }
///// <summary> ///// Discard the Enter key, to avoid the OS-generated "ding" sound. ///// </summary> ///// <param name="e"></param> //protected override void OnKeyDown(KeyEventArgs e) //{ // if (e.KeyCode == Keys.Enter && IgnoreEnterKey) // { // e.SuppressKeyPress = true; // e.Handled = true; // } // else // { // base.OnKeyDown(e); // } //} /// <summary> /// Raises the TextPasting event. /// </summary> protected void OnTextPasting() { if (TextPasting != null) { string txt = string.Empty; bool success = true; SuccessEventArgs args; if (Clipboard.ContainsText(TextDataFormat.CommaSeparatedValue) || Clipboard.ContainsText(TextDataFormat.Text) || Clipboard.ContainsText(TextDataFormat.UnicodeText)) { txt = Clipboard.GetText(); } else { success = false; } args = new SuccessEventArgs(success, txt); TextPasting(this, args); } }
// called by engine static bool RaiseStart() { SuccessEventArgs e = null; if (Start != null) { e = new SuccessEventArgs(); Start(null, e); } return e != null ? e.Success : SuccessEventArgs.Default; }
private void OnLoaded(object sender, SuccessEventArgs e) { Device.BeginInvokeOnMainThread(async() => await newsList.FadeTo(1, easing: Easing.CubicInOut)); }