Example #1
0
        /// <summary>
        /// process new mail from shared inbox
        /// </summary>
        /// <param name="NewItem"></param>
        private void SharedItems_ItemAdd(object NewItem)
        {
            Outlook.MailItem mail = (Outlook.MailItem)NewItem;    //New mail object
            MailParser(mail);                                     //process the mail for manifolds.
            /// <summary>
            /// The following code uses the tulpep/notification-popup library from nuget
            /// to display a new e-mail popup on the lower right corner of the screen
            /// as the shared inbox does not provide a new e-mail notification popup
            /// stock from Outlook.
            /// </summary>
            try
            {
                Size size          = new Size(48, 48);
                var  popupNotifier = new Tulpep.NotificationWindow.PopupNotifier();
                popupNotifier.TitleText     = "New Mail";
                popupNotifier.ContentText   = "From " + mail.SenderName + "\n" + mail.Subject;
                popupNotifier.IsRightToLeft = false;
                popupNotifier.Image         = image(mail);
                popupNotifier.ImageSize     = size;
                popupNotifier.Popup();
                popupNotifier.Click += Popup_Click;
            }
            catch (Exception) { }

            void Popup_Click(object sender, EventArgs e)
            {
                try
                {
                    mail.Display(true);
                }
                catch (Exception)
                { }
            }
        }
        public static void bildirim(string Baslik, string text)
        {
            Tulpep.NotificationWindow.PopupNotifier popupNotifier = new Tulpep.NotificationWindow.PopupNotifier();
            popupNotifier.TitleText   = Baslik;
            popupNotifier.ContentText = text;

            popupNotifier.Popup();
        }
        public CoinMasterForm()
        {
            InitializeComponent();
            buttonEditNodeProfile_Click(null, EventArgs.Empty);
            ReadNodeProfiles();

            //Create pop-up
            notifier        = new Tulpep.NotificationWindow.PopupNotifier();
            notifier.Delay  = 10000;
            notifier.Click += (sender, eventArgs) =>
            {
                Visible = true;
                BringToFront();
            };

            //Create workers
            cryptoIdWorker              = new CryptoIdWorker(60000, new NodeEndpointName("Stratis", "StratisTest"));
            cryptoIdWorker.StateChange += DashboardWorkerStateChanged;
            cryptoIdWorker.DataUpdate  += (source, args) => Invoke(new Action <object, CryptoIdDataUpdateEventArgs>(CryptoIdUpdated), source, args);
            _workers.Add(cryptoIdWorker);

            //Start all workers
            foreach (BaseWorker worker in _workers)
            {
                worker.Start();
            }


            ClientConfigReader reader = new ClientConfigReader();

            clientConfig = reader.ReadConfig();
            List <String> agentList = clientConfig.GetAgentList();

            this.managedNodes = new NodeNetwork();
            foreach (string fullNodeName in clientConfig.NodeItems.Keys)
            {
                BlockchainNode blockchainNode = new BlockchainNode(clientConfig.NodeItems[fullNodeName]);
                this.managedNodes.Nodes.Add(fullNodeName, blockchainNode);
            }

            clientConnectionManager = new AgentConnectionManager(managedNodes);

            clientConnectionManager.Session.AgentHealthcheckStatsUpdated += (agentConnection, state, message) => Invoke(new Action <AgentConnection, AgentHealthState, String>(AgentDataTableUpdated), agentConnection, state, message);
            clientConnectionManager.Session.NodesUpdated             += (agentConnection, updatedNodes) => Invoke(new Action <AgentConnection, NodeNetwork>(NodeDataUpdated), agentConnection, updatedNodes);
            clientConnectionManager.Session.AgentRegistrationUpdated += (agentConnection, agentRegistration) => Invoke(new Action <AgentConnection, AgentRegistration>(AgentRegistrationUpdated), agentConnection, agentRegistration);

            clientConnectionManager.ConnectToAgents(agentList);
        }