示例#1
0
 public void RemoveFromCollection()
 {
     Log.Info("KeoCacheModule.RemoveFromCollection");
     Events["AddToCollection"].guiActive      = true;
     Events["RemoveFromCollection"].guiActive = false;
     if (KeoCacheDriver.activeKeoCacheCollection != null)
     {
         for (int i = 0; i < KeoCacheDriver.activeKeoCacheCollection.keoCacheDataList.Count(); i++)
         {
             if (KeoCacheDriver.activeKeoCacheCollection.keoCacheDataList[i].keocacheId == this.keocacheId)
             {
                 KeoCacheDriver.activeKeoCacheCollection.keoCacheDataList.Remove(KeoCacheDriver.activeKeoCacheCollection.keoCacheDataList[i]);
             }
         }
     }
     keocacheId   = System.Guid.NewGuid().ToString("N");
     assigned     = AssignStatus.unassigned;
     collectionId = "";
     UpdateEvents();
     if (KeoCacheDriver.Instance != null && KeoCacheDriver.Instance.visibleKeoCache)
     {
         KeoCacheDriver.Instance.visibleKeoCache       = false;
         KeoCacheDriver.Instance.visibleEditCollection = true;
     }
     return;
 }
示例#2
0
 public void UpdateData(string gid, AssignStatus asgn, string cid)
 {
     keocacheId   = gid;
     assigned     = asgn;
     collectionId = cid;
     UpdateEvents();
 }
示例#3
0
        public void AddToCollection()
        {
            Log.Info("KeoCacheModule.AddToCollection");
            Events["AddToCollection"].guiActive      = false;
            Events["RemoveFromCollection"].guiActive = true;

            KeoCacheData data = new KeoCacheData();

            data.keoCacheName = this.vessel.name;
            int idxLeftParen = data.keoCacheName.LastIndexOf('(');

            if (idxLeftParen > 0)
            {
                int idxRightParen = data.keoCacheName.LastIndexOf(')');
                if (idxRightParen > idxLeftParen)
                {
                    data.keoCacheName = data.keoCacheName.Substring(idxLeftParen + 1, idxRightParen - (idxLeftParen + 1));
                }
            }
            data.keoCacheName = "Location of " + data.keoCacheName;
            data.CacheVessel  = this.vessel;
            data.latitude     = this.vessel.latitude;
            data.longitude    = this.vessel.longitude;
            assigned          = AssignStatus.assigned;
            this.keocacheId   = data.keocacheId;

            collectionId = KeoCacheDriver.activeKeoCacheCollection.keocacheCollectionData.collectionId;

            KeoCacheDriver.activeKeoCacheCollection.keoCacheDataList.Add(data);
            UpdateEvents();
        }