当前位置: 首页>>代码示例>>C#>>正文


C# ICodeBlock.InsertBlock方法代码示例

本文整理汇总了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;
        }
开发者ID:GorillaOne,项目名称:FlatRedBall,代码行数:34,代码来源:CodeWriter.cs

示例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;
        }
开发者ID:gitter-badger,项目名称:FlatRedBall,代码行数:10,代码来源:ReferencedFileSaveCodeGenerator.cs

示例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;
        }
开发者ID:gitter-badger,项目名称:FlatRedBall,代码行数:9,代码来源:ReferencedFileSaveCodeGenerator.cs

示例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);
            }
        }
开发者ID:vchelaru,项目名称:FlatRedBall,代码行数:33,代码来源:NamedObjectSaveCodeGenerator.cs


注:本文中的ICodeBlock.InsertBlock方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。