コード例 #1
0
ファイル: HostHolder.cs プロジェクト: Liklainy/ReportServer
        public HostHolder()
        {
            _nancyHost = new NancyHost(
                new Uri("http://localhost:12345"),
                new Bootstrapper(),
                HostConfigs);

            _monik = Bootstrapper.Global.Resolve <IClientControl>();
            _monik.ApplicationInfo("HostHolder.ctor");
        }
コード例 #2
0
        public ControlClientUsingSessionProperties()
        {
            _session = Diffusion.Sessions.Principal("control").Password("password")
                       .Open("ws.//diffusion.example.com:80");

            _clientControl       = _session.GetClientControlFeature();
            _subscriptionControl = _session.GetSubscriptionControlFeature();

            // Configure a listener which will be notified firstly of all open client sessions and then of all that
            // subsequently open. All that are in the Italian accounts department get subscribed to the current topic.
            // Only the country and department properties are requested.

            // Set up a listener to receive notification of all sessions
            _clientControl.SetSessionPropertiesListener(new PropertiesListener(
                                                            _subscriptionControl, CurrentTopic, _subscriptionCallback), "$Country", "Department");
        }
        public ControlClientUsingSessionProperties()
        {
            _session = Diffusion.Sessions.Principal( "control" ).Password( "password" )
                .Open( "ws.//diffusion.example.com:80" );

            _clientControl = _session.GetClientControlFeature();
            _subscriptionControl = _session.GetSubscriptionControlFeature();

            // Configure a listener which will be notified firstly of all open client sessions and then of all that
            // subsequently open. All that are in the Italian accounts department get subscribed to the current topic.
            // Only the country and department properties are requested.

            // Set up a listener to receive notification of all sessions
            _clientControl.SetSessionPropertiesListener( new PropertiesListener(
                _subscriptionControl, CurrentTopic, _subscriptionCallback ), "$Country", "Department" );
        }
コード例 #4
0
ファイル: RTask.cs プロジェクト: Liklainy/ReportServer
        public RTask(ILifetimeScope autofac, IPostMaster postMaster, IRepository repository,
                     IClientControl monik, IMapper mapper, IArchiver archiver, ITelegramBotClient botClient,
                     int id, string reportName, string template, DtoSchedule schedule, string connStr, string query,
                     long chatId, RRecepientGroup sendAddress, int tryCount, int timeOut,
                     RReportType reportType, int reportId, bool htmlBody, bool jsonAttach)
        {
            Type = reportType;

            switch (Type)
            {
            case RReportType.Common:
                _dataEx = autofac.ResolveNamed <IDataExecutor>("commondataex");
                _viewEx = autofac.ResolveNamed <IViewExecutor>("commonviewex");
                break;

            case RReportType.Custom:
                _dataEx = autofac.ResolveNamed <IDataExecutor>(query);
                _viewEx = autofac.ResolveNamed <IViewExecutor>(template);
                break;

            default:
                throw new NotImplementedException();
            }

            _archiver         = archiver;
            _postMaster       = postMaster;
            Id                = id;
            ReportName        = reportName;
            Query             = query;
            ChatId            = chatId;
            ViewTemplate      = template;
            ReportId          = reportId;
            SendAddresses     = sendAddress;
            Schedule          = schedule;
            _repository       = repository;
            TryCount          = tryCount;
            QueryTimeOut      = timeOut;
            ConnectionString  = connStr;
            HasHtmlBody       = htmlBody;
            HasJsonAttachment = jsonAttach;
            _monik            = monik;
            _mapper           = mapper;
            _bot              = botClient;
        }
コード例 #5
0
        public Logic(ILifetimeScope autofac, IRepository repository, IClientControl monik,
                     IMapper mapper, IArchiver archiver, ITelegramBotClient bot)
        {
            _autofac    = autofac;
            _mapper     = mapper;
            _monik      = monik;
            _archiver   = archiver;
            _bot        = bot;
            _repository = repository;

            _checkScheduleAndExecuteScheduler = new Scheduler {
                Period = 60, TaskMethod = CheckScheduleAndExecute
            };
            _tableView = _autofac.ResolveNamed <IViewExecutor>("tasklistviewex");

            _recepientGroups  = new List <RRecepientGroup>();
            _schedules        = new List <DtoSchedule>();
            _reports          = new List <DtoReport>();
            _telegramChannels = new ConcurrentDictionary <long, DtoTelegramChannel>();
            _tasks            = new List <IRTask>();
            _bot.OnUpdate    += OnBotUpd;
        } //ctor
コード例 #6
0
        public ClientMainWindow()
        {
            try
            {
                InitializeComponent();
                log4net.Config.BasicConfigurator.Configure();
                _logger = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().ToString());

                string serverHost = txtServer.Text.ToString();
                string localIP = ConfigurationManager.AppSettings["localIP"];

                _threadMouse = new Thread(delegate() { MouseThread(); });
                _threadDesktop = new Thread(delegate() { DesktopThread(); });

                _clientModel = new RemotingClient(localIP, serverHost, OnDesktopChanged);
                _clientControl = new ClientControl(_clientModel, this);
                WireUp(_clientControl, _clientModel);
                Update(_clientModel);
            }
            catch (Exception ex)
            {
                  MessageBox.Show(ex.ToString());
            }
        }
コード例 #7
0
 public MyThresholdHandler(IClientControl clientControl, IClientCallback clientCallback)
 {
     theClientControl  = clientControl;
     theClientCallback = clientCallback;
 }
コード例 #8
0
 private void WireUp(IClientControl clientControl, IClientModel clientModel)
 {
     try
     {
         if (_clientModel != null)
         {
             _clientModel.RemoveObserver(this);
         }
         _clientModel = clientModel;
         _clientControl = clientControl;
         _clientControl.SetModel(_clientModel);
         _clientControl.SetView(this);
         _clientModel.AddObserver(this);
     }
     catch (Exception ex)
     {
           MessageBox.Show(ex.ToString());
     }
 }
コード例 #9
0
 public PostMasterWork(IClientControl monik)
 {
     _monik = monik;
 }
 public MyThresholdHandler( IClientControl clientControl, IClientCallback clientCallback )
 {
     theClientControl = clientControl;
     theClientCallback = clientCallback;
 }
コード例 #11
0
ファイル: Form1.cs プロジェクト: Riccon/remote-desktop
        private void Form1_Load(object sender, System.EventArgs e)
        {
            // set the image capture size
            this.WebCamCapture.CaptureHeight = this.pictureBox1.Height;
            this.WebCamCapture.CaptureWidth = this.pictureBox1.Width;
            string serverIP = ConfigurationManager.AppSettings["serverIP"];
            string serverHost = "http://" + serverIP + ":8083/SingletonServer";
            string localIP = ConfigurationManager.AppSettings["localIP"];

            //_threadMouse = new Thread(delegate() { MouseThread(); });
            //_threadDesktop = new Thread(delegate() { DesktopThread(); });

            _clientModel = new RemotingClient(localIP, serverHost, null);
            _clientControl = new ClientControl(_clientModel, null);
        }
コード例 #12
0
 public ClientControlPresenter(IClientControl control, ICacheService cache, IErrorLogger errorLogger, IDeserializer serializer) : base(cache, errorLogger, serializer)
 {
     _control = control;
     _control.OnShowClientForm += OnShowClientForm;
     _control.ClientSelected   += OnCellSelected;
 }