本文整理汇总了C#中Microsoft.Office.Interop.Visio.AddNamedRow方法的典型用法代码示例。如果您正苦于以下问题:C# Microsoft.Office.Interop.Visio.AddNamedRow方法的具体用法?C# Microsoft.Office.Interop.Visio.AddNamedRow怎么用?C# Microsoft.Office.Interop.Visio.AddNamedRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.Office.Interop.Visio
的用法示例。
在下文中一共展示了Microsoft.Office.Interop.Visio.AddNamedRow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Set
public static void Set(IVisio.Shape shape, string name, ShapeSheet.FormulaLiteral value, ShapeSheet.FormulaLiteral prompt)
{
if (shape == null)
{
throw new System.ArgumentNullException(nameof(shape));
}
UserDefinedCellsHelper.CheckValidName(name);
if (UserDefinedCellsHelper.Contains(shape, name))
{
string full_prop_name = UserDefinedCellsHelper.GetRowName(name);
if (value.HasValue)
{
string value_cell_name = full_prop_name;
var cell = shape.CellsU[value_cell_name];
cell.FormulaU = value.Encode();
}
if (prompt.HasValue)
{
string prompt_cell_name = full_prop_name+".Prompt";
var cell = shape.CellsU[prompt_cell_name];
cell.FormulaU = prompt.Encode();
}
return;
}
short row = shape.AddNamedRow(
UserDefinedCellsHelper._userdefinedcell_section,
name,
(short)IVisio.VisRowIndices.visRowUser);
var update = new ShapeSheet.Update();
if (value.HasValue)
{
var src = new ShapeSheet.SRC(UserDefinedCellsHelper._userdefinedcell_section, row, (short)IVisio.VisCellIndices.visUserValue);
update.SetFormula(src, value.Encode());
}
if (prompt.HasValue)
{
var src = new ShapeSheet.SRC(UserDefinedCellsHelper._userdefinedcell_section, row, (short)IVisio.VisCellIndices.visUserPrompt);
update.SetFormula(src, prompt.Encode());
}
update.Execute(shape);
}
示例2: Set
public static void Set(
IVisio.Shape shape,
string name,
CustomPropertyCells cp)
{
if (shape == null)
{
throw new ArgumentNullException(nameof(shape));
}
CustomPropertyHelper.CheckValidCustomPropertyName(name);
if (CustomPropertyHelper.Contains(shape, name))
{
string full_prop_name = CustomPropertyHelper.GetRowName(name);
var cell_propname = shape.CellsU[full_prop_name];
if (cell_propname == null)
{
string msg = $"Could not retrieve cell for custom property \"{full_prop_name}\"";
throw new AutomationException(msg);
}
var update = new ShapeSheet.Update();
update.SetFormulas(cp, cell_propname.Row);
update.Execute(shape);
return;
}
short row = shape.AddNamedRow(
(short)IVisio.VisSectionIndices.visSectionProp,
name,
(short)IVisio.VisRowIndices.visRowProp);
CustomPropertyHelper.Set(shape, row, cp);
}
示例3: Set
public static void Set(IVisio.Shape shape, string name, string value, string prompt)
{
if (shape == null)
{
throw new System.ArgumentNullException("shape");
}
CheckValidName(name);
if (Contains(shape, name))
{
string full_prop_name = GetRowName(name);
if (value != null)
{
string value_cell_name = full_prop_name;
var cell = shape.CellsU[value_cell_name];
string value_formula = Convert.StringToFormulaString(value);
cell.FormulaU = value_formula;
}
if (prompt != null)
{
string prompt_cell_name = full_prop_name+".Prompt";
var cell = shape.CellsU[prompt_cell_name];
var prompt_formula = Convert.StringToFormulaString(prompt);
cell.FormulaU = prompt_formula;
}
return;
}
short row = shape.AddNamedRow(
_userdefinedcell_section,
name,
(short)IVisio.VisRowIndices.visRowUser);
var update = new VA.ShapeSheet.Update();
if (value != null)
{
string value_formula = Convert.StringToFormulaString(value);
var src = new VA.ShapeSheet.SRC(_userdefinedcell_section, row, (short)IVisio.VisCellIndices.visUserValue);
update.SetFormula(src, value_formula);
}
if (prompt != null)
{
string prompt_formula = Convert.StringToFormulaString(prompt);
var src = new VA.ShapeSheet.SRC(_userdefinedcell_section, row, (short)IVisio.VisCellIndices.visUserPrompt);
update.SetFormula(src, prompt_formula);
}
update.Execute(shape);
}