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); }
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); }
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)); }
public override bool ObjectCreation(ObjectCreationContext context) { if (!base.ObjectCreation(context)) { return(false); } if (!settings.Creation(context)) { 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); }
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); } 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);
protected abstract TExpressionSyntax GetFirstArgument(ObjectCreationContext context);
protected override string GetStringLiteralAtIndex(ObjectCreationContext context, int index) => context.Expression is ObjectCreationExpressionSyntax objectCreation
protected abstract string GetStringLiteralAtIndex(ObjectCreationContext context, int index);
public virtual bool ObjectCreation(ObjectCreationContext context) //public virtual bool ObjectCreation( object newObject, string fileCreationRealFileName, ref bool disableFileWriting ) { return(true); }
internal abstract object ConstArgumentForParameter(ObjectCreationContext context, string parameterName);