Example #1
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            IGH_Goo Element = null;
            IGH_Goo Gx      = null;
            IGH_Goo Fx      = null;

            if (!DA.GetData(0, ref Element))
            {
                return;
            }
            if (!DA.GetData(1, ref Gx))
            {
                return;
            }
            if (!DA.GetData(2, ref Fx))
            {
                return;
            }

            wObject W;

            Element.CastTo(out W);

            wLabel CustomToolTip = new wLabel();

            wGraphic G = CustomToolTip.Graphics;
            wFont    F = CustomToolTip.Font;

            Gx.CastTo(out G);
            Fx.CastTo(out F);

            CustomToolTip.Graphics = G;
            CustomToolTip.Font     = F;

            switch (W.Type)
            {
            case "Pollen":

                switch (W.SubType)
                {
                case "DataPoint":
                    DataPt Pt = (DataPt)W.Element;

                    Pt.ToolTip.Enabled             = true;
                    Pt.ToolTip.Graphics            = G;
                    Pt.ToolTip.Font                = F;
                    Pt.ToolTip.Graphics.FontObject = F;

                    W.Element = Pt;
                    break;

                case "DataSet":
                    DataSetCollection St = (DataSetCollection)W.Element;
                    St.SetUniformTooltips(CustomToolTip);

                    St.ToolTip.Enabled             = true;
                    St.ToolTip.Graphics            = G;
                    St.ToolTip.Font                = F;
                    St.ToolTip.Graphics.FontObject = F;

                    W.Element = St;
                    break;
                }
                break;
            }

            DA.SetData(0, W);
            DA.SetData(1, CustomToolTip);
        }