예제 #1
0
 /// <summary>
 /// 【7】将文件复制到指定路径(硬盘)——导出
 /// </summary>
 /// <param name="PathInVault">库文件夹根目录下相对路径</param>
 /// <param name="PathOutVault">本地具体路径</param>
 public static void CheckoutAndCopy(string PathInVault, string PathOutVault)
 {
     try
     {
         EdmVault5 vault = new EdmVault5();
         vault.Login(LogName, PWD, VaultName);
         IEdmFile5   file   = default(IEdmFile5);
         IEdmFolder5 folder = null;
         file = vault.GetFileFromPath(vault.RootFolderPath + PathInVault, out folder);//读取指定文件的位置,PathInVault库文件夹根目录下相对路径
         file.LockFile(folder.ID, new System.Windows.Forms.Control().Handle.ToInt32());
         file.UndoLockFile(new System.Windows.Forms.Control().Handle.ToInt32(), true);
         //Copy the file
         IEdmEnumeratorVersion5 verEnum = default(IEdmEnumeratorVersion5);
         verEnum = (IEdmEnumeratorVersion5)file;
         int Version = 0;
         Version = file.GetLocalVersionNo(folder.ID);
         IEdmVersion5 ver = default(IEdmVersion5);
         ver = verEnum.GetVersion(Version);
         ver.GetFileCopy(new System.Windows.Forms.Control().Handle.ToInt32(), PathOutVault);//PathOutVault本地具体路径
     }
     catch (System.Runtime.InteropServices.COMException ex)
     {
         if (ex.ErrorCode.ToString() == "-2147220949")
         {
             MessageBox.Show("The selected file is not located in a file vault.");
         }
         else
         {
             MessageBox.Show("HRESULT = 0x" + ex.ErrorCode.ToString("X") + " " + ex.Message);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #2
0
        public bool HaveUpToDateItemRef(EdmCmdData file,IEdmFile5 Part, IEdmVault7 vault)
        {
            bool retval = false;

            long Local = Part.GetLocalVersionNo(file.mlObjectID3);

            int Server = Part.CurrentVersion;

            if (Local == Server)
                retval = true;

            return retval;
        }
예제 #3
0
        public bool HaveUpToDateItemRef(IEdmFile5 Part, IEdmVault7 vault)
        {
            bool retval = false;

            long Local = Part.GetLocalVersionNo(Part.GetLocalPath(0));

            int Server = Part.CurrentVersion;

            if (Local == Server)
                retval = true;

            return retval;
        }