Control.ProductName in WPF [duplicate] - c#

This question already has answers here:
Application.ProductName equivalent in WPF?
(7 answers)
Closed 8 years ago.
Is there something similar to the following property in WPF?
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.productname(v=vs.110).aspx
Thanks.

Not that I know of. But you can easily create this method yourself.
The actual code used by WinForms has several levels of fallback: it first look for an AssemblyProductAttribute on the assembly defining the control, then at the file version and finally falls back to the first part of the namespace.
You can copy that logic (or the parts that are relevant to you) directly from .net source code: http://referencesource.microsoft.com/#System.Windows.Forms/ndp/fx/src/winforms/Managed/System/WinForms/Control.cs#f7c944851a004a6e

Related

C# - is it possible to modify values and call functions while the process is running? [duplicate]

This question already has answers here:
How can I write on another process memory?
(4 answers)
How to remote invoke another process method from C# application
(2 answers)
Closed 3 years ago.
I've been starting to do some decompiling of my C# programs and got some interesting results by editing the dlls, but is it possible to change values and call functions in a running process given that I know what the names of the variables or functions are?
Doesn't any cheat to any game do exactly that?
I mean, if I understand you correctly, there is software called
Cheat Engine which allows you to modify process variables values, inject dll's and much more.

How to create custom keywords C# [duplicate]

This question already has answers here:
Is there a way to implement custom language features in C#?
(6 answers)
Closed 6 years ago.
I'm writing a library for personal use that greatly expands C# features, and I was wondering on something quite interesting... Is it possible to create you own keywords? For example, if, foreach, for etc.
The reason I want to do this can be found at my previous question.
No, you can not do that. Language keywords are defined in the language definition. You could probably use the open sourced parts (compilers, etc) and create your own version of them.

Difference between ContentPropertyAttribute and ContentProperty [duplicate]

This question already has answers here:
What's the difference between [Something] and [SomethingAttribute] [duplicate]
(3 answers)
Closed 7 years ago.
I hope this wasn't asked already. But i found nothing. If something exists, thanks for the note.
The title says it all i think.
I've seen these two variants. But in my opinion it does the same. And why can i use both. Thanks for education.
// variant 1
[ContentProperty("Text")]
// variant 2
[ContentPropertyAttribute("Text")]
You can omit the word "Attribute" when writing attributes over something. The actual class is called ContentPropertyAttribute. Both of your lines do exactly the same and use the exact same attribute class.

Application.OpenForms - seems to be missing [duplicate]

This question already has answers here:
WPF version of Application.OpenForms
(3 answers)
Closed 8 years ago.
I have a small wpf/c# application and want to get a list of all of the open views. However, the Application.OpenForms, does not have "OpenForms" in the intellisense (and gives me an error). Could I be missing a specific reference of something?
I have tried: System.Windows.Application.OpenForms;
Based on the docs for the Application class, there is no OpenForms member.
http://msdn.microsoft.com/en-us/library/system.windows.application(v=vs.110).aspx
Try Application.Windows
var openWindows = System.Windows.Application.Current.Windows;

Hiding C# XML Documentation [duplicate]

This question already has answers here:
C# hide and unhide comments
(6 answers)
Closed 9 years ago.
I am using the C# XML style of documentation in my latest project (eg using ///<summary> stuff). I find this makes the source code a pain to read as it just becomes so long. Is there a way in Visual Studio to auto-collapse just these or do I have to use the collapse to definitions and re-expand functions?
Take a look here at the following post, I think it should help
http://www.helixoft.com/blog/archives/30?n=collapse-all-xml-comments-in-vb-net-or-c

Categories