|
Thanks - so this is a good fit for the Weird and Wonderful!
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
|
|
|
|
|
You're welcome!
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Useful ? ^]
if the problem is transmitting the float value independently of local culture settings, serialization to binary, xml,json >?
cheers, Bill
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
At the moment I have Visual Studio 2012 and Visual Studio 2015 installed on my computer.
I wanted to know if there is any reason I should keep these older versions on my computer as I want to install Visual Studio 2017; I have a limited amount of space on the C drive.
Am I likely to loose the code I have written? Is older code backward compatible?
Is it possible to install Visual Studio on a different hard drive with more space as my C drive is a
SSD drive with less space than my other hard drives.
Brian
|
|
|
|
|
I have 2013, 2015, and 2017 on mine, and every project written in an earlier version has opened OK in later ones - so in theory you should be OK.
But ... two things:
1) VS2017 is a little flaky, especially compared to VS2013 - I've had it crash out and had to reinstall to fix the problems a couple of times. This is why I'm still doing the bulk of my work on 2013 - it wastes far, far too much time fixing the IDE! Not everybody is getting these problems however, so you may be lucky.
2) I'd strongly recommend that VS is installed on your SSD, not a HDD - the performance improvement is considerable (particularly with 2017, where the boot speed alone is significantly slower than 2013)
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Thanks for the advice Griff.
I've heard of this happening to some updated program.
Out of interest what operating system do you use?
Brian
|
|
|
|
|
Win10 V1803 Build 17134.590
The latest problem was that it would lock up when you tried to open any .CS file, A "repair install" (which is a reinstall under a new name) solved the problem, but threw away all my settings, templates, ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I just wondered as it might be related to Windows 10. I use Windows 8.1
Still not good when it makes you feel frustrated and causes you more work.
If there is not many extra features or improvements then perhaps it's better to stay with the 2015 version like you say. I wonder if there are updates for Visual Studio 2017?
Brian
|
|
|
|
|
Yes - but my version is up to date!
Microsoft is not fond of fixing bugs ...
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Hi,
I want to get a copy of the line in foreach brackets. But since the copyline is the reference type, the line is also changing.
foreach ( var line in Lines)
{
var copyline= new LineTable();
copyline = line;
copyline.Id = 0;
copyline.InvoiceHeaderId = newHeaderId;
var lineResponse = _service.InsertLine(copyline);
if (lineResponse.Success)
{
line.UpdatedTime = DateTime.Now();
}
Already below that lines return value is true
System.Object.ReferenceEquals(line, copyline) return value of this code
Thanks for your answers
|
|
|
|
|
I have no idea what you're trying to.
But, there a problems with the code in general. First, you never make a copy of the object line is pointing to.
Next, you create a new variable, copyline , and point it a new instance of LineTable . On the very next line of code you throw that instance out. ???
foreach (var line in Lines)
{
var copyline = new LineTable();
copyline = line;
On the same line, you point copyline to the same object line is pointing to. This does NOT make a copy of an object!
copyline = line;
Then you start manipulating the properties of the object pointed to by copyline . Well, both line and copyline are pointing at the exact same object so the changes you make with one variable will show up in the other.
So, yeah, ReferenceEquals is going to return true.
If you're trying to make a copy of line , you're going to have to define exactly what you want to copy. A "shallow copy" can easily be done using MemberwiseClone(). A "deep copy" is quite a bit more complex, and can be done many different ways depending on what members of line you're copying and how.
|
|
|
|
|
I have code which unzips a file over others, but first checks the date of a special file to make sure it is newer. The ModifiedTime of the file is found using:
using (ZipFile zip = ZipFile.Read(OriginalFileName))
try
{
ZipEntry z = zip["save_history.log"];
NewFileAge = z.ModifiedTime;
}
catch......
WinZip shows the date of the file as 26/02/2019 3:56 PM. Extraction confirms this.
The value of NewFileAge in the code above is 26/02/2019 2:56 PM.
The only references I can find to this refer to remote servers in different time zones. All these files are on one computer.
Yes, it looks suspiciously like a daylight saving time issue, but I can't figure out how.
|
|
|
|
|
Which ZIP library are you using? The one in the .NET Framework doesn't have a .Read method.
Consult the documentation on that library. I'd be willing to bet the date/time you got back for the zip file entry is in UTC and you're comparing it to a local date/time.
|
|
|
|
|
I'm using Ionic.Zip. You are right, I've converted to local time and that sorts it.
Thanks.
|
|
|
|
|
I recently started programming with the wpf
<DataGridTextColumn.HeaderTemplate>
<DataTemplate >
<StackPanel Orientation="Horizontal">
<ComboBox Name="ddlTipo" TextBoxBase.TextChanged="DdlTipo_TextChanged"
in Mainwindow.cs : 'ddlTipo' does not exist in the current context
how can I do ?
thanks
|
|
|
|
|
Just a guess - and since we can't look at your code that's all it can be - C# is case sensitive.
Is it supposed to be ddlTipo or DdlTipo given that it's one in the "name" and the other in the event handler?
Sent from my Amstrad PC 1640
Never throw anything away, Griff
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
A column header template with a combo box that has a name accessed from code-behind.
You're just making this stuff up. There is no precedent.
What can you do? LEARN WPF.
Create a WPF application in Visual Studio | Microsoft Docs
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
What is Best way of remembering the history of treeview and other control also across the application in desktop application with example in C#/VB .net
Regards,
Girish
Email:mohantagirish9@gmail.com
Ph:8249511873
|
|
|
|
|
|
A memento-pattern (undo/redo) would be a logical store for such actions.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
It depends on what "remembering the history" means;
1. logging changes
2. creating an undo/redo facility
3. saving/restoring the current state of UI, or data, at some point. by serialization/deserialization
If you edit your question to be more specific, I think you can get more specific responses. Include more information about context: WinForms, WPF, ASP ? MS TreeView or 3rd. party TreeView ?
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Hi BillWoodruff,
Thanks for your reply.
My requirement is the 3rd point
3. saving/restoring the current state of UI, or data, at some point. by serialization/deserialization
If any soulution is there, can you please provide me.
Thanks,
Girish
|
|
|
|
|
Hi, In order to respond in a way I think will assist you, you need to be more specific.
What specific properties of Controls do you want to save and restore ? Are the Controls run-time movable/resizable, or otherwise changeable ?
What specific properties of the TreeView do you want to save and restore ? Assuming the TreeNodes are bound/linked/connected to some other type of data, what is that data, and, do you need to save that data and restore it ?Quote: If any soulution is there, can you please provide me. No, but, I will help you learn to do it yourself, and, by doing it yourself, you will learn a lot
cheers, Bill
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
Hi Bill,
My requirement is that i have multi hirarchy treeview control in a form and that form is in tab control and that tab has multiple tabs. When switching from one tab to another , that time automatically select the last selected node in that treeview and also after closing and opening the application, when we navigate to that tab control automatically select the last selected node.
If you have any quries then please let me know.
Regards,
Girish
|
|
|
|
|
First, ... and, I may be misinterpreting you here ... never put a Form inside another Form; use Panels.
What you describe does not seem that complex; I'd create some data-structure to hold the state of the panel to treenode relations: I'd use a Class that I could serialize, maybe something like:
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Windows.Forms;
namespace ?????????????
{
[DataContract]
public static class PanelToNode
{
[DataMember]
private static Dictionary<string, string> PanelNameToTreeNodeKey;
static PanelToNode()
{
PanelNameToTreeNodeKey = new Dictionary<string, string>();
}
public static TreeNode GetCurrentNode(Panel pnl)
{
}
public static Panel GetCurrentNode(TreeNode node)
{
}
public static void Serialize(string filepath)
{
}
public static void DeSerialize(string filepath)
{
}'
}
} Do study the relation between a TreeNode's 'Text and 'Name properties: setting the 'Text when you create a TreeNode does not set the 'Name. Why set/use the 'Name: because to find a TreeNode recursively using 'Find:
TreeNode[] matches = treeView1.Nodes.Find("someNode", searchAllChildren: true);
You must use the 'Name property ... which is really the 'Key property. Note what using 'Find returns: an array of TreeNodes ... think about that: it means many nodes can have the same 'Name.
There are many other ways you could approach coding this. And, now, you get started researching and experimenting, and come back with specific questions and code.
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|