コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: ReCaD2016/ReCaD-2.0
        public MainPage()
        {
            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
            this.InitializeComponent();
            this.agentConnection.OnDataReceived += Agent_OnDataReceived;
            this.agentConnection.OnSlideEnded += AgentConnection_OnSlideEnded;
            this.agentConnection.OnConnectionFailed += AgentConnection_OnConnectionFailed;

            var webpage1 = new Webpage("http://www.google.at");
            var webpage2 = new Webpage("http://www.youtube.com");

            var screen1 = new ScreenCapture("10.101.150.13", "firefox");
            var screen2 = new ScreenCapture("10.101.150.13", "notepad++");

            var slide1 = new Slide(1000, webpage1);
            var slide2 = new Slide(10000, screen1);
            var slide3 = new Slide(3000, webpage2);
            var slide4 = new Slide(10000, screen2);

            var config = new Configuration(new List<Slide>() { slide1,slide2,slide3,slide4 });

            Task.Run(() => { this.ConfigurationWorker(config); });

            //StartVideo();
        }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ApiClient" /> class
        /// with default base path (https://api.profitbricks.com/rest/v2).
        /// </summary>
        /// <param name="config">An instance of Configuration.</param>
        public ApiClient(Configuration config = null)
        {
            if (config == null)
                Configuration = Configuration.Default;
            else
                Configuration = config;

            RestClient = new RestClient("https://api.profitbricks.com/rest/v2");
        }
コード例 #3
0
        private void Configure()
        {
            configuration = new Configuration
            {
                Username = "******",
                Password = "******",

            };
            imageApi = new ImageApi(configuration);
        }
コード例 #4
0
ファイル: ProtocolSv.cs プロジェクト: JGunning/OpenAIM
 private void SendData(string network, string data, Configuration.Priority priority = Configuration.Priority.Normal)
 {
     Datagram line = new Datagram("RAW", data);
     string Pr = "Normal";
     switch (priority)
     {
         case Configuration.Priority.High:
             Pr = "High";
             break;
         case Configuration.Priority.Low:
             Pr = "Low";
             break;
     }
     line.Parameters.Add("network", network);
     line.Parameters.Add("priority", Pr);
     Deliver(line);
 }
コード例 #5
0
ファイル: ProtocolSv.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Send a raw data to irc server you pick, you should always fill in network, or current network will be used
 /// </summary>
 /// <param name="text">Message</param>
 /// <param name="priority">priority</param>
 /// <param name="network">This value must be filled in - it's not required because some old functions do not provide it</param>
 public override void Transfer(string text, Configuration.Priority priority = Configuration.Priority.Normal, Network network = null)
 {
     if (network == null)
     {
         if (Core.SelectedNetwork != null && NetworkList.Contains(Core.SelectedNetwork))
         {
             Datagram data = new Datagram("RAW", text);
             data.Parameters.Add("network", Core.SelectedNetwork.ServerName);
             Deliver(data);
             return;
         }
     }
     else
     {
         if (NetworkList.Contains(network))
         {
             Datagram data = new Datagram("RAW", text);
             data.Parameters.Add("network", network.ServerName);
             Deliver(data);
         }
         else
         {
             Core.DebugLog("Network is not a part of this services connection " + network.ServerName);
         }
     }
 }
コード例 #6
0
ファイル: ProtocolSv.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Self
 /// </summary>
 /// <param name="text"></param>
 /// <param name="to"></param>
 /// <param name="_priority"></param>
 /// <returns></returns>
 public override int Message2(string text, string to, Configuration.Priority _priority = Configuration.Priority.Normal)
 {
     Core.SystemForm.Chat.scrollback.InsertText(Configuration.CurrentSkin.Message2 + Core.SelectedNetwork.Nickname + " " + text, Client.ContentLine.MessageStyle.Action, true, 0, true);
     Transfer("PRIVMSG " + to + " :" + delimiter.ToString() + "ACTION " + text + delimiter.ToString(), _priority);
     return 0;
 }
コード例 #7
0
ファイル: ProtocolSv.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Send a message to network
 /// </summary>
 /// <param name="text">Text of message</param>
 /// <param name="to">Who is supposed to receive it</param>
 /// <param name="network">Network where it is sent</param>
 /// <param name="_priority">Priority</param>
 /// <param name="pmsg">Whether it is supposed to be considered a private message</param>
 /// <returns></returns>
 public override int Message(string text, string to, Network network, Configuration.Priority _priority = Configuration.Priority.Normal, bool pmsg = false)
 {
     Datagram message = new Datagram("MESSAGE", text);
     if (network != null && NetworkList.Contains(network))
     {
         message.Parameters.Add("network", network.ServerName);
         message.Parameters.Add("priority", _priority.ToString());
         message.Parameters.Add("to", to);
         Deliver(message);
     }
     else
     {
         Core.DebugLog("Invalid network for message to: " + to);
     }
     return 0;
 }
