public async Task <string> PreviewFile([FromBody] SearchData data)
        {
            var    baseURI      = $"{Configuration["DvelopInfos:BaseURL"]}";
            var    apiKey       = $"{Configuration["DvelopInfos:API_Key"]}";
            var    repoId       = $"{Configuration["DvelopInfos:repoId"]}";
            string filePathRoot = $"{_env.WebRootPath}\\Data\\D3_Previews\\";

            var sessionId = new DvelopAccessHandler().Authenticate(baseURI, apiKey);

            if (sessionId != null)
            {
                string           downloadFile = "";
                DocumentHandlers docHandler   = new DocumentHandlers();

                string getDocumentInfo = await docHandler.GetDocumentInfo(baseURI, sessionId, repoId, data.query);

                if (getDocumentInfo != "")
                {
                    downloadFile = await docHandler.DownloadDocument(baseURI, sessionId, repoId, getDocumentInfo, filePathRoot); //data.query

                    //DeleteDocumentInTimer(filePathRoot);
                }

                return(downloadFile);
            }

            return(String.Empty);
        }
示例#2
0
        void IExtensionApplication.Initialize()
        {
            // Add one time initialization here
            // One common scenario is to setup a callback function here that
            // unmanaged code can call.
            // To do this:
            // 1. Export a function from unmanaged code that takes a function
            //    pointer and stores the passed in value in a global variable.
            // 2. Call this exported function in this function passing delegate.
            // 3. When unmanaged code needs the services of this managed module
            //    you simply call acrxLoadApp() and by the time acrxLoadApp
            //    returns  global function pointer is initialized to point to
            //    the C# delegate.
            // For more info see:
            // http://msdn2.microsoft.com/en-US/library/5zwkzwf4(VS.80).aspx
            // http://msdn2.microsoft.com/en-us/library/44ey4b32(VS.80).aspx
            // http://msdn2.microsoft.com/en-US/library/7esfatk4.aspx
            // as well as some of the existing AutoCAD managed apps.

            ShowSplash();

            // Initialize your plug-in application here
            var actDia = new ActivationGui();

            actDia.Dispose();

            Application.DisplayingOptionDialog += Application_DisplayingOptionDialog;
            DocumentHandlers.AddDocEvents();
        }
示例#3
0
 void IExtensionApplication.Terminate()
 {
     if (Activated)
     {
         Application.DisplayingOptionDialog -= Application_DisplayingOptionDialog;
         DocumentHandlers.RemoveDocEvents();
     }
 }