Ejemplo n.º 1
0
        void OnJoin(object sender, JoinEventArgs e)
        {
            if (e.Who == client.Nickname || channel == null || e.Channel != channel.Name)
            {
                return;
            }

            AddNotification("{0} joined the chat.".F(e.Who));
            Game.RunAfterTick(() => Users.Add(e.Who, new ChatUser(e.Who, false, false)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Standard <seealso cref="FolderViewModel"/> constructor
        /// </summary>
        protected FolderViewModel()
            : base()
        {
            mIsExpanded = mIsSelected = false;

            mModel = null;

            // Add dummy folder by default to make tree view show expander by default
            mFolders = new ObservableSortedDictionary <string, IFolderViewModel>();
            mFolders.Add(string.Empty, new FolderViewModel(string.Empty, FSItemType.DummyEntry));

            mVolumeLabel = null;
        }
Ejemplo n.º 3
0
        public void SourceManipulationSorted()
        {
            var numbers = new ObservableSortedDictionary <int, int>(Enumerable.Range(0, 10).ToDictionary(i => i));

            using var query = numbers.ActiveValueForOrDefault(9);
            Assert.IsNull(query.OperationFault);
            Assert.AreEqual(9, query.Value);
            numbers.Remove(9);
            Assert.IsNull(query.OperationFault);
            Assert.AreEqual(0, query.Value);
            numbers.Add(9, 30);
            Assert.IsNull(query.OperationFault);
            Assert.AreEqual(30, query.Value);
            numbers[9] = 15;
            Assert.IsNull(query.OperationFault);
            Assert.AreEqual(15, query.Value);
        }