コード例 #8
0
ファイル: ProtocolIrc.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Send a message to server
 /// </summary>
 /// <param name="Message"></param>
 /// <param name="Pr"></param>
 public void DeliverMessage(string Message, Configuration.Priority Pr = Configuration.Priority.Normal)
 {
     Message text = new Message();
     text._Priority = Pr;
     text.message = Message;
     lock (messages)
     {
         messages.Add(text);
         return;
     }
 }
コード例 #9
0
ファイル: ProtocolIrc.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Transfer
 /// </summary>
 /// <param name="text"></param>
 /// <param name="priority"></param>
 /// <param name="network"></param>
 public override void Transfer(string text, Configuration.Priority priority = Configuration.Priority.Normal, Network network = null)
 {
     Messages.DeliverMessage(text, priority);
 }
コード例 #10
0
ファイル: Protocol.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Send a message to server
 /// </summary>
 /// <param name="text">Message</param>
 /// <param name="to">User or a channel (needs to be prefixed with #)</param>
 /// <param name="network"></param>
 /// <param name="priority"></param>
 /// <param name="pmsg"></param>
 /// <returns></returns>
 public virtual int Message(string text, string to, Network network, Configuration.Priority priority = Configuration.Priority.Normal, bool pmsg = false)
 {
     Core.DebugLog("Message(string text, string to, Network network, Configuration.Priority priority = "
         +"Configuration.Priority.Normal, bool pmsg = false) is not implemented");
     return 2;
 }
コード例 #11
0
ファイル: ProtocolIrc.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Send a message either to channel or user
 /// </summary>
 /// <param name="text"></param>
 /// <param name="to"></param>
 /// <param name="priority"></param>
 /// <param name="pmsg"></param>
 /// <returns></returns>
 public override int Message(string text, string to, Configuration.Priority priority = Configuration.Priority.Normal, bool pmsg = false)
 {
     Message(text, to, null, priority, pmsg);
     return 0;
 }
コード例 #12
0
ファイル: MainPage.xaml.cs プロジェクト: ReCaD2016/ReCaD-2.0
 private async void ConfigurationWorker(Configuration config)
 {
     while (true)
     {
         foreach(var slide in config.Diashow)
         {
             if(slide.Content is ScreenCapture)
             {
                 this.agentConnection.ConnectTo(slide);
             }
             else if(slide.Content is Webpage)
             {
                 var webpage = slide.Content as Webpage;
                 await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.High,() =>
                 {
                     web.Source = new Uri(webpage.URL);
                     web.LoadCompleted += Web_LoadCompleted;
                 });
             }
             await Task.Delay(slide.AppearanceDuration);
         }   
     }
 }
コード例 #13
0
ファイル: Protocol.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// /me
 /// </summary>
 /// <param name="text"></param>
 /// <param name="to"></param>
 /// <param name="priority"></param>
 /// <returns></returns>
 public virtual int Message2(string text, string to, Configuration.Priority priority = Configuration.Priority.Normal)
 {
     Core.DebugLog("Message2(string text, string to, Configuration.Priority priority = Configuration.Priority.Normal) is not implemented");
     return 2;
 }
コード例 #14
0
ファイル: Network.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Send a message to network
 /// </summary>
 /// <param name="text">Text of message</param>
 /// <param name="to">Sending to</param>
 /// <param name="_priority">Priority</param>
 /// <param name="pmsg">If this is private message (so it needs to be handled in a different way)</param>
 public void Message(string text, string to, Configuration.Priority _priority = Configuration.Priority.Normal, bool pmsg = false)
 {
     _Protocol.Message(text, to, this, _priority, pmsg);
 }
コード例 #15
0
ファイル: ProtocolIrc.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Send a message either to channel or user
 /// </summary>
 /// <param name="text"></param>
 /// <param name="to"></param>
 /// <param name="network"></param>
 /// <param name="priority"></param>
 /// <param name="pmsg"></param>
 /// <returns></returns>
 public override int Message(string text, string to, Network network, Configuration.Priority priority = Configuration.Priority.Normal, bool pmsg = false)
 {
     if (!pmsg)
     {
         Core.SystemForm.Chat.scrollback.InsertText(Protocol.PRIVMSG(_IRCNetwork.Nickname, text), Client.ContentLine.MessageStyle.Message, true, 0, true);
     }
     Transfer("PRIVMSG " + to + " :" + text, priority);
     return 0;
 }
コード例 #16
0
ファイル: Network.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Transfer data to this network server
 /// </summary>
 /// <param name="data"></param>
 /// <param name="_priority"></param>
 public void Transfer(string data, Configuration.Priority _priority = Configuration.Priority.Normal)
 {
     if (!string.IsNullOrEmpty(data))
     {
         _Protocol.Transfer(data, _priority, this);
     }
 }
コード例 #17
0
ファイル: Protocol.cs プロジェクト: JGunning/OpenAIM
 /// <summary>
 /// Deliver raw data to server
 /// </summary>
 /// <param name="data"></param>
 /// <param name="priority"></param>
 /// <param name="network"></param>
 public virtual void Transfer(string data, Configuration.Priority priority = Configuration.Priority.Normal, Network network = null)
 {
     Core.DebugLog("Transfer(string data, Configuration.Priority _priority = Configuration.Priority.Normal, Network network = null) is not implemented");
 }