void win_OnGoClick(string id) { OpenDMS.Storage.Providers.EngineRequest request = new OpenDMS.Storage.Providers.EngineRequest(); request.Engine = _engine; request.Database = _db; request.OnActionChanged += new EngineBase.ActionDelegate(EngineAction); request.OnProgress += new EngineBase.ProgressDelegate(Progress); request.OnComplete += new EngineBase.CompletionDelegate(Complete); request.OnTimeout += new EngineBase.TimeoutDelegate(Timeout); request.OnError += new EngineBase.ErrorDelegate(Error); request.AuthToken = _window.Session.AuthToken; request.RequestingPartyType = OpenDMS.Storage.Security.RequestingPartyType.User; Clear(); System.IO.FileStream fs = new System.IO.FileStream("testdoc.txt", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.None, 8192, System.IO.FileOptions.None); byte[] bytes = System.Text.Encoding.ASCII.GetBytes("This is a test content file."); fs.Write(bytes, 0, bytes.Length); fs.Flush(); fs.Close(); fs.Dispose(); fs = new System.IO.FileStream("testdoc.txt", System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.None, 8192, System.IO.FileOptions.None); System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); byte[] data = md5.ComputeHash(fs); string output = ""; fs.Close(); md5.Dispose(); fs.Dispose(); for (int i = 0; i < data.Length; i++) output += data[i].ToString("x2"); OpenDMS.Storage.Providers.CreateVersionArgs versionArgs = new CreateVersionArgs() { VersionId = new VersionId(new ResourceId(id)), Extension = "txt", Metadata = new Metadata(), Content = new OpenDMS.Storage.Data.Content(bytes.Length, new OpenDMS.Storage.Data.ContentType("text/plain"), "testdoc.txt"), Md5 = output }; WriteLine("Starting CreateNewVersion test..."); _start = DateTime.Now; _engine.CreateNewVersion(request, versionArgs); }
public virtual void CreateNewVersion(EngineRequest request, CreateVersionArgs args) { throw new NotImplementedException(); }