private void TargetOnMyPropertyChanged(object sender, SpecialEventArgs eventArgs)
    {
        var target = Target as Thing;

        if (target == null)
        {
            return;
        }
        var value = target.GetMyProperty();

        FireValueChanged(value);
    }
Exemplo n.º 2
0
        /// <summary>
        /// Called when Summary is ready for writing to file. This method will add an additional
        /// column to the "Reaches - Result summary" table, with the length of the reach/link/branch.
        /// </summary>
        private void AddReachLengthColumnToSummary(object sender, SpecialEventArgs e)
        {
            // Check if this is the right event
            HTMLSummary summary = sender as HTMLSummary;

            if (summary != null && e.Name == "SummaryReady")
            {
                // Find table
                IHTMLSectionItem            htmlItem       = summary.Sections.FindItem("Reaches - Result summary");
                HTMLTableItem <EngineReach> reachTableItem = htmlItem as HTMLTableItem <EngineReach>;
                if (reachTableItem != null)
                {
                    // Add column to the table, also add accumulation (total length of all reaches)
                    reachTableItem.Columns.Add(new HTMLTableColumnValueGetter <EngineReach>("Length", reach => reach.LocationSpan.Length())
                    {
                        Accumulate = true
                    });
                }
            }
        }