The Mindjet Labs

Hands-on MindManager
Welcome to The Mindjet Labs Sign in | Join | Help
in Search

adding custom properties to a topic

Last post 04-07-2007, 4:35 PM by dethomas. 1 replies.
Sort Posts: Previous Next
  •  03-05-2007, 3:27 PM 905

    adding custom properties to a topic

    I am using C# and MM 6 

    I am trying to programatically add custom properties to a topic.

    //register the new bus type.
    MM.IBusinessType aBusType = applicationObject.BusinessTypeRegistry.RegisterBusinessType("http://ebr.com/siptype/2007", "");                aBusType.DataContainerType = MM.MmDataContainerType.mmDataContainerTypeCustomProperties;

    //associate the central topic with the new bus type 

    MM.Topic centralTopic =  applicationObject.ActiveDocument.CentralTopic;
    MM.BusinessTopic btopic = centralTopic.BusinessTopic;
    btopic.BusinessTypeUri = "http://ebr.com/siptype/2007";               

    //get the data container from the topic                          
    MM.CustomProperties box = centralTopic.DataContainer.CustomProperties;

    //I initially tried this approach which I found on your website but I keep getting an illegal argument exception
    //box.SetCustomPropertyValue("firstname", "Bernie");
    //box.SetCustomPropertyValue("http://ebr.com/of/string/lname", "Smith");
    //so i tried this below
    //get the custom property collection from the container
    MM.CustomPropertyCollection props = box.CustomPropertyCollection;
    //add a new custom property
    MM.CustomProperty testProp = props.AddCustomProperty("http://ebr.com/cp", "firstname", MM.MmCustomPropertyFormatType.mmCustomPropertyFormatTypeText);
    testProp.Basic = true;
    testProp.Value = "Bernie";
    //but i continue to get errors.
     

  •  04-07-2007, 4:35 PM 1068 in reply to 905

    Re: adding custom properties to a topic

    Pardon the stupid question, but did you ever get this to work?
View as RSS news feed in XML