public void SetShapeProperties(int DeviceNumber, string VersionInfo) { if (Visio_shape != null) { bool set_size = true; short text_size = 0; int shape_width = 0; int shape_height = 0; #region Calculate font size if (DeviceNumber <= 2) { text_size = 10; shape_width = 1; shape_height = 1; } else { set_size = false; text_size = 8; } #endregion #region Set shape text Visio_shape.Text = Label; Visio.IVCharacters shapeText; shapeText = Visio_shape.Characters; shapeText.set_CharProps((short)VisCellIndices.visCharacterSize, text_size); #endregion //Set the device text to Red if it is Inlist //if (inlist == "inlist") shapeText.set_CharProps((short)VisCellIndices.visCharacterColor, 2); #region Set shape width if (set_size) { Visio_shape.get_CellsSRC( (short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowXFormIn, (short)VisCellIndices.visXFormWidth).ResultIU = shape_width; //shape Width Visio_shape.get_CellsSRC( (short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowXFormIn, (short)VisCellIndices.visXFormHeight).ResultIU = shape_height; //shape Height } #endregion #region Set the ScreenTip text string ToolTipText = string.Format("{0} ({1})\r\n{2}\r\n{3}", Platform, SystemSerial, IOSVersion(), "" /*L3InterfaceInformation*/).Replace("\"", ""); Visio_shape.get_CellsSRC((short)VisSectionIndices.visSectionObject, (short)VisRowIndices.visRowMisc, (short)VisCellIndices.visComment).FormulaU = string.Format("\"{0}\"", ToolTipText); #endregion } }
public void LinkShapeToData(int datarowSetID, int datarowID) { Visio_shape?.LinkToData(datarowSetID, datarowID, false); }