1

I am working on a project that I must limit some functionality of ArcMap based on user permissions.

Is there any way to do that ?

for example I want to disable the Database Connections in Catalog windows by using c# in ArcObjects

  • 2
    I don't believe this is a duplicate question this poster is asking to disable the ability to access database connections, which is probably not possible as it would require overriding the systems GUI, but I could be wrong. – Hornbydd Jul 3 '18 at 15:06
  • If you click on the options button in the Catalog window in ArcMap and go to general tab you can hide database connections, no idea how you access that programatically? – Hornbydd Jul 3 '18 at 15:15
  • I want to do that by using c# in arcobjects.In other word I need to accomplish that issue programmatically . – Bahman Rashidi Jul 3 '18 at 19:11
  • 1
    Not a duplicate. – Kirk Kuykendall Jul 5 '18 at 1:20
1

This works for me. Next time arcmap is started the folder is present.

protected override void OnClick()
{
    try
    {
        var cont = ((IGxApplication)ArcMap.Application).Catalog as IGxObjectContainer;
        IGxObject gxObj;
        IGxObject gxRdf = null;
        var enumGx = cont.Children;
        enumGx.Reset();
        while((gxObj = enumGx.Next())!= null)
        {
            if (gxObj is IGxRemoteDatabaseFolder)
                gxRdf = gxObj;
        }
        if(gxRdf != null)
            cont.DeleteChild(gxRdf);
    }
    catch(Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.