Exemplo n.º 1
0
        public RChatViewModel(IStorage <MessageViewModel> storage) : base()
        {
            Title = "NBS群聊";
            initSelf();
            BindingOperations.EnableCollectionSynchronization(_collection, _lockObject);
            PubSubTask.PubSubTaskClient cli = new PubSubTask.PubSubTaskClient(GrpcBaseHelper.Instance().Channel);
            serviceClient = new PubSubServiceClient <MessageViewModel>(cli, _collection, SELF, SELF.UID, true);
            StartRecving();

            this.AssignCommands();

            loadLocalHistory(storage, 1);
        }
Exemplo n.º 2
0
 public MainWindow()
 {
     AppState.Instance.RPC_RUNNING = CheckedNBSRunning();
     GrpcBase = GrpcBaseHelper.Instance(true);//openDebug
     if (!AppState.Instance.RPC_RUNNING)
     {
         CreateAccountOffline("123456");
         StartNBSGrpc();
     }
     //
     initialGrpcService();
     GetVersion();//
     GetAccount();
     InitializeComponent();
     this.LoadChat();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the MainViewModel class.
 /// </summary>
 public MainViewModel(IStorage <ContactViewModel> storage) : base()
 {
     BindingOperations.EnableCollectionSynchronization(_contacts, _lockContacts);
     debugPath = AppState.Instance.GetLogFilePath("gossip");
     if (!System.IO.Directory.Exists(debugPath))
     {
         System.IO.Directory.CreateDirectory(debugPath);
     }
     _nick = AppState.Instance.CID;
     _acid = AppState.Instance.CID;
     AddSelfToContacts(_nick, _acid);
     //
     if (gossipService == null)
     {
         gossipService = new GossipServiceClient(GrpcBaseHelper.Instance(), debugPath, "debug-gossip.txt");
     }
     AssignCommands();
 }
 public SubscribeMessageService()
 {
     baseHelper = GrpcBaseHelper.Instance();
 }