We have already seen how to add a store and create an application in AzMan using C#. Now, let's go on to creating an operation using c#. I have uploaded a helper class here which has some comments not included in the short snippets below as well as some other methods. This class was designed to work with XML and AD (sorry not sql server yet).
public static IAzOperation AddOperation(IAzApplication app, string operationName)Now let's delete that operation:
{
if (operationName == null || operationName.Length == 0)
{
throw new ArgumentNullException("operationName", "Operation name can not be null or empty.");
}
if (app == null)
{
throw new ArgumentNullException("app", "Application can not be null.");
}
IAzOperation operation = app.CreateOperation(operationName, null);
operation.Submit(0, null);
return operation;
}
public static void RemoveOperation(IAzApplication app, string operationName)Get operation by name:
{
if (operationName == null || operationName.Length == 0)
{
throw new ArgumentNullException("operationName", "Operation name can not be null or empty.");
}
if (app == null)
{
throw new ArgumentNullException("app", "Application can not be null.");
}
app.DeleteOperation(operationName , null);
app.Submit(0, null);
}
public static IAzOperation GetOperation(IAzApplication app, string operationName)
{
if (operationName == null || operationName.Length == 0)
{
throw new ArgumentNullException("operationName", "Operation name can not be null or empty.");
}
if (app == null)
{
throw new ArgumentNullException("app", "Application can not be null.");
}
return app.OpenOperation(operationName, null);
}
No comments:
Post a Comment