Custom Visualizer for EASTL VS2012 / 2013 - debuggervisualizer

I got EASTL from here - https://github.com/paulhodge/EASTL
For debugging, I'm writing custom visualizer VS2012/2013.
"eastl::vector" works fine but "eastl::map" doesn't.
Here is my code
<Type Name="eastl::map<*>">
<DisplayString>{{size = {mnSize}}}</DisplayString>
<Expand>
<Item Name="[size]">mnSize</Item>
<Item Name="[comp]">mCompare</Item>
<TreeItems>
<Size>mnSize</Size>
<HeadPointer>mAnchor.mpNodeParent</HeadPointer>
<LeftPointer>mpNodeLeft</LeftPointer>
<RightPointer>mpNodeRight</RightPointer>
<ValueNode>(node_type*)this->mValue</ValueNode>
</TreeItems>
</Expand>
</Type>
It looks like VS doesn't recognize "node_type"
Thanks for responding.

I had the same problem for EASTL.
It turned out that I was using an old version of EASTL.natvis. This one works for me: https://github.com/electronicarts/EASTL/blob/master/doc/EASTL.natvis
The file you have to replace is in:
%userprofile%\Documents\Visual Studio 2015\Visualizers
(Just change 2015 to whatever version of VS you are using)

Related

How to correctly set windowDrawsSystemBarBackgrounds in XF5?

We've been upgrading our application to Xamarin.Forms 5 and it's unclear how to correctly set the AppCompat theme now that we've migrated to the AndroidX package. When using
<style name="MyTheme.ActionBarAppCompat" parent="#android:style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:windowDrawsSystemBarBackgrounds">false</item>
</style>
I get error APT2260: resource android:style/Theme.AppCompat.Light.DarkActionBar not found.
If I remove the android: the application compiles, but the navigation bar overlaps controls on the page.
I couldn't see the full code of your styles.xml, but I tried to create a simple xamarin android app with the latest vertion of nuget Xamarin.Androidx.AppCompat.
The default code of file styles.xml is:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
</style>
Note:You can compare it to your code. If the problem still exists after correction, you can post the code of your styles.xml here.

VSCode to Visual Studio IDE code snippet conversion

