I'm using arcobjects (C#) to load my layers to the table of contents, and I need to update the data source to change the version.
The layer file is set to the correct source at the DEFAULT version. When a 'user' opens the MXD, i need to update the version just before it loads.
I'm not sure where to start with this. Here is the loading code:
var groupL = new GroupLayer();
groupL.Name = ALayerName;
var fileEntries = Directory.GetFiles(alayerDir, FileFilter).ToList();
fileEntries.ForEach(delegate(string path)
{
var layer = ActiveView.OpenLyrFromFile(path);
groupL.Add(layer);
});
return groupL;
So what to i need to cast 'layer' to in order to give the new version name and then restart the connection?