本文整理汇总了C#中ICodeBlock.InsertBlock方法的典型用法代码示例。如果您正苦于以下问题:C# ICodeBlock.InsertBlock方法的具体用法?C# ICodeBlock.InsertBlock怎么用?C# ICodeBlock.InsertBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICodeBlock
的用法示例。
在下文中一共展示了ICodeBlock.InsertBlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateAfterActivity
public static ICodeBlock GenerateAfterActivity(ICodeBlock codeBlock, IElement saveObject)
{
#region Loop through all ReferenceFiles to get their post custom activity code
for (int i = 0; i < saveObject.ReferencedFiles.Count; i++)
{
codeBlock.InsertBlock(ReferencedFileSaveCodeGenerator.GetPostCustomActivityForReferencedFile(saveObject.ReferencedFiles[i]));
}
#endregion
#region Loop through all NamedObjectSaves to get their post custom activity code
for (int i = 0; i < saveObject.NamedObjects.Count; i++)
{
NamedObjectSaveCodeGenerator.GetPostCustomActivityForNamedObjectSave(saveObject, saveObject.NamedObjects[i], codeBlock);
}
#endregion
foreach (PluginManager pluginManager in PluginManager.GetInstances())
{
CodeGeneratorPluginMethods.GenerateActivityPluginCode(CodeLocation.AfterStandardGenerated,
pluginManager, codeBlock, saveObject);
}
return codeBlock;
}
示例2: GenerateDestroy
public override ICodeBlock GenerateDestroy(ICodeBlock codeBlock, SaveClasses.IElement element)
{
for (int i = 0; i < element.ReferencedFiles.Count; i++)
{
codeBlock.InsertBlock(GetDestroyForReferencedFile(element, element.ReferencedFiles[i]));
}
codeBlock._();
return codeBlock;
}
示例3: GenerateActivity
public override ICodeBlock GenerateActivity(ICodeBlock codeBlock, SaveClasses.IElement element)
{
for (int i = 0; i < element.ReferencedFiles.Count; i++)
{
codeBlock.InsertBlock(GetActivityForReferencedFile(element.ReferencedFiles[i], element));
}
return codeBlock;
}
示例4: WriteConvertToManuallyUpdatedForListNos
private static void WriteConvertToManuallyUpdatedForListNos(ICodeBlock codeBlock, NamedObjectSave nos)
{
// See if the source type is an Entity
EntitySave entitySave = ObjectFinder.Self.GetEntitySave(nos.SourceClassGenericType);
bool add = false;
ICodeBlock forBlock = new CodeBlockFor(null,
"int i = 0; i < " + nos.InstanceName + ".Count; i++");
if (entitySave != null)
{
forBlock.Line(nos.InstanceName + "[i].ConvertToManuallyUpdated();");
add = true;
}
else
{
// See if this type has a built-in way to make it manually updated
AssetTypeInfo ati = AvailableAssetTypes.Self.GetAssetTypeFromRuntimeType(nos.SourceClassGenericType);
if (ati != null && !string.IsNullOrEmpty(ati.MakeManuallyUpdatedMethod))
{
forBlock.Line(ati.MakeManuallyUpdatedMethod.Replace("this", nos.InstanceName + "[i]") +
";");
add = true;
}
}
if (add)
{
codeBlock.InsertBlock(forBlock);
}
}