|
OriginalGriff wrote: When you cast from a float to an integer, it knows what to do: Throw away any digits to the left of the decimal point. ???
|
|
|
|
|
Can I blame Arabic numbers?
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
OriginalGriff wrote: Can I blame Arabic numbers
You can blame them. It doesn't mean we necessarily believe you.
|
|
|
|
|
Pete O'Hanlon wrote: It doesn't mean we necessarily believe you
Damn. And it sounded like such a good excuse...
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
You got an answer the first time you posted it in questions/answers.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi,
Please guide me to create XML file using XSD.
Thanks in advance.
|
|
|
|
|
Here[^] you go. What does this have to do with C#?
|
|
|
|
|
Thanks for your reply. This was done manually from XSD to XML vice-versa. But I would like to convert XSD to XML file, programatically in C#.Net(not manually).
Hope you understood my problem
|
|
|
|
|
Ah. You want to autogenerate an XSD from an XML file. I see. One way to do this is to manually trigger the xsd.exe process in .NET using the xml file as an input to it.
|
|
|
|
|
Sorry for communicating wrongly. I would like to create XML from XSD. Could you let me know whats the command line in xsd.exe.
|
|
|
|
|
Do you want to create classes derived from an XSD file, and then use those classes for reading and writing XML files? Then you can have a look at my article Bernie’s Trackviewer[^] where I describe that with the example of the GPX schema.
|
|
|
|
|
Thanks for your reply.
Can you just give clarity on below things
1. Do we need to convert XSD to class files and class files to XML in the process of XSD->XML?
2. Is there any direct way to convert XSD->XML?
So far I followed Point1 and created class files from XSD using XSD.exe. I've seen your article and downloaded the source. Very nice article. Thanks for sharing.
Please let me know which class contains the code to create xml files from class files (generated from XSD). Please help as I'm new to XSD concept. Thank you..
|
|
|
|
|
XSD is a schema: it defines how the data look like. XML files contain data which fulfill the definition in the corresponding xsd file.
Consequently, I do not see the point of "converting" from xsd to xml.
You have some data and write them into an XML file, and the structure of the data is described in the XSD file.
As for the example project, have a look at the GPX class, the XML file is written by the ToFile method.
|
|
|
|
|
this is my code
private void button1_Click(object sender, EventArgs e)
{
if (newformtime.Visible == true)
{
timeToolStripMenuItem.Checked = false;
newformtime.Visible = false;
}
else if (newformtime.Visible == false)
{
timeToolStripMenuItem.Checked = true;
newformtime.Visible = true;
}
}
and
Time newformtime = new Time();
And for some reason, the window just wont open
|
|
|
|
|
Assuming newformtime is a Form you would also need to call newformtime.Show() or newformtime.ShowDialog() . Simply creating the object won't show it.
|
|
|
|
|
so
newformtime.Visible = true; doesn't work?
|
|
|
|
|
systemerror121 wrote: so
newformtime.Visible = true;
doesn't work?
On second thought.. that should work
|
|
|
|
|
Then what seems to be the problem? I can't figer it out, it worked for all the other buttons but this one
|
|
|
|
|
No it doesn't? That affects the visibility of a form, it doesn't show it in the first place. Use newformtime.Show(); or newformtime.ShowDialog(); to show the form.
|
|
|
|
|
I wouldn't do it in the way of just setting Visible = true but I had to try it, and when you for instance create a new form in the eventhandler of a button click and you add the code:
private void button1_Click(object sender, EventArgs e)
{
Form f2 = new Form();
f2.Visible = true;
}
The f2 form shows up. I didn't expect it would.. A bit confused about this..
|
|
|
|
|
Calla wrote: The f2 form shows up. I didn't expect it would.. A bit confused about this..
Me too - that goes counter to what I'd expect.
|
|
|
|
|
You didn't provide some essential information, such as the type of newformtime.
If it isn't a Form, then none of the code shown relates to a Form.
If it is a Form, it'd better not be the Form holding button1, as you would have a hard time clicking a button on an invisible Form.
|
|
|
|
|
Its a from, I'll just send you the whole code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Diagnostics;
using Gadgets.Properties;
namespace Gadgets
{
public partial class Form1 : Form
{
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HTCAPTION = 0x2;
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();
[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
public Form1()
{
InitializeComponent();
pictureBox2.MouseDown += new MouseEventHandler(p2_MouseDown);
}
Time newformtime = new Time();
Note newNote = new Note();
Search newSearch = new Search();
SRLS newSRLS = new SRLS();
Alarm newAlarm = new Alarm();
QuickLaunch newQuickLaunch = new QuickLaunch();
Calender newCalender = new Calender();
private void Form1_Load(object sender, EventArgs e)
{
notifyIcon1.Visible = true;
timeToolStripMenuItem.Checked = Settings.Default.timecheck;
alarmToolStripMenuItem.Checked = Settings.Default.alarmcheck;
calenderToolStripMenuItem.Checked = Settings.Default.calendercheck;
sRLSToolStripMenuItem.Checked = Settings.Default.srlscheck;
searchToolStripMenuItem.Checked = Settings.Default.searchcheck;
noteToolStripMenuItem.Checked = Settings.Default.notecheck;
quickLaunchToolStripMenuItem.Checked = Settings.Default.quickLaunchcheck;
if (timeToolStripMenuItem.Checked == true)
{
newformtime.Show();
}
if (alarmToolStripMenuItem.Checked == true)
{
newAlarm.Show();
}
if (calenderToolStripMenuItem.Checked == true)
{
newCalender.Show();
}
if (sRLSToolStripMenuItem.Checked == true)
{
newSRLS.Show();
}
if (searchToolStripMenuItem.Checked == true)
{
newSearch.Show();
}
if (noteToolStripMenuItem.Checked == true)
{
newNote.Show();
}
if (quickLaunchToolStripMenuItem.Checked == true)
{
newQuickLaunch.Show();
}
}
private void p2_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
}
private void p1_MouseMove(object sender, MouseEventArgs e)
{
this.pictureBox1.Image = Properties.Resources.minimize2;
}
private void p1_MouseDown(object sender, MouseEventArgs e)
{
this.pictureBox1.Image = Properties.Resources.minimize3;
}
private void p1_MouseLeave(object sender, EventArgs e)
{
this.pictureBox1.Image = Properties.Resources.minimize1;
}
private void pictureBox1_Click(object sender, EventArgs e)
{
this.Visible = false;
}
private void copyright_MouseMove(object sender, MouseEventArgs e)
{
this.copyright.Image = Properties.Resources.l2;
}
private void copyright_MouseLeave(object sender, EventArgs e)
{
this.copyright.Image = Properties.Resources.l1;
}
private void copyright_MouseDown(object sender, MouseEventArgs e)
{
this.copyright.Image = Properties.Resources.l3;
}
private void copyright_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("www.systemerror.co.nr");
}
Form2 newForm2 = new Form2();
private void button11_Click(object sender, EventArgs e)
{
newForm2.Visible = true;
}
private void button1_Click(object sender, EventArgs e)
{
if (newformtime.Visible == true)
{
timeToolStripMenuItem.Checked = false;
newformtime.Visible = false;
}
else if (newformtime.Visible == false)
{
timeToolStripMenuItem.Checked = true;
newformtime.Visible = true;
}
}
private void button2_Click(object sender, EventArgs e)
{
if (newCalender.Visible == true)
{
calenderToolStripMenuItem.Checked = false;
newCalender.Visible = false;
}
else if (newCalender.Visible == false)
{
calenderToolStripMenuItem.Checked = true;
newCalender.Visible = true;
}
}
private void button3_Click(object sender, EventArgs e)
{
if (newAlarm.Visible == true)
{
alarmToolStripMenuItem.Checked = false;
newAlarm.Visible = false;
}
else if (newAlarm.Visible == false)
{
alarmToolStripMenuItem.Checked = true;
newAlarm.Visible = true;
}
}
private void button4_Click(object sender, EventArgs e)
{
if (newSRLS.Visible == true)
{
sRLSToolStripMenuItem.Checked = false;
newSRLS.Visible = false;
}
else if (newSRLS.Visible == false)
{
sRLSToolStripMenuItem.Checked = true;
newSRLS.Visible = true;
}
}
private void button6_Click(object sender, EventArgs e)
{
if (newSearch.Visible == true)
{
searchToolStripMenuItem.Checked = false;
newSearch.Visible = false;
}
else if (newSearch.Visible == false)
{
searchToolStripMenuItem.Checked = true;
newSearch.Visible = true;
}
}
private void button7_Click(object sender, EventArgs e)
{
if (newNote.Visible == true)
{
noteToolStripMenuItem.Checked = false;
newNote.Visible = false;
}
else if (newNote.Visible == false)
{
noteToolStripMenuItem.Checked = true;
newNote.Visible = true;
}
}
private void button9_Click(object sender, EventArgs e)
{
if (newQuickLaunch.Visible == true)
{
quickLaunchToolStripMenuItem.Checked = false;
newQuickLaunch.Visible = false;
}
else if (newQuickLaunch.Visible == false)
{
quickLaunchToolStripMenuItem.Checked = true;
newQuickLaunch.Visible = true;
}
}
private void pictureBox2_Click(object sender, EventArgs e)
{
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void notifyIcon1_DoubleClick(object sender, EventArgs e)
{
this.Show();
}
private void timeToolStripMenuItem_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).Checked ^= false;
Settings.Default["timecheck"] = timeToolStripMenuItem.Checked;
Settings.Default.Save();
}
private void calenderToolStripMenuItem_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).Checked ^= false;
Settings.Default["calendercheck"] = calenderToolStripMenuItem.Checked;
Settings.Default.Save();
}
private void alarmToolStripMenuItem_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).Checked ^= false;
Settings.Default["alarmcheck"] = alarmToolStripMenuItem.Checked;
Settings.Default.Save();
}
private void sRLSToolStripMenuItem_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).Checked ^= false;
Settings.Default["srlscheck"] = sRLSToolStripMenuItem.Checked;
Settings.Default.Save();
}
private void searchToolStripMenuItem_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).Checked ^= false;
Settings.Default["searchcheck"] = searchToolStripMenuItem.Checked;
Settings.Default.Save();
}
private void noteToolStripMenuItem_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).Checked ^= false;
Settings.Default["notecheck"] = noteToolStripMenuItem.Checked;
Settings.Default.Save();
}
private void quickLaunchToolStripMenuItem_Click(object sender, EventArgs e)
{
((ToolStripMenuItem)sender).Checked ^= false;
Settings.Default["quickLaunchcheck"] = quickLaunchToolStripMenuItem.Checked;
Settings.Default.Save();
}
}
}
|
|
|
|
|
Sorry, I don't need more code; in order to answer your question, one would need more contextual information, and a real problem description. That implies a few sentences, and not dumping a lot of code.
BTW: the code shown would not even compile, there is a bunch of statements outside any method. You could edit it where it is, but first add more information.
|
|
|
|
|
The problem is the find the item at place X at fest time.
So i can do it like this
IEnumerator e = this.GetEnumerator();
while(index != -1 )
{
e.MoveNext( index-- );
}
Is there are more effective way ?
Thanks.
|
|
|
|