예제 #1
0
		private void attach_ChannelViews(ChannelView entity)
		{
			this.SendPropertyChanging();
			entity.Clan = this;
		}
예제 #2
0
		private void detach_ChannelViews(ChannelView entity)
		{
			this.SendPropertyChanging();
			entity.Clan = null;
		}
예제 #3
0
 partial void DeleteChannelView(ChannelView instance);
예제 #4
0
 partial void UpdateChannelView(ChannelView instance);
예제 #5
0
 partial void InsertChannelView(ChannelView instance);
예제 #6
0
        private void HandleUser(object sender, UserEventArgs e)
        {
            Product p = e.User.Stats.Product;
            if (p == Product.Warcraft3Retail || p == Product.Warcraft3Expansion)
            {
                // check to see if the user has a clan
                Warcraft3Stats w3s = e.User.Stats as Warcraft3Stats;
                string tag = w3s.ClanTag;
                NoteTag(tag, e.User, m_client.Client.ChannelName, e.EventType);
            }

            if (e.User.Username == m_client.Client.UniqueUsername)
            {
                if (m_nextClanID != 0)
                {
                    using (var dc = ClansDataContext.Create(m_dbPath))
                    {
                        var view = new ChannelView
                        {
                            ClanID = m_nextClanID,
                            AllowedView = true,
                            When = DateTime.Now,
                            UserCount = m_client.Client.Channel.Count,
                            UserList = FormatChannel(m_client.Client.Channel)
                        };
                        dc.ChannelViews.InsertOnSubmit(view);

                        try
                        {
                            dc.SubmitChanges();
                        }
                        catch (Exception ex)
                        {
                            m_client.MainWindow.AddChat(new ChatNode[] {
                                new ChatNode("JinxBot Clan Gnome error ", Color.DarkRed),
                                new ChatNode("Error saving a clan visit:", Color.Red),
                                ChatNode.NewLine,
                                new ChatNode(ex.ToString(), Color.OrangeRed)
                            });
                        }
                    }
                }
            }
        }
예제 #7
0
        private void HandleChannelError(object sender, ServerChatEventArgs e)
        {
            if (m_nextClanID != 0)
            {
                using (var dc = ClansDataContext.Create(m_dbPath))
                {
                    var view = new ChannelView
                    {
                        ClanID = m_nextClanID,
                        AllowedView = false,
                        When = DateTime.Now,
                        UserCount = 0,
                        UserList = ""
                    };
                    dc.ChannelViews.InsertOnSubmit(view);

                    try
                    {
                        dc.SubmitChanges();
                    }
                    catch (Exception ex)
                    {
                        m_client.MainWindow.AddChat(new ChatNode[] {
                                new ChatNode("JinxBot Clan Gnome error ", Color.DarkRed),
                                new ChatNode("Error saving a new clan:", Color.Red),
                                ChatNode.NewLine,
                                new ChatNode(ex.ToString(), Color.OrangeRed)
                            });
                    }
                }
            }
        }