示例#1
0
        public void RemoveAll(AUTHENTICATION_TYPE enAuthType)
        {
            TisSystemUser oSystemUser;

            for (int i = m_oSystemUsers.Count - 1; i >= 0; i--)
            {
                oSystemUser = (TisSystemUser)m_oSystemUsers [i];

                if (oSystemUser.AuthenticationType == enAuthType)
                {
                    m_oSystemUsers.Remove(oSystemUser);
                }
            }
        }
示例#2
0
 public void RemovePermissions(string[] Permissions)
 {
     foreach (string sPermission in Permissions)
     {
         m_oPermissions.Remove(sPermission);
     }
 }
        private void OnObjectRemoved(object obj)
        {
            IUpdateReceiver updateReceiver = obj as IUpdateReceiver;

            if (updateReceiver != null)
            {
                m_UpdateReceivers.Remove(updateReceiver);
            }
        }
        /// <summary>
        /// Remove update receiver.
        /// </summary>
        /// <param name="receiver">The object to remove.</param>
        public void RemoveUpdateReciever(IUpdateReceiver receiver)
        {
            if (receiver == null)
            {
                return;
            }

            if (m_UpdatingReceivers)
            {
                if (m_UpdateReceiversToRemove == null)
                {
                    m_UpdateReceiversToRemove = new List <IUpdateReceiver>();
                }
                m_UpdateReceiversToRemove.Add(receiver);
            }
            else
            {
                m_UpdateReceivers.Remove(receiver);
            }
        }
示例#5
0
        public async Task Save()
        {
            XmlSerializer historySerializer = new XmlSerializer(typeof(List <HistoricalConnection>));

#if APPX
            // Remove all connections older than two weeks
            foreach (HistoricalConnection connection in _connections.Where(c => c.LastConnection < DateTime.Now.AddDays(-14)).ToList())
            {
                _connections.Remove(connection);
            }

            IStorageFile historyFile = await ApplicationData.Current.LocalFolder.CreateFileAsync("History.xml", CreationCollisionOption.ReplaceExisting);

            StringWriter historyFileText = new StringWriter();
            historySerializer.Serialize(historyFileText, _connections.ToList());

            await FileIO.WriteTextAsync(historyFile, historyFileText.ToString());
#else
            FileInfo destinationFile = new FileInfo(HistoryFileName);

            // ReSharper disable AssignNullToNotNullAttribute
            Directory.CreateDirectory(destinationFile.DirectoryName);
            // ReSharper restore AssignNullToNotNullAttribute

            // Remove all connections older than two weeks
            foreach (HistoricalConnection connection in _connections.Where(c => c.LastConnection < DateTime.Now.AddDays(-14)).ToList())
            {
                _connections.Remove(connection);
            }

            using (XmlWriter historyWriter = new XmlTextWriter(HistoryFileName, new UnicodeEncoding()))
            {
                historySerializer.Serialize(historyWriter, _connections.ToList());
                historyWriter.Flush();
            }
#endif
        }
示例#6
0
        bool OnCommand(SimpleNameProperty sender, string MenuId)
        {
            switch (MenuId)
            {
            case "MenuId.GeoObjectList.Remove":
                list.Remove(sender.AssociatedObject as IGeoObject);
                return(true);

            case "MenuId.GeoObjectList.Show":
                if (Frame.ActiveView is AnimatedView)
                {
                    AnimatedView av = Frame.ActiveView as AnimatedView;
                    av.SetSelectedObject(sender.AssociatedObject as IGeoObject);
                }
                return(true);
            }
            return(false);
        }