This is a very short post in how to use the methods of an AutoUpdater. Implement IMMSpecialAUStrategyEx if you wish to set any AU on editing event, importantly a feature.
namespace AutoUpdaterTest
{
[Guid("749cbcee-89c7-48a1-a39c-90d16w99ye18")]
public class NewAU : IMMSpecialAUStrategyEx
{
#region Com Registration
[ComRegisterFunction()]
static public void Reg(string regKey)
{
SpecialAutoUpdateStrategy.Register(regKey);
}
[ComUnregisterFunction()]
static public void Unreg(string regKey)
{
SpecialAutoUpdateStrategy.Unregister(regKey);
}
#endregion
#region IMMSpecialAUStrategyEx Members
void IMMSpecialAUStrategyEx.Execute(ESRI.ArcGIS.Geodatabase.IObject pObject, mmAutoUpdaterMode eAUMode, mmEditEvent eEvent)
{
//eAUMODE defines the mode of the AU, which you can enable and disable an AU at runtime
//eEvent defines or says which edit event really has happened in runtime. Feature Creation, Feature deletion or updation( refer ArcFM Snippet #4)
}
string IMMSpecialAUStrategyEx.Name
{
// AU Name
get { return "My Own Au"; }
}
// Here really you say whether you like to enable or disable your AU, if required you can check some prerequisite for your AU to get executed. If returned FALSE, the AU will not execute.
bool IMMSpecialAUStrategyEx.get_Enabled(ESRI.ArcGIS.Geodatabase.IObjectClass pObjectClass, mmEditEvent eEvent)
{
return true;
}
#endregion
}
}
Later in following posts will write about the other two types of AUs( Attribute and Relationship)
Happy coding
Rajesh K
namespace AutoUpdaterTest
{
[Guid("749cbcee-89c7-48a1-a39c-90d16w99ye18")]
public class NewAU : IMMSpecialAUStrategyEx
{
#region Com Registration
[ComRegisterFunction()]
static public void Reg(string regKey)
{
SpecialAutoUpdateStrategy.Register(regKey);
}
[ComUnregisterFunction()]
static public void Unreg(string regKey)
{
SpecialAutoUpdateStrategy.Unregister(regKey);
}
#endregion
#region IMMSpecialAUStrategyEx Members
void IMMSpecialAUStrategyEx.Execute(ESRI.ArcGIS.Geodatabase.IObject pObject, mmAutoUpdaterMode eAUMode, mmEditEvent eEvent)
{
//eAUMODE defines the mode of the AU, which you can enable and disable an AU at runtime
//eEvent defines or says which edit event really has happened in runtime. Feature Creation, Feature deletion or updation( refer ArcFM Snippet #4)
}
string IMMSpecialAUStrategyEx.Name
{
// AU Name
get { return "My Own Au"; }
}
// Here really you say whether you like to enable or disable your AU, if required you can check some prerequisite for your AU to get executed. If returned FALSE, the AU will not execute.
bool IMMSpecialAUStrategyEx.get_Enabled(ESRI.ArcGIS.Geodatabase.IObjectClass pObjectClass, mmEditEvent eEvent)
{
return true;
}
#endregion
}
}
Later in following posts will write about the other two types of AUs( Attribute and Relationship)
Happy coding
Rajesh K
No comments:
Post a Comment