|
I have a MonitorAction ma return a MonitorResponse mr as a string:
Code:
MonitorAction ma = new MonitorAction();
try
{
ManagerResponse mr = manager.Connection.SendAction(ma, 10000);
Console.WriteLine("Monitor Call" + "\n\tResponse:" + mr.Response);
}
Return as in the picture below:
http://i301.photobucket.com/albums/nn71/mikeakins/mr.jpg
Now, I want to display it like the listview here:
http://i301.photobucket.com/albums/nn71/mikeakins/ListViewSample.gif
We will have 5 Columns: Channel, UniqueId, CallerId, CallerIdName, State, DateReceived instead of 3 colums Name, Email, Phone as in the second picture.
How to parse the string mr to display it in the Listview? Please help me!
The code I use to display this information:
lvChannels1.Columns.Add("Channel", 200);
lvChannels1.Columns.Add("UniqueId", 200);
lvChannels1.Columns.Add("CallerId", 200);
lvChannels1.Columns.Add("CallerIdName", 200);
lvChannels1.Columns.Add("State", 200);
lvChannels1.Columns.Add("Date", 200);
lvChannels2.Columns.Add("Channel", 200);
lvChannels2.Columns.Add("UniqueId", 200);
string ChannelConnect = "New channel Event";
string ChannelDisConnect = "Hangup Event";
if (String.Compare(ChannelConnect, 0, ex.Message, 0, 17) == 0)
{
}
else if (String.Compare(ChannelDisConnect, 0, ex.Message, 0, 12) == 0)
{
}
|
|
|
|
|
I know I will probably get beat up about this, but coming from a procedural background, my OOP just sucks . My coding is reasonably effective, but I am missing the code reuse part of OOP, and the way to facilitate that. Are there any good axioms, or tutorials on how to build applications properly with multiple classes (when they should be static, when not), when to create another class and when to stuff everything in one class, or when to inherit? The Gang of Four book is a little over my head, and perhaps a bit abstract (yuk,yuk) for me. I just glazed over after about an hour of trying to understand what was going on. I have recently been working on a windows application, and have gotten in a little deep, and since I am not being paid a king's ransom and not under the gun to finish it right away and I would just like to write something on which I could build later.
|
|
|
|
|
|
|
Robert,
Thanks for the advice (and describing my situation almost perfectly) . I will certainly heed your advice, and I found a good piece of work by a fellow named Nirosh that I would recommend to others in the same situation.
http://www.codeproject.com/KB/architecture/OOP_Concepts_and_manymore.aspx?msg=2566566#xx2566566xx
Thanks again,
Nick K
|
|
|
|
|
In my opinion, and a lot of others, code reuse is a real myth. You virtually never pick up a collection of objects wholesale and put them in a different project or product with no modifications because each project's requirements are different.
I tend to stick to modularization with information-hiding for most objects. I only bother with inheritance when I have a real need for virtual functions, for example the GoF 'Strategy' pattern. Instead of defining one structure with a type-discrimination enumeration in, I'll write a base class (typically abstract) and one derived class per different implementation. If for some reason the classes already exist for information sharing/hiding reasons or just because that's what the Framework requires (e.g. a Form), I'll use an interface instead of a base class, but here you can't have a common base implementation, you have to actually implement the interface.
If you're writing an application that has a lot of forms and you want them all to look similar - have certain controls in common that will always perform the same function (called visual inheritance) - you can make your own class that derives from Form and derive your forms from that (you have to edit the code to do this in Visual Studio, but once you do the designer can cope as long as the base form compiles correctly). I'm currently working on a project where the inheritance hierarchy goes:
System.Windows.Forms.Form
Company.ScreenManager.FormBase
Application.AppForm
Application.AppLogoForm
actual forms FormBase adds a few virtual functions called by our 'screen manager', AppForm adds some base behaviours specific to this application, and AppLogoForm adds a logo to the form (some forms don't have the logo, but most are branded). This is a full-screen Compact Framework application; if it were necessary to have different contents on the desktop I'd have one Form containing a different UserControl for the different modes, with the control being swapped over when you switch modes.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi,
I want to skin my application, so that i'm in need of creating skin file and apply it for all controls.
Is it possible?
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
You will have to create the skin file and assign the SkinId to all the controls manually.
Thanks
Laddie
Kindly rate if the answer was helpful
|
|
|
|
|
hi all,
How to calculate the Modulus Function in C#.net
for example :|3-4|>1
what could be its precedence .
usharani
|
|
|
|
|
%
10%2
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
|
If you really mean what you say - modulus (as in remainder from division), see the post from laserbaronen (% is the modulus operator in C#). If you're doing scientific calculations and you want the IEEE specification of the remainder operation, use Math.IEEERemainder() instead.
If you mean the absolute value (as in |-1| = 1, which could be infered from your example), see the post from Shree (Math.Abs does that).
The precedence of the modulus operator (%) can be found in the C# reference (which shouldn't be further from you than the F1 key and a couple of mouse clicks). It's in the multiplicative operator group (same precedence as * and /).
--
Peter
|
|
|
|
|
Hi,
I made a user control. it is also a collection ( made by ) various user controls .
Eg : ButtonControl is made by various buttons.
I want to write the property of one of this control ( like EditButton it has contain ) at designer at design time in my application by using property window.
like this :::
this.ButtonControl .EditButton.Text = "Edit me"
how can I do ???
Plz help ...
|
|
|
|
|
In your usercontrol override OnPaint like this:
protected override void OnPaint(PaintEventArgs e)
{
if (this.DesignMode)
this.EditButton.Text = "I'm in design mode";
base.OnPaint(e);
}
or do the same but for the OnPaint in your window
|
|
|
|
|
Can anybody tell me how to pass value from Popup window to Parentwindow.
I've a parent.aspx page in which i have three textboxes with each have images for opening ImageSelector Popup window. When I click on the image then popup window open and when i choose image and then click on the save button then after i want to close the popup window and then the selected image name should be display in the textbox.
Note that I have three textbox.
1.txtSmallImage (Img1_ImageSelectorPopUp)
2.txtMediumImage (Img2_ImageSelectorPopUp)
3.txtLargeImage (Img3_ImageSelectorPopUp)
What i did when i click on the image1, image2, image3 then i opened the same popup window. Now i made a fucntion in a javascript name GetImageName(imageName). When i click on the save button then I call this function like that
this.btnSave.Attributes.Add("onclick","javascript:GetImageName('" + ImageName + "')");
the defination of function is here
function GetImageName(ImageName)
{
// ControlID can instead be passed as query string to the popup window
//window.opener.document.getElementById("ctl00_ContentPlaceHolder1_TextBox2").value = ImageName;
window.opener.document.getElementById("ctl00_MainContentPlaceHolder_txtprdTitleImage").value = ImageName;
window.close();
//window.opener.document.all("select1").options(window.opener.document.all("select1").selectedIndex).text=text1.value ;
}
Problem is that I dont understand that how can I access the parent page controls like txtSmallImage, txtMediumImage, txtLargeImage so that I can assigin the value to that controls's text property value.
Please help me or if you understand what i want to do then kindly provide me the complete solution means that when i click on the any imagePopup then value return on the specific txt(Small,large, medium)Image textbox.
Rgds,
Farhan,
Karachi, Pakistan.
|
|
|
|
|
This belongs to the ASP.NET forum.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
Hi,
I want to set an image for TabPage Button. Is it possible?
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
I guess you can do this using DrawItem event of tabcontrol.
|
|
|
|
|
|
Can you show some code on how to do that?
|
|
|
|
|
Set an ImageList for the Tab control
Then opent the TabPage Collections->set Image Index for Each Page.
It's working.
Thanks
Sababathi B
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
Hi,
Am in a process of image conversion.I've found a class,ImageFormat which supports file formats such as tiff,bmp,png...But i need to convert DWG to .x(DirectX file format)..But both these formats(DWG,.X) are not supported by this ImageFormat class..Which class should i use.Please guide me.Thanks in Advance.
Regards,
Priya
|
|
|
|
|
You can try the following Dll from this link "http://www.cad2dtp.com/en/truedtp_dll.htm"
Another one way is:
Find out the .dll which one is used in autocad for "save" option.
Regards
Saba
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
This task is a little involved. If you want the conversion to be performed programmatically, you need to look for a free conversion routine. If it suffices to convert them manually, you can use 3D Studio MAX. I think it can open .DWG files, and there is a plugin at http://www.andytather.co.uk/Panda/directxmax_downloads.aspx[^] that will allow you to save them in .X format, though some details might be lost.
|
|
|
|
|
Hi everybody, I have a following problem.
My computer uses SQL Server 2000. I write my project on my local machine. I use Dataset to retrieve data from QLNS database. When I set up my project to other machine in LAN. I encounter this error while running exe file.
"An error has occured while establishing a connection to the server. When connecting to SQL Server 2000, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections (provider: Name Pipes Provider, error: 40 - Could not open a connection to SQL Server".
Please kindly teach me how to solve this. Thank you very much.
Hope your help.
It seem to be a solution or an answer.
|
|
|
|
|