Inheritance: System.Windows.Forms.Form
Ejemplo n.º 1
0
        // show messages
        internal static DialogResult ShowMessages()
        {
            formMessages Dialog = new formMessages();

            Dialog.listviewMessages.Items.Clear();
            for (int i = 0; i < Interface.MessageCount; i++)
            {
                string t = "Unknown";
                switch (Interface.Messages[i].Type)
                {
                case Interface.MessageType.Information:
                    t = "Information";
                    break;

                case Interface.MessageType.Warning:
                    t = "Warning";
                    break;

                case Interface.MessageType.Error:
                    t = "Error";
                    break;

                case Interface.MessageType.Critical:
                    t = "Critical";
                    break;
                }
                ListViewItem a = Dialog.listviewMessages.Items.Add(t);
                a.SubItems.Add(Interface.Messages[i].Text);
            }
            Dialog.listviewMessages.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            DialogResult Result = Dialog.ShowDialog();

            Dialog.Dispose();
            return(Result);
        }
Ejemplo n.º 2
0
		// show messages
		internal static DialogResult ShowMessages() {
			formMessages Dialog = new formMessages();
			Dialog.listviewMessages.Items.Clear();
			for (int i = 0; i < Interface.MessageCount; i++) {
				string t = "Unknown";
				switch (Interface.Messages[i].Type) {
					case Interface.MessageType.Information:
						t = "Information";
						break;
					case Interface.MessageType.Warning:
						t = "Warning";
						break;
					case Interface.MessageType.Error:
						t = "Error";
						break;
					case Interface.MessageType.Critical:
						t = "Critical";
						break;
				}
				ListViewItem a = Dialog.listviewMessages.Items.Add(t);
				a.SubItems.Add(Interface.Messages[i].Text);
			}
			Dialog.listviewMessages.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
			DialogResult Result = Dialog.ShowDialog();
			Dialog.Dispose();
			return Result;
		}
Ejemplo n.º 3
0
        // show messages
        internal static DialogResult ShowMessages()
        {
            formMessages Dialog = new formMessages();

            Dialog.listviewMessages.SmallImageList = new ImageList();
            string Folder = Program.FileSystem.GetDataFolder("Menu");

            try {
                Dialog.listviewMessages.SmallImageList.Images.Add("information", Image.FromFile(OpenBveApi.Path.CombineFile(Folder, "icon_information.png")));
            } catch { }
            try {
                Dialog.listviewMessages.SmallImageList.Images.Add("warning", Image.FromFile(OpenBveApi.Path.CombineFile(Folder, "icon_warning.png")));
            } catch { }
            try {
                Dialog.listviewMessages.SmallImageList.Images.Add("error", Image.FromFile(OpenBveApi.Path.CombineFile(Folder, "icon_error.png")));
            } catch { }
            try {
                Dialog.listviewMessages.SmallImageList.Images.Add("critical", Image.FromFile(OpenBveApi.Path.CombineFile(Folder, "icon_critical.png")));
            } catch { }
            for (int i = 0; i < Interface.MessageCount; i++)
            {
                string t = "Unknown";
                string g = "information";
                switch (Interface.Messages[i].Type)
                {
                case Interface.MessageType.Information:
                    t = "Information";
                    g = "information";
                    break;

                case Interface.MessageType.Warning:
                    t = "Warning";
                    g = "warning";
                    break;

                case Interface.MessageType.Error:
                    t = "Error";
                    g = "error";
                    break;

                case Interface.MessageType.Critical:
                    t = "Critical";
                    g = "critical";
                    break;
                }
                ListViewItem a = Dialog.listviewMessages.Items.Add(t, g);
                a.SubItems.Add(Interface.Messages[i].Text);
            }
            Dialog.listviewMessages.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
            DialogResult Result = Dialog.ShowDialog();

            Dialog.Dispose();
            return(Result);
        }
Ejemplo n.º 4
0
 // show messages
 internal static DialogResult ShowMessages()
 {
     formMessages Dialog = new formMessages();
     Dialog.listviewMessages.SmallImageList = new ImageList();
     string Folder = Interface.GetDataFolder("Menu");
     try {
         Dialog.listviewMessages.SmallImageList.Images.Add("information", Image.FromFile(Interface.GetCombinedFileName(Folder, "icon_information.png")));
     } catch { }
     try {
         Dialog.listviewMessages.SmallImageList.Images.Add("warning", Image.FromFile(Interface.GetCombinedFileName(Folder, "icon_warning.png")));
     } catch { }
     try {
         Dialog.listviewMessages.SmallImageList.Images.Add("error", Image.FromFile(Interface.GetCombinedFileName(Folder, "icon_error.png")));
     } catch { }
     try {
         Dialog.listviewMessages.SmallImageList.Images.Add("critical", Image.FromFile(Interface.GetCombinedFileName(Folder, "icon_critical.png")));
     } catch { }
     for (int i = 0; i < Interface.MessageCount; i++) {
         string t = "Unknown";
         string g = "information";
         switch (Interface.Messages[i].Type) {
             case Interface.MessageType.Information:
                 t = "Information";
                 g = "information";
                 break;
             case Interface.MessageType.Warning:
                 t = "Warning";
                 g = "warning";
                 break;
             case Interface.MessageType.Error:
                 t = "Error";
                 g = "error";
                 break;
             case Interface.MessageType.Critical:
                 t = "Critical";
                 g = "critical";
                 break;
         }
         ListViewItem a = Dialog.listviewMessages.Items.Add(t, g);
         a.SubItems.Add(Interface.Messages[i].Text);
     }
     Dialog.listviewMessages.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
     DialogResult Result = Dialog.ShowDialog();
     Dialog.Dispose();
     return Result;
 }