private void OnMenuSaveAsActivate(object sender, EventArgs args) { //Serialization. FileChooserDialog chooser = new FileChooserDialog("Selecciona un fichero para guardar", (Window)mainComponentBuilderForm["mainView"], FileChooserAction.Save, Stock.Save); chooser.AddButton(Stock.Save, ResponseType.Accept); chooser.AddButton(Stock.Cancel, ResponseType.Cancel); chooser.SelectMultiple = false; ResponseType response = (ResponseType)chooser.Run(); if (response.Equals(ResponseType.Accept)) { if (chooser.Filename.Length != 0) { DefaultContainer.Instance.Execute("ComponentBuilder", "SerializeProject", new object[] { (ProjectDTO)this.GetDataForm(), chooser.Filename }, this); } } chooser.Destroy(); chooser = null; }
//TODO:Pre Branches Evaluate public Guid?Evaluate(ObsValue other, ObsValue current) { if (ResponseType.Equals("=")) { object responseObject = Response; if (current.Type == typeof(Guid?)) { responseObject = new Guid(Response); } if (current.Type == typeof(decimal?)) { responseObject = Convert.ToDecimal(Response); } if (current.Type == typeof(DateTime?)) { responseObject = Convert.ToDateTime(Response); } return(responseObject.Equals(current.Value) ? GotoQuestionId : null); } return(null); }
public SetResponse Evaluate(ObsValue current) { if (ResponseType.Equals("=")) { object responseObject = Response; if (current.Type == typeof(Guid?)) { responseObject = new Guid(Response); } if (current.Type == typeof(decimal?)) { responseObject = Convert.ToDecimal(Response); } if (current.Type == typeof(DateTime?)) { responseObject = Convert.ToDateTime(Response); } return(responseObject.Equals(current.Value) ? new SetResponse(RefQuestionId, ActionId, Content, Rank, ConditionId, ResponseComplex) : null); } return(null); }
/// <summary> /// Determines whether the specified Object is equal to the current Object. /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj == null) { return(false); } if (Object.ReferenceEquals(this, obj)) { return(true); } if (this.GetType() != obj.GetType()) { return(false); } var other = (VLResponse)obj; //reference types if (!Object.Equals(RecipientIP, other.RecipientIP)) { return(false); } //value types if (!m_responseId.Equals(other.m_responseId)) { return(false); } if (!m_survey.Equals(other.m_survey)) { return(false); } if (!m_collector.Equals(other.m_collector)) { return(false); } if (!m_responseType.Equals(other.m_responseType)) { return(false); } if (!m_recipient.Equals(other.m_recipient)) { return(false); } if (!m_userAgent.Equals(other.m_userAgent)) { return(false); } if (!m_openDate.Equals(other.m_openDate)) { return(false); } if (!m_closeDate.Equals(other.m_closeDate)) { return(false); } if (!m_attributeFlags.Equals(other.m_attributeFlags)) { return(false); } if (!m_mustBeCharged.Equals(other.m_mustBeCharged)) { return(false); } if (!m_creditType.Equals(other.m_creditType)) { return(false); } if (!m_collectorPayment.Equals(other.m_collectorPayment)) { return(false); } if (!m_isCharged.Equals(other.m_isCharged)) { return(false); } return(true); }