Well, as I said it is not easy to do with only one web service call, but possible: one option is to implement Soap Extension, for instance like shown in http://www.codeproject.com/KB/webservices/Soap_Extension_Progress.aspx[^]
Vitaliy Tsvayer Tikle
Well, as I said it is not easy to do with only one web service call, but possible: one option is to implement Soap Extension, for instance like shown in http://www.codeproject.com/KB/webservices/Soap_Extension_Progress.aspx[^]
Vitaliy Tsvayer Tikle
Yes, you will have to add this flag and possibly some more while using c# compiler from command line.
Vitaliy Tsvayer Tikle
I suppose you compile in Visual Studio. Just look at the output window after you compile you project. Visual Studio is adding this flag automatically for you. Search for /define:TRACE
Vitaliy Tsvayer Tikle
Your UpdateDeviceHistory method is static. But you are trying to access m_parent. You can't do that. Because m_parent is not static. To be more specific context of your program is needed but you could do this at least: 1. Remove static from your UpdateDeviceHistory method. 2. create Utility class instance and call UpdateDeviceHistory on that instance, that is: Utility utility = new Utility(some_form_with_HistoryDataView) utility.UpdateDeviceHistory() Good Luck
Vitaliy Tsvayer Tikle
Well it depends on whether you have one web service call through which you get all your data or you have multiple separate web service calls to get your data. In the first case it won't be easy to update progress as web service needs to get the whole XML data before it can be parsed etc etc. It can be asynchronous but without progress updates. In second case BackgroundWorker is really suitable here. You do not need any loops as it is shown here http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx[^]. You simply call ReportProgress() method to update current progress between your web service calls and handle ProgressChanged events to update progress bar. Hope this helps somehow.
Vitaliy Tsvayer Tikle
The reason you get new array object on every click, is that new instance of class _Default is created for every request. So you need to put this array object into store which is shared among different requests that is Session.
Vitaliy Tsvayer Tikle
Maybe this will help. How to Use Transparent Images and Labels in Windows Forms[^]
Vitaliy Tsvayer Tikle
Hi, Do you know any open-source/free implementation/library for circular layout algortihm similar to this? Any ideas/links to any information on the topic would be usefull. Thanks.
Vitaliy Tsvayer Tikle
Hi, Do you know any open-source/free implementation/library for circular layout algortihm similar to this? Any ideas/links to any information on the topic would be usefull. Thanks.
Vitaliy Tsvayer Tikle
If I understand you right, you use DataGridView control with MultipleSelect set to true and when you select some cells you want to add numbers within them. To do that you can handle SelectionChanged event like below:
private void dataGridView1_SelectionChanged(object sender, EventArgs e)
{
foreach (DataGridViewCell cell in dataGridView1.SelectedCells)
{
//NOTE: we should check whether value in cell is a numeric value
//add values of cell
}
}
BUT, be carefull to check whether selected cells has an integer value!
Vitaliy Tsvayer Tikle
MethodInfo method = type.GetMethod("SetTopic", BindingFlags.Instance | BindingFlags.NonPublic);
Vitaliy Tsvayer Tikle
You can set DefaultCellStyle.WrapMode = DataGridViewTriState.True. So, you can enter value to cell as "Mike" + Environment.NewLine + "Bond". BUT, in this case if some other cell width is small its value will be wrapped as well. To avoid this you can leave DefaultCellStyle in its default value and set individual cell's style only.
Vitaliy Tsvayer Tikle
Well, first let me explain the reason of this problem. When you add WebReference to the WebService, proxy class is created with all the types that come from WSDL(generated by ASP.NET for your WebService). BUT, although generated classes have the same fields as your original class from DLL, they are abolutely different entities, that is why you cannot cast from WS.Person to DLL.person for instance. One of the solutions would be to modify the generated proxy class so that return type of the WebService method is the class from your shared DLL and not generated one. You need to modify Reference.css under Web References. Another solutions is to write code that takes WS.Person class and creates new DLL.person class by copying all the fields, etc. You could use reflection to shorten the code as all field names are the same in both types. Maybe there are more elegant solutions, but hope this helps.
Vitaliy Tsvayer Tikle
What error do you get?
Vitaliy Tsvayer Tikle
You could load data from xml file into XmlDocument, then add new xml data and save to the same file again. Something like this:
XmlDocument doc = new XmlDocument();
doc.Load("file_path.xml");
//add new data
XmlElement element = doc.CreateElement("NewElement");
element.InnerText = "test data";
doc.DocumentElement.AppendChild(element);
doc.Save("file_path.xml");
Vitaliy Tsvayer Tikle
Not clear for me what you actually try to do, but hope short info will lead you to the solution. Unix environments use "\n" for newline, while Windows uses combination "\r\n". While in C you can use "\n" to indicate newline for both Unix & Windows environments, in c# you should specify explicitly what you want that is "\r\n" for Windows, and even better you should use Environment.NewLine SO, my guess is your CVS file is from Unix like environment so you should replace single "\n"s with "\r\n" OR you should correct the code which generates .CVS file to use correct new line value.
Vitaliy Tsvayer Tikle
HOW TO: Distribute the .NET Framework with a Visual Studio .NET Deployment Project
Vitaliy Tsvayer Tikle
Well,public MyDelegate MyEvent;
is actually compiled as following:private MyDelegate MyEvent; [MethodImpl(MethodImplOptions.Synchronized)] public void add_MyEvent(MyDelegate value) { this.MyEvent = (MyDelegate) Delegate.Combine(this.MyEvent, value); } [MethodImpl(MethodImplOptions.Synchronized)] public void remove_MyEvent(MyDelegate value) { this.MyEvent = (MyDelegate) Delegate.Remove(this.MyEvent, value); }
that is evet keyoword in c# creates methods to manage multicast delegate. And the following:class1.MyEvent += new MyDelegate(this.test_MyEvent);
is simply a call to the add_MyEvent() method. And finally GetInvocationList() method is defined in MSDN as below: "Returns an array of delegates representing the invocation list of the current delegate. Each delegate in the array represents exactly one method. The order of the delegates in the array is the same order in which the current delegate invokes the methods that those delegates represent."
Vitaliy Tsvayer Tikle
You could also do something like this:
public class TestCancellableEvents
{
public static void Main()
{
TestClass test = new TestClass();
test.MyEvent += new MyDelegate(test_MyEvent);
test.MyEvent += new MyDelegate(test_MyEvent2);
test.doit();
}
void test_MyEvent2(object sender, CancelEventArgs args)
{
//do nothing this won't be called
}
void test_MyEvent(object sender, CancelEventArgs args)
{
//Cancel event, so the following handlers in the chain won't be called
args.Cancel = true;
}
public class CancelEventArgs
{
bool cancel = false;
public bool Cancel
{
get { return cancel; }
set { cancel = value; }
}
}
public delegate void MyDelegate(object sender, CancelEventArgs args);
public class TestClass
{
public event MyDelegate MyEvent;
public void doit()
{
Delegate[] list = MyEvent.GetInvocationList();
CancelEventArgs args = new CancelEventArgs();
foreach (MyDelegate handler in list)
{
handler(this, args);
if (args.Cancel)
{
break;
}
}
}
}
Vitaliy Tsvayer Tikle