Пример #1
0
        private void CreateClassSyntax()
        {
            var baseType = SyntaxFactory.IdentifierName("IMyLevelScript");

            if (!(m_objectBuilder is MyObjectBuilder_VisualLevelScript))
            {
                baseType = string.IsNullOrEmpty(m_objectBuilder.Interface) ? null : SyntaxFactory.IdentifierName(m_baseType.Name);
            }

            m_scriptClassDeclaration = MySyntaxFactory.PublicClass(m_scriptName);

            if (baseType != null)
            {
                m_scriptClassDeclaration = m_scriptClassDeclaration
                                           .WithBaseList(
                    SyntaxFactory.BaseList(
                        SyntaxFactory.SingletonSeparatedList <BaseTypeSyntax>(
                            SyntaxFactory.SimpleBaseType(
                                baseType
                                )
                            )
                        )
                    );
            }
        }