refresh Operation List

Jul 28, 2010 at 1:04 PM

Hi.

I have a problem,

I create a form to select multi operation, after selection and click Ok, My Operation Definition and Operaion Authorization doesn't refresh and I should click on Refresh to see the new list. How Can I add multi Items and the list get refresh?

Thank you

Coordinator
Jul 28, 2010 at 1:44 PM

Hi,

We are talking about MMC SnapIn or some custom code ?

Regards,

Andrea.

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

Jul 28, 2010 at 7:36 PM
Edited Jul 28, 2010 at 7:37 PM

Thanks Andrea for your fast reply...

It is about Custom Code, I create a form that open under the Operation Definition and I can choose my operations from TreeView, after clicking OK, In OperationDefinitionsScopeNode.cs how to refresh my Operation Definition and Operation Authorization list to show all the Operations selected?

Regards,

Coordinator
Jul 28, 2010 at 9:31 PM

Try to see if the newOperationDefinitionAction_Triggered method (inside OperationDefinitionsScopeNode.cs) can help you:

void newOperationDefinitionAction_Triggered(object sender, MMC.SyncActionEventArgs e)

        {

            MMC.ScopeNode itemNode = (MMC.ScopeNode)sender;

            frmItemProperties frm = new frmItemProperties();

            frm.application = this.application;

            frm.item = null;

            frm.itemType = ItemType.Operation;

            DialogResult dr = this.SnapIn.Console.ShowDialog(frm);

            if (dr == DialogResult.OK)

            {

                this.Children.Add(new ItemDefinitionScopeNode(frm.item));

                //Add relative child in Item Authorizations if opened

                try

                {

                    if (

                        this.Parent != null

                        &&

                        this.Parent.Parent != null

                        &&

                        this.Parent.Parent.Children.Count >= 3

                        &&

                        this.Parent.Parent.Children[2].Children.Count >= 3

                        )

                    {

                        MMC.ScopeNode itemDefinitionsScopeNode = this.Parent;

                        OperationAuthorizationsScopeNode itemAuthorizationsScopeNode = (itemDefinitionsScopeNode.Parent.Children[2].Children[2]) as OperationAuthorizationsScopeNode;

                        if (itemAuthorizationsScopeNode!=null)

                            itemAuthorizationsScopeNode.Children.Add(new ItemAuthorizationScopeNode(frm.item));

                    }

                }

                catch { }

                /*System.Windows.Forms.Application.DoEvents();*/

            }

        }

Regards,
Andrea.

__________________________________
Andrea Ferendeles
NetSqlAzMan Project Coordinator
E-mail aferende@hotmail.com Web http://netsqlazman.codeplex.com

Jul 31, 2010 at 9:56 AM

I found the answer :)

In the above code we use "frm.item" but i need the list of items.

In my Form i create a "selectedItems" and in "OperationDefinitionsScopeNode.cs" I use it in a foreach loop...

Coordinator
Jul 31, 2010 at 10:05 AM

Great !