Exemple #1
0
        public static void Sync(Document aDoc, bool _add, string _mapPlaceFolder = "", bool _online = true)
        {
            if (_add)
            {
                MapCompanion startevents = new MapCompanion(aDoc)
                {
                    mc_MapFolderPath = _mapPlaceFolder
                };

                SDocs.Add(new DocumentStorage()
                {
                    MGuid = SUtils.SynergyMapGuid(aDoc),
                    Sdoc  = aDoc,
                    _mc   = startevents
                });
            }
            else // unsubscribe map
            {
                foreach (DocumentStorage item in SDocs)
                {
                    if (item.MGuid == SUtils.SynergyMapGuid(aDoc))
                    {
                        SDocs.Remove(item);
                        item.Sdoc = null;
                        item._mc.Dispose();
                        break;
                    }
                }
            }
        }
Exemple #2
0
 public MMEventArgs(
     Object aTarget,
     string aWhat,
     string aExtra,
     MapCompanion aDocument = null)
 {
     target     = aTarget;
     what       = aWhat != "" ? aWhat.ToLower() : DocumentStorage.GetTargetType(aTarget);
     what       = what == "connection" ? "relationship" : what;
     extra      = aExtra;
     m_document = aDocument != null ? aDocument.Document : null;
     if (m_document != null)
     {
         aMapFolderPath = aDocument.mc_MapFolderPath;
     }
 }