コード例 #1
0
ファイル: User.cs プロジェクト: Kupilif/ChatBox
        /*  Конструктор класса  */
        public CUser(string name, string ip, int port, CView currUI, CUsersManager manager)
        {
            loadedColors = CColorsLoader.GetInstance();
            serverPoint  = new IPEndPoint(IPAddress.Parse(ip), port);
            listenSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            UI                      = currUI;
            usersManager            = manager;
            userName                = name;
            isUserConnectedToServer = false;
            isUserBanned            = false;
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: Kupilif/ChatBox
        public MainWindow()
        {
            InitializeComponent();

            colorsManager = CColorsLoader.GetInstance();
            currentUI     = new CView(this);
            usersManager  = new CUsersManager(currentUI, rtbPublicDialog);
            smiles        = new CSmiles(currentUI);
            smiles.LoadSmiles();

            btnSmiles.Content = colorsManager.GetSmileDraw(btnSmiles.Width);
            SetAvaliabiltyOfMenuItems();
        }
コード例 #3
0
        public CUsersManager(CView currUI, RichTextBox writingPad)
        {
            UI                      = currUI;
            mainWritingPad          = writingPad;
            curWritingPad           = mainWritingPad;
            curDialogInd            = PUBLIC_DIALOG_INDEX;
            publicDialogMessagesAmo = 0;

            usernames          = new List <string>();
            usersID            = new List <sbyte>();
            isSelfBannedByUser = new List <bool>();
            isUserBannedByMe   = new List <bool>();
            newMessagesAmo     = new List <int>();
            writingPads        = new List <RichTextBox>();
        }