Пример #1
0
 public ModManager(string modFolder, RomFsFactory ndsFactory, IMsgService msgService)
 {
     _msgService = msgService;
     _ndsFactory = ndsFactory;
     _modFolder  = modFolder;
     Directory.CreateDirectory(_modFolder);
 }
Пример #2
0
 public MsgController(
     IMsgService msgService,
     IDtoParseService dtoParseService)
 {
     _msgService      = msgService;
     _dtoParseService = dtoParseService;
 }
Пример #3
0
        static void Main(string[] args)
        {
            Ninject.IKernel kernal = new StandardKernel(new Core());
            ////kernal.Bind<IMsgRepo>().To<MsgRepo>();
            _repo = kernal.Get<MsgRepo>();

            _svc = kernal.Get<MsgService>();

            var svcreplies = _svc.GetReplies();
            foreach (var x in svcreplies)
            {
                Console.WriteLine(x.Body);
            }

            Console.WriteLine("enter reply");
            var consoleReply = Console.ReadLine();

            var reply = new Reply()
            {
                Body = consoleReply,
                Created = DateTime.Now,
                TopicId = 1

            };

            _repo.InsertReply(reply);

            var replies = _repo.GetReplies();
            _repo.DeleteReply(replies.First().Id);

            foreach (var x in replies)
            {
                Console.WriteLine(x.Body);
            }

            Main(args);

            //var baseClass = new BaseClass();
            //var derivedOverride = new DerivedOverride();
            //var derivedNew = new DerivedNew();
            //var derivedOverWrite = new DerivedOverwrite();

            //baseClass.Name();
            //derivedOverride.Name();
            //derivedNew.Name();
            //derivedOverWrite.Name();

            //Console.ReadLine();
            //baseClass.Name();
            //derivedOverride.Name();
            //((BaseClass)derivedNew).Name();
            //((BaseClass)derivedOverWrite).Name();
            //Console.ReadLine();

            //var t1 = typeof(BaseClass);
            //Console.WriteLine(t1.Name);
            //Console.WriteLine(t1.Assembly);

            //Console.ReadLine();
        }
Пример #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            WCFProxyMSMQ objWCF = new WCFProxyMSMQ();
            IMsgService  client = objWCF.GetProxy <IMsgService>(1);

            client.WriteMsg(txtInfo.Text.Trim());
            MessageBox.Show("发送成功C");
        }
Пример #5
0
 public SystemController(ISystemService systemService, IMsgService msgService,
                         INoticeService noticeService, IUsersService usersService, IDemandService demandService,
                         IProductService productService, IQuestionService questionService)
 {
     _SystemService   = systemService;
     _MsgService      = msgService;
     _NoticeService   = noticeService;
     _UsersService    = usersService;
     _DemandService   = demandService;
     _ProductService  = productService;
     _QuestionService = questionService;
 }
Пример #6
0
        /// <summary>
        /// 将消息发送给所有用户
        /// </summary>
        /// <param name="o"></param>
        private async void SendAllAsync(object o)
        {
            using (var scope = SherlockEngine.Current.CreateScope())
            {
                ILoggerFactory loggerFactory = scope.ServiceProvider.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
                var            logger        = loggerFactory.CreateLogger <AcceptMsgController>();
                SendMsgDto     dto           = o as SendMsgDto;
                //获取App下所有的用户
                IPushTokenBrandService pushTokenBrandService = scope.ServiceProvider.GetService(typeof(IPushTokenBrandService)) as IPushTokenBrandService;
                //IPushTokenBrandService pushTokenBrandService = SherlockEngine.Current.GetService<IPushTokenBrandService>();//这样写不会Dispose资源
                var allTokenList = await pushTokenBrandService.GetAllTokenBrand(dto.AppId);

                if (allTokenList == null || allTokenList.Count == 0)
                {
                    return;
                }
                IMapper mapper = scope.ServiceProvider.GetService(typeof(IMapper)) as IMapper;
                var     req    = mapper.Map <SendMsgListRequest>(dto);
                req.TokenList = allTokenList;
                string retMsg = string.Empty;
                try
                {
                    //将消息拆解存到消息队列中
                    IMsgService msgService = scope.ServiceProvider.GetService(typeof(IMsgService)) as IMsgService;
                    //IMsgService msgService = SherlockEngine.Current.GetService<IMsgService>();
                    var ret = msgService.AcceptAllMsgList(req, out retMsg);
                    if (ret == ErrCode.Sucess)
                    {
                        logger.LogInformation("推送全体成功");
                    }
                    else
                    {
                        logger.LogInformation("推送全体失败:" + retMsg);
                    }
                }
                catch (Exception ex)
                {
                    logger.LogInformation("推送全体失败:" + ex.Message.ToString());
                }
            }
        }
Пример #7
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            app.UseSwagger();
            // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), specifying the Swagger JSON endpoint.
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v2/swagger.json", "Push API V2");
            });
            loggerFactory.AddConsole(LogLevel.Information);
            loggerFactory.AddDebug(LogLevel.Error);
            app.StartSherlockWebApplication();
            //启动一个新的线程,来处理接收的数据
            IMsgService msgService = SherlockEngine.Current.GetService <IMsgService>();

            new Thread(new ThreadStart(msgService.HandleMsgToTreadPool))
            {
                IsBackground = true
            }.Start();
            //初始化推送供应商
            PushSenderConfig.InitSender();
        }
Пример #8
0
 public UserService(IUserRepository userRepo, IMsgService msgService)
 {
     _userRepo   = userRepo;
     _msgService = msgService;
 }
 /// <summary>
 /// MessageController
 /// </summary>
 /// <param name="service">注入 IMsgService</param>
 public MessageController(IMsgService service)
 {
     _service = service;
 }
 public UserController(IUserService userService, IMsgService msgService)
 {
     _userService = userService;
     _msgService  = msgService;
 }
Пример #11
0
 public HomeController(IMsgService msgservice)
 {
     _msgservice = msgservice;
 }
Пример #12
0
 public MsgsController(IMsgService repo)
 {
     this._repo = repo;
 }
Пример #13
0
 public MsgPatchBuilder(IMsgService msgService, ModInfo mod)
 {
     _msgService = msgService;
     _mod        = mod;
 }
Пример #14
0
 public MsgBlockService(ModInfo mod, IMsgService msgService)
 {
     _msgService = msgService;
     _mod        = mod;
     BlockCount  = msgService.BlockCount;
 }
Пример #15
0
 public TextTests()
 {
     _msgService = new MsgService();
 }