protected void Saved(object sender, DocumentSavedEventArgs e)
    {
        //Check what raised the Saved event
        switch (e.SaveType)
        {
            //When we are saving or downloading
            case DocumentSaveType.Save:
            case DocumentSaveType.Download:

                //Get saved PDF
                byte[] pdfData = e.DocumentData;

                //If desired, we could save the modified PDF to a file, database, send it via email, etc.
                //For example:
                //System.IO.File.WriteAllBytes(@"C:\output.pdf", pdfData);

                //Get its size
                int pdfSize = pdfData.Length;

                //Create our message
                string message = string.Format("A PDF file of {0} bytes was just saved or downloaded!", pdfSize);

                //Add event to the Windows Application Log
                EventLog.WriteEntry("RAD PDF", message, EventLogEntryType.Information);
                break;

            default:

                //Ignore all other save types (Print, etc)
                break;
        }
    }
    protected void Saved(object sender, DocumentSavedEventArgs e)
    {
        //Check what raised the Saved event
        switch (e.SaveType)
        {
        //When we are saving or downloading
        case DocumentSaveType.Save:
        case DocumentSaveType.Download:

            //Get saved PDF
            byte[] pdfData = e.DocumentData;

            //If desired, we could save the modified PDF to a file, database, send it via email, etc.
            //For example:
            //System.IO.File.WriteAllBytes(@"C:\output.pdf", pdfData);

            //Get its size
            int pdfSize = pdfData.Length;

            //Create our message
            string message = string.Format("A PDF file of {0} bytes was just saved or downloaded!", pdfSize);

            //Add event to the Windows Application Log
            EventLog.WriteEntry("RAD PDF", message, EventLogEntryType.Information);
            break;

        default:

            //Ignore all other save types (Print, etc)
            break;
        }
    }
        protected virtual void OnDocumentSaved(object sender, DocumentSavedEventArgs e)
        {
            CacheChanges();
            StateFullDocument.UpdateDocument(TemporalFilePath);

            var args = new DocumentUpdatedEventArgs(StateFullDocument.State, ViewDocumentTitle);

            DocumentStateChanged?.Invoke(this, args);
        }
Esempio n. 4
0
        private static void OnDocumentSaved(object sender, DocumentSavedEventArgs e)
        {
            if (e.Status == RevitAPIEventStatus.Failed || e.Status == RevitAPIEventStatus.Cancelled)
            {
                return;
            }
            if (e.Document == null)
            {
                return;
            }

            MoveBackups(e.Document);
        }
Esempio n. 5
0
        public static void OnDocumentSaved(object sender, DocumentSavedEventArgs e)
        {
            Document doc = e.Document;

            if (Options.m_neo != null && Options.m_neo.ViewId.ToString() != "-1")
            {
                doc.Export(Options._folderExport, Options._NWCFileName, Options.m_neo);
            }
            else
            {
                TaskDialog.Show("Export Options", "You must set your export options before Automatic NWC file creation.");
            }
        }
Esempio n. 6
0
        protected override void OnDocumentSaved(EventArgs e)
        {
            base.OnDocumentSaved(e);

            ModelRoot modelRoot = RootElement as ModelRoot;

            if (modelRoot?.TransformOnSave != true)
            {
                return;
            }

            DocumentSavedEventArgs documentSavedEventArgs = (DocumentSavedEventArgs)e;

            GenerateCode(documentSavedEventArgs.NewFileName);
        }
    /// <summary>Called after the document is saved.</summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="DocumentSavedEventArgs"/> instance containing the event data.</param>
    private void AfterDocumentSaved(object sender, DocumentSavedEventArgs e)
    {
      var data = e.Document.EnumerateData();

      foreach (var pair in data)
      {
        var projectItem = pair.Value as IProjectItem;
        if (projectItem == null)
        {
          continue;
        }

        var project = projectItem.GetProject();
        if (project == null)
        {
          return;
        }

        var fileName = projectItem.Location.ToString();
        if (string.IsNullOrEmpty(fileName))
        {
          return;
        }


        string folder;
        try
        {
          folder = Path.GetDirectoryName(project.Location.ToString()) ?? string.Empty;
        }
        catch
        {
          return;
        }

        if (fileName.StartsWith(folder, StringComparison.InvariantCultureIgnoreCase))
        {
          fileName = fileName.Substring(folder.Length);
        }

        fileName = "<" + project.Name + ">" + fileName;

        ShellManager.Instance.RaiseDocumentChanged(fileName);

        return;
      }
    }