Consider the following VSCode code snippet taken from here:
"var set get f m_":{
"prefix": "varsetgetfm",
"body":[
"${1:int} ${2:VARNM};",
"$1 ${2/^(?:f|m)_?([A-Za-z])(.*)|([A-Z].*)$/${1:/downcase}$2${3:/downcase}/}(){return $2;}",
"void ${2/^(?:f|m)_?([A-Za-z])(.*)|([A-Z].*)$/${1:/downcase}$2${3:/downcase}/}($1 val){$2 = val;}"
]
}
Is there a way to convert this and other snippets from VSCode to a format usable in Visual Studio IDE automatically without having to manually figure out the equivalent? Visual Studio IDE seems to have xml based snippets and not json based snippets like VSCode does.
There’s no existing way. There’s however a way and it involves parsing the json and creating the xml needed.
You can use the schema reference link to see json <-> xml, snippet, equivalent.
In other words, make it yourself. Should be fairly easy given that all the details are already documented by Microsoft.
Next day edit:
Take a look at this gif I made . It replicates partially replicates the vscode snippet inside visual studio.
Also, the snippet xml code:
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>varsetget</Title>
<Shortcut>varsetget</Shortcut>
<Description>Code snippet testing</Description>
<Author>Dorian</Author>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>type</ID>
<ToolTip>the var type</ToolTip>
<Default>int</Default>
</Literal>
<Literal>
<ID>VARNM</ID>
<ToolTip>the var name</ToolTip>
<Default>VARNM</Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[
$selected$$type$$end$ $VARNM$;
$type$ $VARNM$(){return $VARNM$;}
void $VARNM$($type$ val){$VARNM$ = val;}
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
To be able to use it, create a *.snippet file wherever you want on your machine with the code above, then:
Navigate and open the *.snippet file you created
You can now test out the snippet
NOTE: In Visual Studio 2019 the default of inserting a code snippet or moving to the next Declaration Literal is pressing Tab twice as opposed to Visual Studio Code, where only one Tab is needed.
Everything I wrote is from the msdocs or deducted from the examples there.
My last edit:
It looks like you're not out of luck. But I do not have the time to investigate/test further, sadly. https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.package.expansionfunction?view=visualstudiosdk-2019
Also, according to this SO post you basically would have to create your own language, which I personally doubt.
PS: How come the guys at MS q&a didn't suggest this I do not understand...

Xamarin android, how to make navigation bar back button bigger and change color?

I am using Xamarin forms, but I want to make navigation-bar back button only for android project. I simply want make it bigger and change color of it. What would be the best way to do it? Thank you for any answers or suggestions.
As #Rohit mentioned you will need a to customize the action bar inside the styles.xml which is inside the values folder inside the Resourses folder of your android project, James Montemagno did a blog post related to that when he introduce the FormsAppCompatActivity an example of a cuztom nav bar would be like this:
<style name="AppMainTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<!--If you are using revision 22.1 please use just windowNoTitle. Without android:-->
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">#0063a4</item>
<item name="colorPrimaryDark">#003A63</item>
<item name="colorAccent">#86c447</item>
<item name="android:windowBackground">#color/AppBackgroundColor</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:datePickerDialogTheme">#style/AppCompatDialogStyle</item>
</style>
And the blog post is here: https://blog.xamarin.com/android-tips-hello-toolbar-goodbye-action-bar/
In regards of navigation bar height it may involved more cuztomization and a custom view inside the Navigation Bar, here is an android example:
https://guides.codepath.com/android/Using-the-App-ToolBar

Inserting Animation From Style in Xamarin

So i have an animation style defined in Resources/values/styles.xml
<style name="BottomSheetAnimation">
<item name="android:windowEnterAnimation">#anim/dock_bottom_enter</item>
</style>
But it gave me compile error:
No resource found that matches the given name (at 'android:windowEnterAnimation' with value '#anim/dock_bottom_enter').
When i changed it into #+anim/dock_bottom_enter (notice the plus sign), it gave me another error:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1698,3): error MSB6006: "aapt.exe" exited with code -1073741819
I have defined the animation in anim folder (Resources/Anim/dock_bottom_enter.xml). I also have defined that file as AndroidResource in the Solution Explorer.
Strangely, i can access the animation from resoure class (Resource.Anim.dock_bottom_enter). Seems like it is actually compiled successfully, but i can't refer animation from style. Is there something i forget to do?
I have tried cleaning, rebuild, changing xml to axml, changing the case (Anim to anim), none of them works. I am using latest Xamarin version (Xamarin Android 6)
Try something like this :
<item name="activityOpenEnterAnimation">#anim/activity_open_enter</item>
Refer : https://github.com/android/platformframeworksbase/blob/master/core/res/res/values/styles.xml

CastVideo-Android sample using forked ShowcaseView project library not working with multiple Icons in ActionBar

I'm creating a cast-enabled application using the CastVideos-android sample project as a reference.
Version 1.2 of the CastVideos-android sample uses this forked version of the ShowcaseView library to display a very nice looking overlay to highlight the cast button.
This is great and helps developers satisfy the Cast Sender-App UI requirements, but this forked version of the ShowcaseView library doesn't play well with apps that may use multiple icons in the ActionBar.
For example, when adding a SearchView-type item to the ActionBar the ShowcaseView bugs-out.
The result is below and the steps to replicate this behavior are below the screenshot :
Steps to replicate:
Include the v7-appcompat as a library project in the CastVideo-android project.
Change the res/menu/main.xml in the CastVideo-android project to look like the following (adding an ActionView of type SearchView to the ActionBar) :
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:compat="http://schemas.android.com/apk/lib/res/android.support.v7.appcompat" >
<item
android:id="#+id/media_route_menu_item"
android:title="#string/media_route_menu_title"
app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider"
app:showAsAction="always"/>
<item
android:id="#+id/action_settings"
android:title="#string/action_settings"
app:showAsAction="never"/>
<item
android:id="#+id/search"
android:icon="#drawable/abc_ic_search"
app:title="#string/menu_Search"
app:actionViewClass="android.support.v7.widget.SearchView"
app:showAsAction="collapseActionView|ifRoom"/>
</menu>
I'm using the latest version of the v7-appcompat library.
I suspect the culprit to be how the ActionBarViewWrapper.getMediaRouterButtonView() method (found in com.github.amlcurran.showcaseview.targets) is finding the MediaRouterButton via reflection, but can't seem to understand how to find the MediaRouterButton if there are multiple icons items in the ActionBar.
Any help would be greatly appreciated!
The forked project has been updated to handle this case. Thanks for reporting the issue. Once I hear from you (or anyone else) that it works as expected, I will submit a pull request to Alex.

Resources