|
I'm trying to create an email class with a NewMessage procedure that returns an instance of a message class. It errors with "Inconsistent accessibility: return type Stuff.Email.Procedures.EmailMessage' is less accessible than method 'Marois.Email.Procedures.EmailProcedures.NewMessage()'"
using System;
namespace Stuff.Email.Procedures
{
public class EmailProcedures
{
public EmailMessage NewMessage()
{
return new EmailMessage();
}
}
internal class EmailMessage
{
}
}
Everything Makes Sense In Someones Mind
|
|
|
|
|
A method that calls NewMessage() wouldn't have access to EmailMessage.
|
|
|
|
|
I was hoping to have the EmailMessage class invisible to outside classes, and only make it accessable from the main class.
How do I code this?
Everything Makes Sense In Someones Mind
|
|
|
|
|
If it's invisible, you can't return it. That's the issue. You can make the constructor inaccessible and have a factory method, so that users can't create one, but they can ask for one.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
That is because you have a public method EmailMessage, returning a less accessable object, the internal EmailMessage. Internal is only accessable within the same assembly, and in most cases is the same as the access modifier private.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Dear Reader,
I have this problem - due to my absolute beginners level.
From some tools I have an xml-file as an output.
Now I want make a nice presentation of this xml-file. e.g. in a Ms-Word-Document or as and html-page, which can be displaye via inet-explorer.
I think this can be done via some xslt-transformation?
But I dont know.
Can somebody give me some hints/links how this task can be done?
Thank you for your help
|
|
|
|
|
What do you mean by 'nice presentation'? You can view a XML file in your browser as is. If you don't want to have it look like a typical XML file, you will need to parse it and display it the way you want.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Hallo,
What I want to do is e.g. to format the raw xml-file to a nice looking html page with chapters, subchapters, colored chapternames,.. and all that nice stuff.
Or I want to format the raw-xml-data to ms-word-document
Thank you for your reply
|
|
|
|
|
Yes, you're right, you would need to write an XSLT to get HTML from XML. It's not that hard to learn if you know some XML. For starters I would recommend www.w3schools.com/[^]. They have a nice introduction and some basic examples to get you started. There are tools which make writing XSLT files easier (WYSISYG-like), but I didn't find a free one. I ended up writing mine by hand, in VS.
Good luck!
|
|
|
|
|
For 3 days i searching for a solution and its no where found in the net,
My problem is that i have to create an set up for excel2003 addin using .net2008,
but i didn't find any solutions , so why Microsoft hasn't given any solution or documentation ,
FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up FED up
|
|
|
|
|
Sorry, but this isn't really the right forum for this. This is a rant, so you should take it to a rantier forum.
|
|
|
|
|
So what i do mylord ?
To get rid of this problem
|
|
|
|
|
Mogaambo wrote: So what i do mylord ?
At least you know your place underling.
Well, there's the General Discussion forum and the Lounge and the Soapbox and the .NET Forum. Take your pick - oh, and I don't mind that you downvoted me for my observation. Honestly I don't. Now, feel free to downvote this one as well - I like the grey.
|
|
|
|
|
when i create a excel 2003 addin a setup poject is created as well. If not then create a new setup/deployment project. Basically, you need to follow these steps:
http://msdn.microsoft.com/en-us/library/cc136646.aspx
Don't forget about the "Custom actions" part or it won't work.
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
I making a quick little program that'll let me view all the fonts installed on a given computer. Pressing the right arrow goes to the next font, pressing the left arrow goes to the previous font. So how would I go about getting a list of installed fonts at run time?
modified on Wednesday, August 13, 2008 3:48 PM
|
|
|
|
|
List<string> LobjFontList = new List<string>();InstalledFontCollection LobjFonts = new InstalledFontCollection();foreach (FontFamily LobjFamily in LobjFonts.Families){LobjFontList.Add(LobjFamily.Name);}
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
|
What's involved in reading and writing data to/from a mainframe in C#?
Everything Makes Sense In Someones Mind
|
|
|
|
|
Can you be more specific? There's a gazillion ways to read/write data from another computer.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
The organization I work for has an app that's been around for many years and runs on an AS400. There has been talk of having me convert it to a WinForms app, so I was hoping to brush up on the data connection aspect of it.
I have no clue what's involved in accessing data on an AS400 from a WinForms app.
Everything Makes Sense In Someones Mind
|
|
|
|
|
This again totally depends on how the old app accessed the data. It might by anything, reading a file, connecting to a database, using some sort of RPC or IPC.
Maybe you can find some documentation for the old application that describes the data access in detail.
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
If window is resized, listbox flashes.
how to remove flash during resize ?
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Drawing;
public class Test
{
static void Main()
{
Application.Run(new ReportDialogForm());
}
}
class ReportDialogForm : Form
{
public ReportDialogForm()
{
tabControl1 = new TabControl();
tabPage1 = new TabPage();
reportListBox = new ListBox();
tabControl1.Anchor = ((AnchorStyles)((((AnchorStyles.Top | AnchorStyles.Bottom)
| AnchorStyles.Left)
| AnchorStyles.Right)));
tabControl1.Controls.Add(tabPage1);
tabControl1.Location = new Point(0, 0);
tabControl1.Padding = new Point(0, 0);
tabControl1.SelectedIndex = 0;
tabControl1.Size = new Size(591, 296);
tabControl1.TabIndex = 0;
tabPage1.Controls.Add(reportListBox);
tabPage1.Location = new Point(4, 29);
tabPage1.Margin = new Padding(0);
tabPage1.Size = new Size(583, 263);
tabPage1.TabIndex = 0;
tabPage1.Layout += new LayoutEventHandler(tabPage1_Layout);
reportListBox.Anchor = AnchorStyles.None;
reportListBox.Size = new Size(287, 384);
reportListBox.TabIndex = 1000;
ClientSize = new Size(588, 292);
Controls.Add(tabControl1);
for (int i = 0; i < 100; i++)
reportListBox.Items.Add( "MMMMMMMMMMMMMMMMMMMMMM");
Load += new EventHandler(ReportDialogForm_Load);
}
void ReportDialogForm_Load(object sender, EventArgs e)
{
StartPosition = FormStartPosition.Manual;
Location = new Point(10, 10);
ClientSize = new Size(400, 400);
}
void tabPage1_Layout(object sender, LayoutEventArgs e)
{
SuspendLayout();
int height = 100;
reportListBox.Top = height;
reportListBox.Height = tabPage1.Height - height;
reportListBox.Width = tabPage1.Width / 2;
reportListBox.Left = 0;
ResumeLayout();
}
TabControl tabControl1;
TabPage tabPage1;
ListBox reportListBox;
}
Andrus
|
|
|
|
|
In the form's properties there's an option "DoubleBuffered" try setting it to true.
|
|
|
|
|
Thank you.
I added DoubleBuffered = true; as first line in constructor:
public ReportDialogForm()
{
DoubleBuffered = true;
...
However, listbox still blinks on resize.
Adding DoubleBuffered did not make any difference.
Andrus
|
|
|
|
|
Good people,
Over the next year or two, I will be building applications to perform specific tasks related to my job. However, I want these specific applications to end up comprising one application. So for example, when I finish the first app, I want to add the second app to it. This will enable me to have a very useful application that performs different but related tasks.
My question is, what strategy should I pursue to do this effectively. You see, while the tasks are different, they all are related to some type of data analysis and processing. That's why it would be great to have it as one application with components being added.
Let me know your thoughts.
Thanks in advance.
BP
|
|
|
|