Esempio n. 8
0
 /// <summary>
 /// The OnDocumentSave
 /// </summary>
 /// <param name="sender">The sender<see cref="object"/></param>
 /// <param name="args">The args<see cref="DocumentSavedEventArgs"/></param>
 private void OnDocumentSave(object sender, DocumentSavedEventArgs args)
 {
 }
Esempio n. 9
0
        //private void OnDocChanged(object sender, DocumentChangedEventArgs e)
        //{
        //    Tools.CreateImages(e.GetDocument());
        //    Tools.CollectFamilyData(e.GetDocument());
        //}

        private void OnDocSaved(object sender, DocumentSavedEventArgs e)
        {
            //Tools.CreateImages(e.Document);
            //Tools.CollectFamilyData(e.Document);
        }
Esempio n. 10
0
        public static void DocSaved(object sender, DocumentSavedEventArgs e)
        {
            string currentUser = ShowDockableWindow._cachedUiApp.Application.Username;

            Ribbon.m_MyDock.txtBoxSyncTime.Text = String.Format("{0} {1}", Helpers.GetTime(), currentUser);
        }
Esempio n. 11
0
    protected void Saved(object sender, DocumentSavedEventArgs e)
    {
        //Check what raised the Saved event
            switch (e.SaveType)
            {
                //When we are saving or downloading
                case DocumentSaveType.Save:
                case DocumentSaveType.Download:

                    try
                    {
                        string id = "";
                        string folder_id = "";
                        string record_id = "";

                        try
                        {
                            id = Request.QueryString["id"].ToString();
                        }
                        catch (Exception ex)
                        {

                        }
                        try
                        {
                            folder_id = Request.QueryString["folder_id"].ToString();
                        }
                        catch (Exception ex)
                        {

                        }
                        try
                        {
                            record_id = Request.QueryString["record_id"].ToString();
                        }
                        catch (Exception ex)
                        {

                        }

                        PdfDocumentEditor DocumentEditor1 =
                                        this.PdfWebControl1.EditDocument();

                        //Commit DocumentEditor changes
                        DocumentEditor1.Save();

                        //Get saved PDF
                        byte[] pdfData = e.DocumentData;
                        try
                        {
                            System.IO.File.WriteAllBytes(Server.MapPath(@"pdfs/archive/" + Session["id"] + "_signed.pdf"), pdfData);
                        }
                        catch (Exception ex)
                        {

                        }

                        Session["saved"] = "True";
                        int docid = uploadDMS(Session["id"].ToString(), Session["folder_id"].ToString(), Session["record_id"].ToString());
                        updateSugarDB(docid.ToString(), Session["record_id"].ToString());
                        //Response.Redirect("./AobaAnnotationList.aspx");
                        //Response.End();
                    }
                    catch (Exception ex)
                    {

                    }
                    break;
                default:

                    //Ignore all other save types (Print, etc)
                    break;

            }
    }
Esempio n. 12
0
 private void Revit_DocumentSaved(object sender, DocumentSavedEventArgs e)
 {
     SaveFileClients();
 }
Esempio n. 13
0
        public static void OnDocumentSaved(object sender, DocumentSavedEventArgs e)
        {
            Document doc = e.Document;

            if (Options.m_neo != null && Options.m_neo.ViewId.ToString() != "-1")
            {
                doc.Export(Options._folderExport, Options._NWCFileName, Options.m_neo);
            }
            else
            {
                TaskDialog.Show("Export Options", "You must set your export options before Automatic NWC file creation.");
            }
        }
Esempio n. 14
0
 private void doc_DocumentSaved(object sender, DocumentSavedEventArgs e)
 {
     DisplayEvent("Document saved");
 }
Esempio n. 15
0
 /// <summary>
 /// DocumentSaved event, record the current DataTime for the saved document
 /// </summary>
 /// <param name="sender">sender</param>
 /// <param name="args">DocumentSavedEventArgs</param>
 void ThisApplication_DocumentSaved(object sender, DocumentSavedEventArgs args)
 {
     this.m_dicLastSaved[args.Document] = DateTime.Now;
 }
Esempio n. 16
0
 private void m_app_DocumentSaved(object sender, DocumentSavedEventArgs e)
 {
 }
Esempio n. 17
0
 /// <summary>
 /// Called when [document saved].
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="args">The <see cref="Autodesk.Revit.DB.Events.DocumentSavedEventArgs" /> instance containing the event data.</param>
 /// ReSharper disable once MemberCanBeMadeStatic.Local
 private void OnDocumentSaved(object sender, DocumentSavedEventArgs args)
 {
     // TODO: add you code here
 }
Esempio n. 18
0
 public static void SavedEvent(object sender, DocumentSavedEventArgs args)
 {
     MFSaveFamily.Main(args.Document);
 }