private static ObjectCreationContext CreateContext <TSyntaxNodeType>(string testInput, AnalyzerLanguage language) where TSyntaxNodeType : SyntaxNode
        {
            var testCode = new SnippetCompiler(testInput, true, language);
            var node     = testCode.GetNodes <TSyntaxNodeType>().First();
            var context  = new ObjectCreationContext(testCode.CreateAnalysisContext(node));

            return(context);
        }
Пример #2
0
        private static ObjectCreationContext CreateContext <TSyntaxNodeType>(string testInput, AnalyzerLanguage language) where TSyntaxNodeType : SyntaxNode
        {
            var testCode = new SnippetCompiler(testInput, false, language);
            var objectCreationSyntaxNode = testCode.GetNodes <TSyntaxNodeType>().First();
            var context = new ObjectCreationContext(objectCreationSyntaxNode, testCode.SemanticModel);

            return(context);
        }
Пример #3
0
    protected ObjectBase CreateObject(int templateId, int idForGenerateName, bool clientNotServer, int createionMethod = ObjectCreationContext.CreationMethodType.OBJECT_CREATION_METHOD)
    {
        ObjectCreationContext context = new ObjectCreationContext();

        context.templateId      = templateId;
        context.clientNotServer = clientNotServer;
        context.CreationMethod  = createionMethod;
        context.NetworkID       = idForGenerateName;

        return(InstanceBase.GetCurrentInstance().GetObjectManager().CreateObject(context));
    }
Пример #4
0
        public override bool ObjectCreation(ObjectCreationContext context)
        {
            if (!base.ObjectCreation(context))
            {
                return(false);
            }

            if (!settings.Creation(context))
            {
                return(false);
            }

            return(true);
        }
Пример #5
0
        public override bool ObjectCreation(ObjectCreationContext context)
        {
            if (!base.ObjectCreation(context))
            {
                return(false);
            }

            try
            {
                File.WriteAllText(context.fileCreationRealFileName, "");
            }
            catch (Exception e)
            {
                Log.Warning(e.Message);
                return(false);
            }

            return(true);
        }
        public override bool ObjectCreation(ObjectCreationContext context)
        {
            if (!base.ObjectCreation(context))
            {
                return(false);
            }

            //!!!!

            //try
            //{
            //	File.WriteAllText( context.fileCreationRealFileName, "" );
            //}
            //catch( Exception e )
            //{
            //	Log.Warning( e.Message );
            //	return false;
            //}

            return(true);
        }
Пример #7
0
        public override bool ObjectCreation(ObjectCreationContext context)
        {
            if (!base.ObjectCreation(context))
            {
                return(false);
            }

            var sourceFileName = VirtualPathUtility.GetRealPathByVirtual(@"Base\Tools\NewResourceTemplates\FlowGraphLibrary.component");

            try
            {
                File.Copy(sourceFileName, context.fileCreationRealFileName);
            }
            catch (Exception e)
            {
                Log.Warning(e.Message);
                return(false);
            }

            return(true);
        }
 protected abstract TExpressionSyntax GetArgumentAtIndex(ObjectCreationContext context, int index);
Пример #9
0
 protected abstract TExpressionSyntax GetFirstArgument(ObjectCreationContext context);
Пример #10
0
 protected override string GetStringLiteralAtIndex(ObjectCreationContext context, int index) =>
 context.Expression is ObjectCreationExpressionSyntax objectCreation
Пример #11
0
 protected abstract string GetStringLiteralAtIndex(ObjectCreationContext context, int index);
Пример #12
0
 public virtual bool ObjectCreation(ObjectCreationContext context)
 //public virtual bool ObjectCreation( object newObject, string fileCreationRealFileName, ref bool disableFileWriting )
 {
     return(true);
 }
Пример #13
0
 internal abstract object ConstArgumentForParameter(ObjectCreationContext context, string parameterName);