You are referencing the Value property on the object that GetGlobalDataItem is returning. Just assign a value to that property instead of reading from it.
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
using Neo.ApplicationFramework.Tools.OpcClient;
using System.Reflection;
public partial class WellAnalysisParams
{
//This Method allows referencing tags in arrays
private GlobalDataItem GetGlobalDataItem(string propertyName)
{
PropertyInfo tagProperty = typeof(Neo.ApplicationFramework.Generated.Tags).GetProperty(propertyName);
if(tagProperty == null)
return null;
else
return tagProperty.GetValue(Globals.Tags, null) as GlobalDataItem;
}
void CurrentWellNumber_InputValueChanged(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
{
//This Method used to take the well number and save it in the correct
//well analysis data memory section
//Tag name should look like WellXSourceData13 (Wells 1-30)
int wellNumber = Globals.Tags.AnalysisWellSelector.Value.Int;
int newWellNumber = Globals.Tags.AnalysisWellNumber.Value.Int;
GetGlobalDataItem("Well" + wellNumber.ToString() + "SourceData13").Value = newWellNumber;
}
}
}