|
bruze wrote: Total three field is there in weekday table.
1)DayOfTheWeek
2)OfficeOpenHours
3)OfficeCloseHours
You might have to add a new column (like sortorder) and display according to it.
*jaans
|
|
|
|
|
i wanna know that Application.Run only takes only from objects as a parameter like
Application.Run (new MYfrm1);
OR it can also take parameter other than windows form like Class Objects?
|
|
|
|
|
i wanna know that Application.Run only takes only from objects as a parameter like
Application.Run (new MYfrm1);
OR it can also take parameter other than windows form like Class Objects?
|
|
|
|
|
Why don't you have a look at the documentation[^]?
BTW, don't post your questions twice.
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
saneng wrote: OR it can also take parameter other than windows form like Class Objects?
If you check you'll find that Form is a class. And instances of Form are objects.
|
|
|
|
|
I want to resign the assembly with a strong key but I get an error that the post build command exited with code 3?! Any idea what this means?
If I manually resign the assembly the operation is successful.
|
|
|
|
|
I have a routine that takes identifies a specific location on each line of HEX and highlights it. It works fine until it gets to a line that the sniffer did not capture any HEX. From that point on it is highlighting random spots in the file. How should I handle identifing the error, and then continue past it without causing it to randomize the locations?
Here is a sample of what I would normally see in the HEX (all one line);
2008/04/24 19:16:50 [128009]ARES_EINDICATION 010.050.082.101 103.2.01 (19d1) RX 68 bytes 19 D1 26 02 34 E8 AA 20 76 97 51 28 50 76 38 64 49 00 58 02 02 C7 88 01 C7 88 AA 50 76 38 64 49 20 76 97 51 28 D8 07 04 18 13 10 2F 00 00 10 0A 06 0A 06 06 0A 06 0A 06 06 06 06 06 06 06 06 73 74 69 9C F6
Here is a sample of the line with the error in it (all one line);
2008/04/24 19:16:51 [128009]ARES_EINDICATION 010.050.082.104 107.1.01 (1ac1) RX 68 bytes
This is the snippit of the code to find the sequence numbers;
private void findSequenceNumbers()
{
toolStripStatusLabel.Enabled = true;
toolStripStatusLabel.Visible = true;
//Find the ARES and ATCS L3 Sequence Numbers and change to Blue/BOLD color
int lineNum = 0;
bool startingNewLine = true;
FontStyle style = FontStyle.Bold;
string[] lines = rtbDoc.Lines;
string text = rtbDoc.Text;
rtbDoc.Enabled = false;
for (int i = 0; i < text.Length; i++)
{
if (startingNewLine)
{
//Find and highlight ARES EINDICATION Sequence Numbers
if (lines[lineNum].Contains("]ARES_EINDICATION"))
{
i += 154;
rtbDoc.Select(i, 2);
rtbDoc.SelectionFont = new Font(rtbDoc.SelectionFont, rtbDoc.SelectionFont.Style ^ style);
rtbDoc.SelectionColor = Color.Blue;
}
//Find and highlight ARES INDICATION Sequence Number
else if (lines[lineNum].Contains("]ARES_INDICATION"))
{
i += 154;
rtbDoc.Select(i, 2);
rtbDoc.SelectionFont = new Font(rtbDoc.SelectionFont, rtbDoc.SelectionFont.Style ^ style);
rtbDoc.SelectionColor = Color.Blue;
}
//Find and highlight CODELINE INDICATION MESSAGE L3 Sequence Number
else if (lines[lineNum].Contains("]CODELINE_INDICATION_MSG") && lines[lineNum].Contains("RX"))
{
i += 112;
rtbDoc.Select(i, 2);
rtbDoc.SelectionFont = new Font(rtbDoc.SelectionFont, rtbDoc.SelectionFont.Style ^ style);
rtbDoc.SelectionColor = Color.Blue;
}
//Find and highlight CODELINE CONTROL MESSAGE L3 Sequence Number
else if (lines[lineNum].Contains("]CODELINE_CONTROL_MSG"))
{
i += 160;
rtbDoc.Select(i, 2);
rtbDoc.SelectionFont = new Font(rtbDoc.SelectionFont, rtbDoc.SelectionFont.Style ^ style);
rtbDoc.SelectionColor = Color.Blue;
}
//Find and highlight RF L3 ACK L3 Sequence Numbers
else if (lines[lineNum].Contains("]RF_L3_ACK"))
{
i += 109;
rtbDoc.Select(i, 2);
rtbDoc.SelectionFont = new Font(rtbDoc.SelectionFont, rtbDoc.SelectionFont.Style ^ style);
rtbDoc.SelectionColor = Color.Blue;
}
//Find and highlight INT SERV SIG L3 Sequence Numbers
else if (lines[lineNum].Contains("]INT_SERV_SIG"))
{
i += 169;
rtbDoc.Select(i, 2);
rtbDoc.SelectionFont = new Font(rtbDoc.SelectionFont, rtbDoc.SelectionFont.Style ^ style);
rtbDoc.SelectionColor = Color.Yellow;
}
//Find and highlight INT L3 ATCS L3 Sequence Numbers
else if (lines[lineNum].Contains("]INT_L3_ATCS"))
{
i += 112;
rtbDoc.Select(i, 2);
rtbDoc.SelectionFont = new Font(rtbDoc.SelectionFont, rtbDoc.SelectionFont.Style ^ style);
rtbDoc.SelectionColor = Color.Blue;
}
else
{
i += lines[lineNum].Length - 1;
}
startingNewLine = false;
Application.DoEvents();
}
if (text[i] == '\n')
{
startingNewLine = true;
lineNum++;
}
}
toolStripStatusLabel.Visible = false;
toolStripStatusLabel.Enabled = false;
rtbDoc.Select(0, 0);
rtbDoc.ScrollToCaret();
rtbDoc.Enabled = true;
rtbDoc.Focus();
}
Thanks,
Brian
|
|
|
|
|
That's because it looks like you're not checking to make sure that the transmission is correct. If you are counting on fixed length transmissions, make sure that you actually have the right amount of bytes. I would tackle this with regular expressions. Are you running this when receiving a message?
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Good suggestion. I need to learn Regex regardless. No I am not running this real time. It is a static log that is opened after the fact. First I do a string collection and create a single line of the HEX, and put the RX/TX items at a specific location to facilitate finding the correct item in the HEX to highlight and simplfy pattern searching. Once it is in a single line format, then I look for the location to highlight, then color accordingly.
Here is the raw;
Correct format;
2008/04/24 19:16:50 [128009]ARES_EINDICATION 010.050.082.101 103.2.01 (19d1) RX 68 bytes
2008/04/24 19:16:50 [128009] 19 D1 26 02 34 E8 AA 20 76 97 51 28 50 76 38 64
2008/04/24 19:16:50 [128009] 49 00 58 02 02 C7 88 01 C7 88 AA 50 76 38 64 49
2008/04/24 19:16:50 [128009] 20 76 97 51 28 D8 07 04 18 13 10 2F 00 00 10 0A
2008/04/24 19:16:50 [128009] 06 0A 06 06 0A 06 0A 06 06 06 06 06 06 06 06 73
2008/04/24 19:16:50 [128009] 74 69 9C F6
Incorrect/missing format;
2008/04/24 19:16:51 [128009]ARES_EINDICATION 010.050.082.104 107.1.01 (1ac1) RX 68 bytes
Brian
|
|
|
|
|
So you have a file with line feeds that you make individual strings for, if I'm understanding you correctly. So all the items in the above example with the same timestamp are considered in the same transmission.
Assuming the headers are never broken (not so good) you could use the RX size to count the bytes to make sure of the correct sizing.
If you're considering everything between the header text (ARES_EIN---) to be one transmission, you could load a either a generic List<string> or array String[] to hold transmissions, then colorize by line without using the index in the long string in your output window.
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
You are correct in your understanding. Same timestamp and same stationid e.g. [129008]. The information up to the end of the [] info is the same length. From that point on the length of the message is dictated by the type of message.
Thanks for the suggestions.
Brian
|
|
|
|
|
Ok, you can do a very short mod to your existing code to get you in the direction. Use the .Lines property on the rich text box to get the lines array from it, Then do a foreach on the lines to go through them. If I remember right the colorization is done by character index, so generating that number would be a matter of accumulating the length of the lines properly.
int total = 0;
foreach(String trans in rtb.Lines){
total += s.Length;
ColorizationInfo temp = new ColorizationInfo(trans);
Colorize(rtbDoc, temp, total);
}
Do you thing something like this would work? Of course I didn't go through the parsing like you did, but you get the main idea here.
Scott P
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Yes, I think this will work. I will bang it out later this afternoon, and reply with results.
Thanks much.
Brian
|
|
|
|
|
That worked. Thanks for the help!
|
|
|
|
|
Hi,
Anyone know how to return the username of a running process?
Thanks,
|
|
|
|
|
|
i'm doing a scheduling system for booking venues.now i'm supposed to produce code that checks the availability of a venue and if the venue is not available it must suggest anothr slot within the schedule.
please help me out with pieces of code that i can use in order for my programme to perform this function.
|
|
|
|
|
if(!venue.IsAvailable(requestedTime))
{
DateTime newTime = venue.SuggestTime();
bool userAcceptedNewTime = false;
while(!userAccepedNewTime)
{
userAcceptedNewTime = DisplayTimeSuggestion(newTime);
}
requestedTime = newTime;
}
Simon
|
|
|
|
|
Here you go:
public DateTime FindBookableSlot(DateTime dtChosenSlot)
{
if (!BookSlot(dtChosenSlot))
{
return NextAvailableSlot(dtChosenSlot);
}
return dtChosenSlot;
} Cunningly, BookSlot would book the slot, and NextAvailableSlot will book the next available slot and tell you when it is.
|
|
|
|
|
hi all
i have a problem that how to bind the message digest(i got it through hash operate on the .doc file) to word2007.you know i just develop a project about signature.
appreciate for any reply
|
|
|
|
|
Hello
I'm trying to find out the best method to maintain graphics on a Picture Box
1- During the init process I create an image using a file, adding some draw on it
cityImage = new Bitmap(belFile);
Graphics graphics = Graphics.FromImage(cityImage);
graphics.DrawEllipse(Pens.Red, tX - 1, tY - 1, 2, 2);
this.pb_cont.Image = cityImage;
This will become the "base working image"
Now in another function I create a graphics from the picture box to draw new objects
Graphics graphics = pb_cont.CreateGraphics();<br />
graphics.DrawRectangle(Pens.Black, rX, rY, dX, dY);
But I want to get those object persistant in my PB (not affected by refresh or paint)
AND I also need to be able to get back the "base working image" if needed
How can I do that ?
Thanks for any help
|
|
|
|
|
The easiest way to do this is to implement this graphics item as an object in it's own right, with its own Paint method. Then, in calls to OnPaint on the base graphic, you simply call the Paint method on this object.
|
|
|
|
|
Thank you
But I'm not very comfortable with graphics yet
How can you translate your suggestion with the example I gives ?
Do I have to create two different public images, cloning the base one and assign the one needed to the pb ?
|
|
|
|
|
Hi guys..
I am getting this error at runtime, after a sucessfull compile.
System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidCastException: Unable to cast object of type 'SummaryDataclass[]' to type 'System.Collections.Generic.List`1[Service+SummaryDataclass]'.
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriter1.Write5_ArrayOfSummaryDataclass(Object o)
at Microsoft.Xml.Serialization.GeneratedAssembly.ListOfSummaryDataclassSerializer1.Serialize(Object objectToSerialize, XmlSerializationWriter writer)
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
--- End of inner exception stack trace ---
The key bits of code are
[WebMethod]<br />
public SummaryDataclass[] GetSummaryDataBeta(string SearchTerm)<br />
{<br />
SummaryDataclass[] summaries = null;<br />
<br />
<br />
summaries = new SummaryDataclass[ds.Tables[0].Rows.Count + SplitSearchTerms.Length];
<br />
<br />
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)<br />
{<br />
summaries[i] = new SummaryDataclass();<br />
summaries[i].Item = ds.Tables[0].Rows[i]["item"] as string;<br />
summaries[i].ItemID = (int)ds.Tables[0].Rows[i]["itemid"];<br />
summaries[i].Count = (int)ds.Tables[0].Rows[i]["tally"];<br />
summaries[i].Validate = ds.Tables[0].Rows[i]["validation"] as string;<br />
}<br />
<br />
<br />
<br />
for (int j = ds.Tables[0].Rows.Count; j < ds.Tables[0].Rows.Count + SplitSearchTerms.Length; j++)<br />
{<br />
summaries[j] = new SummaryDataclass();<br />
summaries[j].Item = SplitSearchTerms[j - ds.Tables[0].Rows.Count];<br />
summaries[j].ItemID = 0;<br />
summaries[j].Count = j;<br />
summaries[j].Validate = "Place " + j.ToString();<br />
}<br />
<br />
}<br />
return summaries;<br />
<br />
}
Does a web service not allow an array of class objects, as its return??
Any help would be apreciated.
|
|
|
|
|
aberbotimue wrote: Does a web service not allow an array of class objects, as its return??
I'm not so sure that would be a problem. But, as the errors say it can't change an array into a list, I don't see that error in the code you posted.
All i can say is that somewhere is expecting a List of SummaryDataClass and your giving it a regular array.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|