I am looking for a method (macro/plugin/extension) to change values in a specific property sheet (which is loaded into every project in the solution) without having to reload the solution.
Is there a way to access it from a macro or plugin code?
Thanks!
Record a macro when you edit the property sheet and view it's code from the macros IDE. Afterwards you could assign key bindings to it and playback anytime.
This is how I got to work. And you have to add the VCEngine reference with your project.
VCProject project;
Projects projCollection = sol1.Projects;
project = (VCProject)projCollection.Item(1).Object;
VCConfiguration config = project.Configurations.Item("Test Release|Win32");
IVCRulePropertyStorage rule = config.Rules.Item("ConfigurationDirectories") as IVCRulePropertyStorage;
//Setting the Include directories
string rawValue = rule.GetUnevaluatedPropertyValue("IncludePath");
string evaluatedValue = rule.GetEvaluatedPropertyValue("IncludePath");
rule.SetPropertyValue("IncludePath", "Whatever you like to specify here");
//Setting the Executable Directory
rawValue = rule.GetUnevaluatedPropertyValue("ExecutablePath");
rule.SetPropertyValue("ExecutablePath", "Whatever you like to specify here");
Related
I have a layout in my Xamarin Android project. I want to confirm that the resource is actually present in build.
I tried the following code:
var layout = Resources.GetLayout(Resource.Layout.my_xml_resource);
var xml = layout.ReadInnerXml();
System.Diagnostics.Debug.WriteLine(xml);
The GetLayout call does not throw the NotFoundException so presumably the resource exists. However, layout object, upon inspection, displays None.
The xml variable is empty and all attempts to read the xml are unsuccessful.
I am down this rabbit hole, because I am trying to use the layout with Inflate. Unfortunately, the output of inflate does not have the child controls I would expect and I suspect the resource layout is empty.
nativeView = inflater.Inflate(Resource.Layout.my_xml_resource, view, true);
What am I missing? Is there another way to verify the resource exists?
Use the Resources.GetIdentifier(String, String, String) Method could verify that Android Layout Resource Xml exists or not.
In C#, you could try the code below. If the resId not be 0, the resource exists.
int resId = Resources.GetIdentifier("textlayout", "layout", "com.companyname.app1");
textlayout: This is the layout name of my project, please note it need lower case.
layout: The type of resource you want to verify. It need lower case as well.
com.companyname.app1: PackageName, you could get from the AndroidManifest.xml file.
After a long long time, I added another button to my apps dialog. I had localized strings implemented. So I found a similar one like
/* Class = "NSButtonCell"; title = "Keep number"; ObjectID = "2yE-rM-5Sn"; */
"2yE-rM-5Sn.title" = "Nicht umnumerieren";
in file "Main.strings (German)". Unfortunately I forget, how I got there. I did the entire translation in one step in one night. Now I only need to get one new translation for the newly added button.
Any hint how to do this?
Select your project name (1.), in my case Timebooking. Maybe the application is selected instead in Targets and you have more options but not localization. Then select Use Base Localization (2.). It should create the English Main.strings file when you add English. There you can add the proper translation. HTH.
I have a class with various elements and I want to assign a setting to a property, like:
this.MyProccess.StartInfo.FileName = Properties.Settings.Default.MySetting;
The problem is that when closing VisualStudio it auto change the setting to the setting value.
this.MyProccess.StartInfo.FileName = "MySetting Default Value";
How can I make to stay as the first one?
I have created the DateTimePicker control. Now i want to add localization Support with this.
I have followed the below steps.
Created CustomControls.de-DE.resx inside the ResourceFolder.
added some commonly used strings in that resx file
changed the access modifier to Public
added <SupportedCulture>de-DE;</SupportedCulture> in the csproj file.
set System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("de-DE"); in sample.cs file before
IntializeComponent().
my DateTimevalue was " 2 Day(s): 3 Hr (s): 5 Min(s) : 32 Sec (s)
Getting only default language that is english.
What i did wrong? Please help me anyone. Is anything i missed?
Clear Steps To add Localization Supports in WP7
Create Custom control.
Add AppResource.resx inside Properties
Add AppResource.es.resx and Appresource.it.resx files inside Properties
Add needed strings with unique name.(we can refer the strings use of this id).
Add it;es; in the csproj file.(unload the project, rightclick->edit, add the supportedculture
tag then reload it)
Create the Sample
do the same as 5th step for Sample.csproj file
Change the cultures of System in the button click.(Ex: Thread.CurrentThread.CurrentUICulture = new
System.Globalization.CultureInfo("de-DE");)
Run the Project
Ref: http://www.windowsphonegeek.com/articles/Localizing-a-Windows-Phone-app-Step-by-Step
Thankyou.
I'm trying to remove the 'paste' option from the right-click menu. There is a recently added function which is supposed to do this, but I'm not sure how to call it.
Documentation: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#removeMenuItem
I've tried the following in CKEditor's config.js file, which don't appear to work:
CKEDITOR.editor.removeMenuItem('paste');
CKEDITOR.editor.prototype.removeMenuItem('paste');
config.removeMenuItem = 'paste'; /* in main config array */
Any suggestions? (Removing right-click menu completely is not an option as I need it for table editing)
Why your tests didn't work:
CKEDITOR.editor.removeMenuItem('paste');
The CKEDITOR object doesn't have a property "editor",
CKEDITOR.editor.prototype.removeMenuItem('paste');
Ditto, and trying to get the prototype won't help.
In both cases you have some error messages waiting for you in the error console
config.removeMenuItem = 'paste'; /* in main config array */
As you have linked, removeMenuItem is a method of the editor object, not a property of the config object.
What you can do:
CKEDITOR.instances.editor.removeMenuItem('paste');
The CKEDITOR object has a property "instances" that contains all the instances, so replace "editor" with the name of your editor and it will work. (of course, after the instance has been created, not before)
You can try this, it worked for me
CKEDITOR.instances.contentEditor.config.removePlugins = 'image,resize';
contentEditor is the name of the instance of CKEDITOR.
You can use the config and set removePlugins and pass a string with the name of the property, that you want to remove. But remember it will only work with those property names, that is present in the plugins object. Like if you want to remove 'paste' you have to do this
CKEDITOR.instances.contentEditor.config.removePlugins = 'pastefromword,pastetext';
When creating the editor in array configuration includes:
var config = {...,
'removeButtons': 'Maximize'};
by exzemplo