private static int IsCurrentObjModelStateInAnySnapshot(int serial, uint pDoc_serial, uint obj_serial, IntPtr pArchive, IntPtr pArchives, IntPtr pTextLog) { var client = FromSerialNumber(serial); if (client != null) { RhinoDoc doc = RhinoDoc.FromRuntimeSerialNumber(pDoc_serial); BinaryArchiveReader archive = new BinaryArchiveReader(pArchive); SimpleArrayBinaryArchiveReader archives = new SimpleArrayBinaryArchiveReader(pArchives); Rhino.DocObjects.RhinoObject obj = new DocObjects.RhinoObject(obj_serial); TextLog log = null; if (IntPtr.Zero != pTextLog) { new TextLog(pTextLog); } bool equal_doc = client.IsCurrentModelStateInAnySnapshot(doc, obj, archive, archives, log); return(equal_doc ? 1 : 0); } return(0); }
/// <summary> /// Called before restoring a snapshot. Warns the user if the current model state is not already saved. /// </summary> /// <param name="doc">doc is the current document.</param> /// <param name="doc_object">doc_object is the current object.</param> /// <param name="archive">archive is the current state of the model.</param> /// <param name="archive_array">archive_array is a list of client data.</param> /// <param name="text_log">text_log is used to list the missing items that cannot be found in the current model.</param> /// <returns>return true if successful, otherwise false.</returns> /// <since>6.0</since> public abstract bool IsCurrentModelStateInAnySnapshot(RhinoDoc doc, Rhino.DocObjects.RhinoObject doc_object, BinaryArchiveReader archive, SimpleArrayBinaryArchiveReader archive_array, TextLog text_log = null);
public override bool IsCurrentModelStateInAnySnapshot(RhinoDoc doc, RhinoObject doc_object, BinaryArchiveReader archive, SimpleArrayBinaryArchiveReader archive_array, TextLog text_log = null) { var userdata = archive.ReadDictionary(); string name = ""; if (!userdata.TryGetString("ObjName", out name)) { return(false); } for (int i = 0; i < archive_array.Count; i++) { var ba = archive_array.Get(i); var ud = ba.ReadDictionary(); string s = ""; if (ud.TryGetString("ObjName", out s)) { if (0 == s.CompareTo(name)) { return(true); } } } return(false); }
public override bool IsCurrentModelStateInAnySnapshot(RhinoDoc doc, BinaryArchiveReader archive, SimpleArrayBinaryArchiveReader archive_array, TextLog text_log = null) { throw new NotImplementedException(); }