I need a visual studio which is created for standard variable naming.
For Ex:- for String variable it should start with str_Variable name
for int variable it should start with int_Variable name
for Dictionary variable it should start with Dic_Variable name
for boolean variable it should start with bool_Variable name
for Datatable variable it should start with DT_Variable name
for Date variable it should start with Date_Variable name
I need to write a code for workflow analyzer in the visual studio for the above variable names.
Bot should through an error if the user is creating a variable other than the above variable format.
In the Inspect() function, you will need something like this to check the variable name:
foreach (var activityModelVariable in activityModel.Variables)
{
var type = activityModelVariable.Type.Split(',')[0];
if (type.Equals("System.String"))
{
if (!activityModelVariable.DisplayName.StartsWith("str_"))
messageList.Add($"The variable {activityModelVariable.DisplayName} is of type String should start med str_");
}
else if (type.Equals("System.Boolean"))
{
if (!activityModelVariable.DisplayName.StartsWith("bool_"))
messageList.Add($"The variable {activityModelVariable.DisplayName} is of type Boolean should start med bool_");
}
}