2 Replies Latest reply on May 2, 2016 4:28 AM by Julien Maulbault

    How remove user-defined reference between 2 files by code

    Julien Maulbault

      How can I remove user-defined reference between 2 files by code ?

      I know only how to add one reference, this way.

       

      private void AddReferences(int iFileID, List<string> iReferenceFile)
        {
        var addCustRefs = (IEdmAddCustomRefs2)_Vault2.CreateUtility(EdmUtility.EdmUtil_AddCustomRefs);
        var quantityArray = Enumerable.Repeat(1, iReferenceFile.Count()).ToArray();
        var iReferenceFileArray = iReferenceFile.Select(x => _Vault2.RootFolderPath + "\\" + x).ToArray();

        addCustRefs.AddReferencesPath2(iFileID, ref iReferenceFileArray, ref quantityArray);
        addCustRefs.CreateTree((int)EdmCreateReferenceFlags.Ecrf_Nothing);
        var CreateReferencesResult = addCustRefs.CreateReferences();
        }