public static void Main(string[] args)
 {
     Application.Init ();
     NotificationAreaMessage msg = new NotificationAreaMessage
     ("msg.svg", NotificationSource.File, NotificationContent.Svg);
     msg.BubbleWidth = 250;
     msg.BubbleHeight = 50;
     msg.TimeOut = 5000; //milliseconds
     msg.TimerEndedEvent += TimerEnded;
     msg.Notify ();
     Application.Run ();
 }
        public static void ShowHtmlNotification(string source, NotificationSource nsource,
						    int width, int height,
						    int timeout, TimerEndedHandler thandler)
        {
            NotificationAreaMessage msg = new NotificationAreaMessage (source, nsource, NotificationContent.Html);
            msg.BubbleWidth = width;
            if (thandler != null)
            msg.TimerEndedEvent += thandler;
            msg.BubbleHeight = height;
            msg.TimeOut = timeout;
            msg.Notify ();
        }
예제 #3
0
        private static void ShowSvgNotification(string source,
                                                NotificationSource nsource,
                                                string header,
                                                string body,
                                                int timeout,
                                                int width,
                                                int height,
                                                NotificationType type,
                                                TimerEndedHandler thandler)
        {
            Stream stream;
            string svg = "";

            if (source == null)
            {
                NotificationFactory factory  = new NotificationFactory();
                Assembly            assembly = Assembly.GetAssembly(factory.GetType());
                stream = assembly.GetManifestResourceStream(type.ToString() + ".svg");
                StreamReader reader = new StreamReader(stream);
                svg = reader.ReadToEnd();
                reader.Close();
                stream.Close();
            }
            else
            {
                if (nsource == NotificationSource.File)
                {
                    stream = new FileStream(source, FileMode.Open, FileAccess.Read);
                    StreamReader reader = new StreamReader(stream);
                    svg = reader.ReadToEnd();
                    reader.Close();
                    stream.Close();
                }
                else if (nsource == NotificationSource.Text)
                {
                    svg = source;
                }
            }

            svg = ReplaceMacros(svg, header, body);
            NotificationAreaMessage msg = new NotificationAreaMessage(svg, NotificationSource.Text, NotificationContent.Svg);

            if (thandler != null)
            {
                msg.TimerEndedEvent += thandler;
            }
            msg.TimeOut      = timeout;
            msg.BubbleWidth  = width;
            msg.BubbleHeight = height;
            msg.Notify();
        }
예제 #4
0
        public static void ShowHtmlNotification(string source, NotificationSource nsource,
                                                int width, int height,
                                                int timeout, TimerEndedHandler thandler)
        {
            NotificationAreaMessage msg = new NotificationAreaMessage(source, nsource, NotificationContent.Html);

            msg.BubbleWidth = width;
            if (thandler != null)
            {
                msg.TimerEndedEvent += thandler;
            }
            msg.BubbleHeight = height;
            msg.TimeOut      = timeout;
            msg.Notify();
        }
        private static void ShowSvgNotification(string source,
						NotificationSource nsource,
						string header,
						string body,
						int timeout,
						int width,
						int height,
						NotificationType type,
						TimerEndedHandler thandler)
        {
            Stream stream;
            string svg = "";
            if (source == null)
            {
            NotificationFactory factory = new NotificationFactory ();
            Assembly assembly = Assembly.GetAssembly (factory.GetType ());
            stream = assembly.GetManifestResourceStream (type.ToString () + ".svg");
            StreamReader reader = new StreamReader (stream);
            svg = reader.ReadToEnd ();
            reader.Close ();
            stream.Close ();
            } else {
            if (nsource == NotificationSource.File) {
            stream = new FileStream (source, FileMode.Open, FileAccess.Read);
            StreamReader reader = new StreamReader (stream);
            svg = reader.ReadToEnd ();
            reader.Close ();
            stream.Close ();
            } else if (nsource == NotificationSource.Text)
            svg = source;
            }

            svg = ReplaceMacros (svg, header, body);
            NotificationAreaMessage msg = new NotificationAreaMessage (svg, NotificationSource.Text, NotificationContent.Svg);
            if (thandler != null)
            msg.TimerEndedEvent += thandler;
            msg.TimeOut = timeout;
            msg.BubbleWidth = width;
            msg.BubbleHeight = height;
            msg.Notify ();
        }