Пример #1
0
 protected virtual void ControlsToData()
 {
     if (_document == null)
     {
         _document = edtItem.Document;
     }
     else
     {
         _document.Item = edtItem.Text;
     }
     _document.controlNumber = edtControlNumber.GetValue <string>();
     _document.name          = edtDocumentName.GetValue <string>();
     _document.uuid          = edtUUID.GetValue <string>();
     _document.version       = edtVersion.GetValue <string>();
     _document.Description   = edtDescription.GetValue <string>();
     if (rbText.Checked)
     {
         _document.ItemElementName = DocumentItemChoiceType.Text;
         _document.DocumentContent = Encoding.UTF8.GetBytes(edtItem.Text);
     }
     if (rbURL.Checked)
     {
         _document.ItemElementName = DocumentItemChoiceType.URL;
     }
 }
Пример #2
0
 private void DocumentControl_DocumentSaved(Document document)
 {
     if (document != null)
     {
         edtItem.Text       = Encoding.UTF8.GetString(document.DocumentContent);
         edtItem.CurrentPos = edtItem.Tag is int?(int)edtItem.Tag : 0;
     }
 }
Пример #3
0
        protected virtual void OnDocumentChanged(Document document, bool isDirty)
        {
            DocumentChangeDelegate handler = DocumentChanged;

            if (handler != null)
            {
                handler(document, isDirty);
            }
        }
Пример #4
0
        private void edtItem_TextChanged(object sender, EventArgs e)
        {
            var doc = new Document();

            if (_document != null)
            {
                doc.DataState = _document.DataState;
            }
            doc.name = edtDocumentName.GetValue <String>() + (edtItem.UndoRedo.CanUndo ? "*" : "");
            OnDocumentChanged(doc, edtItem.UndoRedo.CanUndo);
        }
Пример #5
0
        private void edtDocumentName_TextChanged(object sender, EventArgs e)
        {
            var doc = new Document();

            if (_document != null)
            {
                doc.DataState = _document.DataState;
            }
            doc.name = edtDocumentName.GetValue <String>();
            OnDocumentChanged(doc, false);
        }
 private void InitListView()
 {
     var document = new Document();
     DataObjectName = "Document";
     DataObjectFormType = typeof (DocumentForm);
     AddColumnData("Type", "DocumentType", .20);
     AddColumnData("Name", "name", .30);
     AddColumnData("Description", "Description", .25);
     AddColumnData("uuid", "uuid", .25);
     InitColumns();
 }
 public void AddDocument(Document document)
 {
     if (String.IsNullOrEmpty(document.uuid))
         document.uuid = Guid.NewGuid().ToString();
     if (!HasDoument(document.uuid))
     {
         List<Document> list = new List<Document>();
         if (Documentation != null)
             list = Documentation.ToList();
         list.Add(document);
         Documentation = list;
     }
 }
Пример #8
0
 public static bool LoadFromFile(string fileName, out Document obj)
 {
     System.Exception exception;
     return LoadFromFile(fileName, out obj, out exception);
 }
Пример #9
0
 protected virtual void OnDocumentChanged( Document document, bool isDirty )
 {
     DocumentChangeDelegate handler = DocumentChanged;
     if (handler != null) handler( document, isDirty );
 }
Пример #10
0
 public static bool Deserialize(string input, out Document obj)
 {
     System.Exception exception;
     return Deserialize(input, out obj, out exception);
 }
Пример #11
0
 /// <summary>
 /// Deserializes workflow markup into an Document object
 /// </summary>
 /// <param name="input">string workflow markup to deserialize</param>
 /// <param name="obj">Output Document object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string input, out Document obj, out System.Exception exception)
 {
     exception = null;
     obj = default(Document);
     try
     {
         obj = Deserialize(input);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 private static Document GetDocument(dbDocument document, string xml)
 {
     var doc = new Document();
     doc.uuid = document.UUID.ToString();
     doc.name = document.documentName;
     doc.version = document.documentVersion;
     doc.DocumentContent = Encoding.UTF8.GetBytes(xml);
     doc.ContentType = DocumentManager.GetContentType(".xml");
     return doc;
 }
 public Parameter()
 {
     this._reference = new Document();
     this._data = new Value();
 }
Пример #14
0
 private void edtItem_TextChanged( object sender, EventArgs e )
 {
     var doc = new Document();
     if (_document != null)
         doc.DataState = _document.DataState;
     doc.name = edtDocumentName.GetValue<String>() + ( edtItem.UndoRedo.CanUndo ? "*" : "" );
     OnDocumentChanged( doc, edtItem.UndoRedo.CanUndo );
 }
Пример #15
0
 private void edtDocumentName_TextChanged( object sender, EventArgs e )
 {
     var doc = new Document();
     if (_document != null)
         doc.DataState = _document.DataState;
     doc.name = edtDocumentName.GetValue<String>();
     OnDocumentChanged( doc, false );
 }
Пример #16
0
 private void DocumentControl_DocumentSaved( Document document )
 {
     if (document != null)
     {
         edtItem.Text = Encoding.UTF8.GetString( document.DocumentContent );
         edtItem.CurrentPos = edtItem.Tag is int ? (int)edtItem.Tag : 0;
     }
 }
Пример #17
0
 /// <summary>
 /// Deserializes xml markup from file into an Document object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output Document object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this Serializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out Document obj, out System.Exception exception)
 {
     exception = null;
     obj = default(Document);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Пример #18
0
 protected virtual void ControlsToData()
 {
     if (_document == null)
     {
         _document = edtItem.Document;
     }
     else
     {
         _document.Item = edtItem.Text;
     }
     _document.controlNumber = edtControlNumber.GetValue<string>();
     _document.name = edtDocumentName.GetValue<string>();
     _document.uuid = edtUUID.GetValue<string>();
     _document.version = edtVersion.GetValue<string>();
     _document.Description = edtDescription.GetValue<string>();
     if (rbText.Checked)
     {
         _document.ItemElementName = DocumentItemChoiceType.Text;
         _document.DocumentContent = Encoding.UTF8.GetBytes( edtItem.Text );
     }
     if (rbURL.Checked)
     {
         _document.ItemElementName = DocumentItemChoiceType.URL;
     }
 }