示例#1
0
 public DataInterEvent(EventsPick.EventDateSpan span_, bool dateOnly_, object instrument_, DatedDataCollectionGen<double> data_, DataInterEventArgs args_)
 {
   EventSpan = span_;
   Instrument = instrument_;
   RawData = data_;
   Args = args_;
   DateOnly = dateOnly_;
   m_processedData = processToAroundAnchor(RawData);
 }
    public void Create(DataInterEventArgs args_)
    {
      m_args = args_;

      seasEvents.Create(false);
      seasProbability.Create(false);
      seasAverageNormalized.Create(false);

      seasProbability.SetXAxisExtent(5);

      cmbAnchorType.AddItems(typeof(InterEventAnchorType));
      cmbAnchorType.Bind(m_args, "AnalysisAnchorType",
        new Validators.EnumDescValidator(InterEventAnchorType.AdjustedEndPoint));

      cmbDisplayWhat.Items.Add(EnumDescriptionAttribute.GetDescription(DataAroundEventField.Filled_Diff));
      cmbDisplayWhat.Items.Add(EnumDescriptionAttribute.GetDescription(DataAroundEventField.Filled_Level));
      cmbDisplayWhat.Items.Add(EnumDescriptionAttribute.GetDescription(DataAroundEventField.Filled_Pct));
      cmbDisplayWhat.Bind(m_args, "Field", new Validators.EnumDescValidator(DataAroundEventField.Filled_Diff));

      tbStartIndex.Bind(m_args, "AnalysisStartIndex", new Validators.IntValidator());
      tbEndIndex.Bind(m_args, "AnalysisEndIndex", new Validators.IntValidator());
    }
    protected bool canProcessArgs(DataInterEventArgs interEventArgs_)
    {
      if (interEventArgs_ == null || interEventArgs_.Events == null || interEventArgs_.Events.Length == 0)
      {
        displayMessage("No dates selected", "Please select both a start and end event around which to examine the data", MessageBoxIcon.Error);
        return false;
      }

      if(!string.IsNullOrEmpty(interEventArgs_.ErrorMessage))
      {
        displayMessage("Error", interEventArgs_.ErrorMessage, MessageBoxIcon.Error);
        return false;
      }

      return true;
    }