private static void AddProjectionFileIntoProject(ProjectionsProjectNode project, ProjectionConfig config, ProjectionStatistics stats)
{
var name = config.Name;
var query = config.Query;
//create file and node
var projectionNode = (ProjectionFileNode)project.CreateFileNode(name + ".js");
File.WriteAllText(projectionNode.Url, query);
//set node properties
var nodeProps = (ProjectionFileNodeProperties) projectionNode.NodeProperties;
nodeProps.Enabled = stats.IsEnabled;
nodeProps.EmitEnabled = config.IsEmitEnabled;
nodeProps.CheckpointEnabled = "continuous".Equals(stats.Mode, StringComparison.InvariantCultureIgnoreCase);
//finally add the node into the project
project.AddChild(projectionNode);
}