Exemplo n.º 1
0
        /**
         * 
         * @param component
         * @return
         */
        public static bool isExamplesDefinitionsPresent(AsposeComponent component)
        {

            return File.Exists(getLocalRepositoryPath(component) + "/" + "Examples.xml");
            /*
               File file = new File(getLocalRepositoryPath(component) + "/" + "Examples.xml");
               return file.exists();
             * */
        }
        public static string readVersion(AsposeComponent component)
        {
            string localPath = getLibaryDownloadPath() + component.get_name() + ".ver";
            string line = string.Empty;

            try
            {
                return System.IO.File.ReadAllText(localPath);
            }
            catch (Exception) { }
            return line;
        }
        public void storeReleaseNotes(AsposeComponent component)
        {
            string localPath = getLibaryDownloadPath() + component.get_name() + ".htm";

            try
            {
                System.IO.File.WriteAllText(localPath, component.get_changeLog());
            }
            catch (FileNotFoundException e)
            {
            }
            catch (Exception e)
            {
            }
        }
        public static void storeVersion(AsposeComponent component)
        {
            string localPath = getLibaryDownloadPath() + component.get_name() + ".ver";

            try
            {
                System.IO.File.WriteAllText(localPath, component.get_latestVersion());
            }
            catch (FileNotFoundException e)
            {
            }
            catch (Exception e)
            {
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="component"></param>
        /// <returns></returns>
 
        public static string CloneOrCheckOutRepo(AsposeComponent component)
        {
            string repUrl = component.get_remoteExamplesRepository();
            string localFolder = getLocalRepositoryPath(component);
            string error = string.Empty;

            checkAndCreateFolder(getLocalRepositoryPath(component));

            try
            {
                CloneCommand clone = Git.CloneRepository();
                clone.SetURI(repUrl);
                clone.SetDirectory(localFolder);

                Git repo = clone.Call();
                //writer.Close();
                repo.GetRepository().Close();
            }
            catch (Exception ex)
            {

                try
                {
                    var git = Git.Open(localFolder);
                    var repository = git.GetRepository();
                    PullCommand pullCommand = git.Pull();
                    pullCommand.Call();
                    repository.Close();
                }
                catch (Exception ex2)
                {

                    error = ex2.Message;
                }

                error = ex.Message;
            }

            return error;
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="component"></param>
        /// <returns></returns>

        public static string CloneOrCheckOutRepo(AsposeComponent component)
        {
            string repUrl      = component.get_remoteExamplesRepository();
            string localFolder = getLocalRepositoryPath(component);
            string error       = string.Empty;

            checkAndCreateFolder(getLocalRepositoryPath(component));

            try
            {
                CloneCommand clone = Git.CloneRepository();
                clone.SetURI(repUrl);
                clone.SetDirectory(localFolder);

                Git repo = clone.Call();
                //writer.Close();
                repo.GetRepository().Close();
            }
            catch (Exception ex)
            {
                try
                {
                    var         git         = Git.Open(localFolder);
                    var         repository  = git.GetRepository();
                    PullCommand pullCommand = git.Pull();
                    pullCommand.Call();
                    repository.Close();
                }
                catch (Exception ex2)
                {
                    error = ex2.Message;
                }

                error = ex.Message;
            }

            return(error);
        }
Exemplo n.º 7
0
        public AsposeComponents()
        {
            list.Clear();
            AsposeComponent asposeCells = new AsposeComponent();

            asposeCells.set_downloadUrl("");
            asposeCells.set_downloadFileName("aspose-cells.zip");
            asposeCells.set_name(Constants.ASPOSE_CELLS);
            asposeCells.set_remoteExamplesRepository("https://github.com/zaheertariq/Aspose_Cells_NET.git");
            list.Add(Constants.ASPOSE_CELLS, asposeCells);

            AsposeComponent asposeWords = new AsposeComponent();

            asposeWords.set_downloadUrl("");
            asposeWords.set_downloadFileName("aspose-words.zip");
            asposeWords.set_name(Constants.ASPOSE_WORDS);
            asposeWords.set_remoteExamplesRepository("https://github.com/zaheertariq/Aspose_Words_NET.git");
            list.Add(Constants.ASPOSE_WORDS, asposeWords);

            AsposeComponent asposePDF = new AsposeComponent();

            asposePDF.set_downloadUrl("");
            asposePDF.get_downloadFileName();
            asposePDF.set_name(Constants.ASPOSE_PDF);
            asposePDF.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Pdf_NET.git";
            list.Add(Constants.ASPOSE_PDF, asposePDF);

            AsposeComponent asposeSlides = new AsposeComponent();

            asposeSlides.set_downloadUrl("");
            asposeSlides.get_downloadFileName();
            asposeSlides.set_name(Constants.ASPOSE_SLIDES);
            asposeSlides.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Slides_NET.git";
            list.Add(Constants.ASPOSE_SLIDES, asposeSlides);

            AsposeComponent asposeDiagram = new AsposeComponent();

            asposeDiagram.set_downloadUrl("");
            asposeDiagram.get_downloadFileName();
            asposeDiagram.set_name(Constants.ASPOSE_DIAGRAM);
            asposeDiagram.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Diagram_NET.git";
            list.Add(Constants.ASPOSE_DIAGRAM, asposeDiagram);

            AsposeComponent asposeBarcode = new AsposeComponent();

            asposeBarcode.set_downloadUrl("");
            asposeBarcode.get_downloadFileName();
            asposeBarcode.set_name(Constants.ASPOSE_BARCODE);
            asposeBarcode.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_BarCode_NET.git";
            list.Add(Constants.ASPOSE_BARCODE, asposeBarcode);

            AsposeComponent asposeTasks = new AsposeComponent();

            asposeTasks.set_downloadUrl("");
            asposeTasks.get_downloadFileName();
            asposeTasks.set_name(Constants.ASPOSE_TASKS);
            asposeTasks.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Tasks_NET.git";
            list.Add(Constants.ASPOSE_TASKS, asposeTasks);

            AsposeComponent asposeEmail = new AsposeComponent();

            asposeEmail.set_downloadUrl("");
            asposeEmail.get_downloadFileName();
            asposeEmail.set_name(Constants.ASPOSE_EMAIL);
            asposeEmail.set_remoteExamplesRepository("https://github.com/zaheertariq/Aspose_Email_NET.git");
            list.Add(Constants.ASPOSE_EMAIL, asposeEmail);

            AsposeComponent asposeOCR = new AsposeComponent();

            asposeOCR.set_downloadUrl("");
            asposeOCR.get_downloadFileName();
            asposeOCR.set_name(Constants.ASPOSE_OCR);
            asposeOCR.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_OCR_NET.git";
            list.Add(Constants.ASPOSE_OCR, asposeOCR);

            AsposeComponent asposeImaging = new AsposeComponent();

            asposeImaging.set_downloadUrl("");
            asposeImaging.set_downloadFileName("aspose.imaging.zip");
            asposeImaging.set_name(Constants.ASPOSE_IMAGING);
            asposeImaging.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Imaging_NET.git";
            list.Add(Constants.ASPOSE_IMAGING, asposeImaging);

            AsposeComponent asposeNote = new AsposeComponent();

            asposeNote.set_downloadUrl("");
            asposeNote.set_downloadFileName("aspose.note.zip");
            asposeNote.set_name(Constants.ASPOSE_NOTE);
            asposeNote.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Note_NET.git";
            list.Add(Constants.ASPOSE_NOTE, asposeNote);

            AsposeComponent aspose3D = new AsposeComponent();

            aspose3D.set_downloadUrl("");
            aspose3D.set_downloadFileName("aspose.3d.zip");
            aspose3D.set_name(Constants.ASPOSE_3D);
            aspose3D.RemoteExamplesRepository = "https://github.com/aspose3d/Aspose_3D_NET.git";
            list.Add(Constants.ASPOSE_3D, aspose3D);
        }
        public void storeReleaseNotes(AsposeComponent component)
        {
            string localPath = getLibaryDownloadPath() + component.get_name() + ".htm";
            try
            {
                System.IO.File.WriteAllText(localPath, component.get_changeLog());
            }
            catch (FileNotFoundException e)
            {

            }
            catch (Exception e)
            {

            }

        }
        private void CloneOrCheckOutRepoWorker(AsposeComponent component)
        {
            GitHelper.CloneOrCheckOutRepo(component);
            downloadTaskCompleted = true;

        }
        public AsposeComponents()
        {
            list.Clear();
            AsposeComponent asposeCells = new AsposeComponent();
            asposeCells.set_downloadUrl("");
            asposeCells.set_downloadFileName("aspose-cells.zip");
            asposeCells.set_name(Constants.ASPOSE_CELLS);
            asposeCells.set_remoteExamplesRepository("https://github.com/zaheertariq/Aspose_Cells_NET.git");
            list.Add(Constants.ASPOSE_CELLS, asposeCells);

            AsposeComponent asposeWords = new AsposeComponent();
            asposeWords.set_downloadUrl("");
            asposeWords.set_downloadFileName("aspose-words.zip");
            asposeWords.set_name(Constants.ASPOSE_WORDS);
            asposeWords.set_remoteExamplesRepository("https://github.com/zaheertariq/Aspose_Words_NET.git");
            list.Add(Constants.ASPOSE_WORDS, asposeWords);

            AsposeComponent asposePDF = new AsposeComponent();
            asposePDF.set_downloadUrl("");
            asposePDF.get_downloadFileName();
            asposePDF.set_name(Constants.ASPOSE_PDF);
            asposePDF.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Pdf_NET.git";
            list.Add(Constants.ASPOSE_PDF, asposePDF);

            AsposeComponent asposeSlides = new AsposeComponent();
            asposeSlides.set_downloadUrl("");
            asposeSlides.get_downloadFileName();
            asposeSlides.set_name(Constants.ASPOSE_SLIDES);
            asposeSlides.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Slides_NET.git";
            list.Add(Constants.ASPOSE_SLIDES, asposeSlides);

            AsposeComponent asposeDiagram = new AsposeComponent();
            asposeDiagram.set_downloadUrl("");
            asposeDiagram.get_downloadFileName();
            asposeDiagram.set_name(Constants.ASPOSE_DIAGRAM);
            asposeDiagram.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Diagram_NET.git";
            list.Add(Constants.ASPOSE_DIAGRAM, asposeDiagram);

            AsposeComponent asposeBarcode = new AsposeComponent();
            asposeBarcode.set_downloadUrl("");
            asposeBarcode.get_downloadFileName();
            asposeBarcode.set_name(Constants.ASPOSE_BARCODE);
            asposeBarcode.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_BarCode_NET.git";
            list.Add(Constants.ASPOSE_BARCODE, asposeBarcode);

            AsposeComponent asposeTasks = new AsposeComponent();
            asposeTasks.set_downloadUrl("");
            asposeTasks.get_downloadFileName();
            asposeTasks.set_name(Constants.ASPOSE_TASKS);
            asposeTasks.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Tasks_NET.git";
            list.Add(Constants.ASPOSE_TASKS, asposeTasks);

            AsposeComponent asposeEmail = new AsposeComponent();
            asposeEmail.set_downloadUrl("");
            asposeEmail.get_downloadFileName();
            asposeEmail.set_name(Constants.ASPOSE_EMAIL);
            asposeEmail.set_remoteExamplesRepository("https://github.com/zaheertariq/Aspose_Email_NET.git");
            list.Add(Constants.ASPOSE_EMAIL, asposeEmail);

            AsposeComponent asposeOCR = new AsposeComponent();
            asposeOCR.set_downloadUrl("");
            asposeOCR.get_downloadFileName();
            asposeOCR.set_name(Constants.ASPOSE_OCR);
            asposeOCR.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_OCR_NET.git";
            list.Add(Constants.ASPOSE_OCR, asposeOCR);

            AsposeComponent asposeImaging = new AsposeComponent();
            asposeImaging.set_downloadUrl("");
            asposeImaging.set_downloadFileName("aspose.imaging.zip");
            asposeImaging.set_name(Constants.ASPOSE_IMAGING);
            asposeImaging.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Imaging_NET.git";
            list.Add(Constants.ASPOSE_IMAGING, asposeImaging);

            AsposeComponent asposeNote = new AsposeComponent();
            asposeNote.set_downloadUrl("");
            asposeNote.set_downloadFileName("aspose.note.zip");
            asposeNote.set_name(Constants.ASPOSE_NOTE);
            asposeNote.RemoteExamplesRepository = "https://github.com/zaheertariq/Aspose_Note_NET.git";
            list.Add(Constants.ASPOSE_NOTE, asposeNote);

            AsposeComponent aspose3D = new AsposeComponent();
            aspose3D.set_downloadUrl("");
            aspose3D.set_downloadFileName("aspose.3d.zip");
            aspose3D.set_name(Constants.ASPOSE_3D);
            aspose3D.RemoteExamplesRepository = "https://github.com/aspose3d/Aspose_3D_NET.git";
            list.Add(Constants.ASPOSE_3D, aspose3D);
        }
 void processComponents()
 {
     if (checkBoxAsposeCells.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_CELLS, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeWords.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_WORDS, out component);
         component.Selected = true;
     }
     if (checkBoxAsposePdf.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_PDF, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeSlides.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_SLIDES, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeDiagram.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_DIAGRAM, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeBarCode.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_BARCODE, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeTasks.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_TASKS, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeEmail.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_EMAIL, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeOCR.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_OCR, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeImaging.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_IMAGING, out component);
         component.Selected = true;
     }
     if (checkBoxAsposeNote.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_NOTE, out component);
         component.Selected = true;
     }
     if (checkBoxAspose3D.Checked)
     {
         AsposeComponent component = new AsposeComponent();
         AsposeComponents.list.TryGetValue(Constants.ASPOSE_3D, out component);
         component.Selected = true;
     }
 }
 /**
  *
  * @param component
  * @return
  */
 public static string getExamplesDefinitionsPath(AsposeComponent component)
 {
     return(getLocalRepositoryPath(component) + "/" + "Examples.xml");
 }
 /**
  *
  * @param component
  * @return
  */
 public static string getLocalRepositoryPath(AsposeComponent component)
 {
     return(AsposeComponentsManager.getAsposeHomePath() + "gitrepos" + "/" + component.get_name());
 }
        private void UpdatePrjReferenceHintPath(string projectFilePath, AsposeComponent component)
        {
            if (!File.Exists(projectFilePath))
                return;

            XmlDocument xdDoc = new XmlDocument();
            xdDoc.Load(projectFilePath);

            XmlNamespaceManager xnManager =
             new XmlNamespaceManager(xdDoc.NameTable);
            xnManager.AddNamespace("tu",
             "http://schemas.microsoft.com/developer/msbuild/2003");

            XmlNode xnRoot = xdDoc.DocumentElement;
            XmlNodeList xnlPages = xnRoot.SelectNodes("//tu:ItemGroup", xnManager);
            foreach (XmlNode node in xnlPages)
            {
                XmlNodeList nodelist = node.SelectNodes("//tu:HintPath", xnManager);
                foreach (XmlNode nd in nodelist)
                {
                    string innter = nd.InnerText;
                    nd.InnerText = "..\\Bin\\" + component.Name + ".dll";
                }
            }
            xdDoc.Save(projectFilePath);
        }
        private void checkAndUpdateRepo(AsposeComponent component)
        {
            if (null == component)
                return;
            if (null == component.get_remoteExamplesRepository() || component.RemoteExamplesRepository == string.Empty)
            {
                showMessage("Examples not available", component.get_name() + " - " + Constants.EXAMPLES_NOT_AVAILABLE_MESSAGE, MessageBoxButtons.OK, MessageBoxIcon.Information);
                examplesNotAvailable = true;
                validateForm();
                return;
            }
            else
            {
                examplesNotAvailable = false;
                validateForm();
            }
            // String repoPath;
            if (GitHelper.isExamplesDefinitionsPresent(component))
            {
                CloneOrCheckOutRepo(component);
            }
            else
            {
                DialogResult result = showMessage("Examples download required", component.get_name() + " - " + Constants.EXAMPLES_DOWNLOAD_REQUIRED, MessageBoxButtons.YesNo, MessageBoxIcon.Information);
                if (result == DialogResult.Yes)
                {

                    if (AsposeComponentsManager.isIneternetConnected())
                    {
                        CloneOrCheckOutRepo(component);
                    }
                    else
                        showMessage(Constants.INTERNET_CONNECTION_REQUIRED_MESSAGE_TITLE, component.get_name() + " - " + Constants.EXAMPLES_INTERNET_CONNECTION_REQUIRED_MESSAGE, MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }

        }
Exemplo n.º 16
0
 /**
  * 
  * @param component
  * @return
  */
 public static string getLocalRepositoryPath(AsposeComponent component)
 {
     return AsposeComponentsManager.getAsposeHomePath() + "gitrepos" + "/" + component.get_name();
 }
        public static void storeVersion(AsposeComponent component)
        {
            string localPath = getLibaryDownloadPath() + component.get_name() + ".ver";
            try
            {
                System.IO.File.WriteAllText(localPath, component.get_latestVersion());
            }
            catch (FileNotFoundException e)
            {

            }
            catch (Exception e)
            {

            }

        }
 public static void addToDownloadList(AsposeComponent component, string urlStr, string outputFile)
 {
     AsyncDownload asyncDownload = new AsyncDownload();
     asyncDownload.Url = urlStr;
     asyncDownload.LocalPath = getLibaryDownloadPath() + outputFile;
     asyncDownload.Component = component;
     AsyncDownloadList.list.Add(asyncDownload);
 }
Exemplo n.º 19
0
 /**
  * 
  * @param component
  * @return
  */
 public static string getExamplesDefinitionsPath(AsposeComponent component)
 {
     return getLocalRepositoryPath(component) + "/" + "Examples.xml";
 }
 private void CloneOrCheckOutRepo(AsposeComponent component)
 {
     downloadTaskCompleted = false;
     timer1.Start();
     Task repoUpdateWorker = new Task(delegate { CloneOrCheckOutRepoWorker(component); });
     //repoUpdateWorker.ContinueWith(result => RepositoryUpdateCompleted(), TaskContinuationOptions.OnlyOnRanToCompletion);
     repoUpdateWorker.Start();
     progressTask = new Task(delegate { progressDisplayTask(); });
     progressBar.Enabled = true;
     progressTask.Start();
     ContinueButton.Enabled = false;
     if (GitHelper.isExamplesDefinitionsPresent(component))
     {
         toolStripStatusMessage.Text = "Please wait while the Examples are being downloaded...";
     }
     else
     {
         toolStripStatusMessage.Text = "Please wait while the Examples are being downloaded...";
     }
 }