I've noticed the following MvxBind info message being output to logcat while debugging on Android:
Missing stylable field MvxExpandableListView_GroupItemTemplate
I've tried adding the MvxBindingAttributes.xml file from GitHub to the DroidProject\Resources\values folder and set the Build Action to AndroidResource. This causes a compiler error for each <declare-stylable> XML tag like:
Attribute "XXX" has already been defined
It's interesting because it claims MvxGroupItemTemplate is already defined when I compile, yet when I run the program a message is displayed saying it's missing.
What should I do to fix this?
I had the same problem this morning when updating to the latest version of Xamarin Studio. Fixed it for now by including this:
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<declare-styleable name="MvxExpandableListView">
<attr name="GroupItemTemplate" format="reference"/>
</declare-styleable>
</resources>
In the Resources\values\attrs.xml file.
Related
I developing a C# class library in Visual Studio, and I have been making use of XML Documentation Comments primarily for their integration with Intellisense. However, the bulk of comments has become quite cluttered, so now I am endeavoring to use the <include> tag, and an external XML document to reduce the clutter.
My issue is that when using the <include> tag Intellisense seems to not update with the information, not show any of the <summary> and <param> tags that I've assigned to some of my classes and methods.
For Example I could have a class 'Test' documented as shown:
/// <include file="docs.xml" path='extradoc/class[#name="Test"]/*' />
class Test { string foo = "bar"; }
And have docs.xml:
<?xml version="1.0" encoding="utf-8" ?>
<extradoc>
<class name="Test">
<summary>
Contains some Foo.
</summary>
</class>
</extradoc>
And upon build the output XML populates correctly:
<?xml version="1.0"?>
<doc>
<assembly>
<name>Example Program</name>
</assembly>
<members>
<member name="T:Example_Program.Program.Test">
<summary>
Contains some Foo.
</summary>
</member>
</members>
</doc>
The only issue is that, try as I might, this documentation will not appear in the intellisense boxes while appending my code. Is there some Visual Studio configuration setting I'm missing? I've scoured the msn documentation to no avail.
My issue is that when using the tag Intellisense seems to
not update with the information, not show any of the and
tags that I've assigned to some of my classes and methods.
1.Avoid that your issue is being not able to see summary in Intellisense in current project A.
You can get help from this document, this technology is used to provide better reading experience. So assuming you have the Test class in current priject A, when you see the content in VS code editor, you'll see something like:
It's expected behavior that you won't see that rich comments in project A any more cause they have been moved to docs.xml.
2.If you mean when you create a new Project B(or share the assembly to other developers), the Intellisense can't recognize your Test class.
Two possible causes:
1.The output xx.dll and xx.xml from project A are not in the same folder, so when you reference that xx.dll in your new project, Intellisense won't display the documentation comments.
2.I guess there's something wrong with your docs.xml file. (I can't find any official document which indicates this technology supports user-defined nodes like extradoc and class in docs.xml, I used these two nodes and the Intellisense did not work, after changing them to normal docs and members, it works now)
Try using docs.xml and include in this way:
<?xml version="1.0" encoding="utf-8" ?>
<docs>
<members name="MyTests">
<Test>
<summary>
This class is public, but do nothing
</summary>
<remarks>
Just write something here to indicate this is remarks.
</remarks>
</Test>
</members>
</docs>
and
/// <include file="docs.xml" path='docs/members[#name="MyTests"]/Test/*' />
public class Test { }
I suggest you use a public class to test... After that create a new project and reference that xx.dll, when calling Test class you can see the summary:
And if we F12 we can see detailed comments:
Hope it helps :)
i have been using the the program from "Detecting entities under cursor while selection is running" By Philippe Leefsma located here1. it worked in ACAD2014 however now we are using ACAD2016. it will not work because of the DLLImport of acdb19.dll and autocad2016 needs acdb20.dll. Is there a way to make the program load eighter dll version? i tried using netload and assembly.loadfrom and neither worked.
Point Monitor callback
The DLL import is set at compile time so the best bet is to compile two versions for each release of AutoCAD.
Once the project is compiled, you could set up an autoloader by creating an application.bundle folder. this folder can be placed in c:\programdata\Autodesk\applicationPlugins. In the application.bundle folder, create a subfolder called Application and place the compiled .DLL file in there.
The loader is controlled with an XML file which should be named PackageContents.xml. Here's some example code for the xml file:-
<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
Name="My AutoCAD App"
Description="Does something in AutoCAD"
Icon="./Application/MyIcon.ico"
Author="Paul Nelson">
<CompanyDetails Name="Paul Nelson"
Url="http://www.stackoverflow.com"
Email="myemail#email.com">
</CompanyDetails>
<Components>
<!-- define the min and max versions of AutoCA in the next line -->
<RuntimeRequirements OS="Win64" Platform="AutoCAD" SeriesMin="R19.0" SeriesMax="R22.0" />
<ComponentEntry
ModuleName=".\Application\MyApp.dll"
LoadOnAutoCADStartup="true"
LoadOnCommandInvocation="false"
AppDescription="This is assembly MyApp."
AppName="My AutoCAD App"
AppType=".NET">
<Commands GroupName="My Apps">
<Command Local="MYAPP" Global="MYAPP" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>
One last tip - make sure the .dll filename does not contain spaces.
I'm new to monogame, and I'm trying to make a .spritefont file in order to draw string with the font I choose.
Strings with English characters can show well on the screen, but I wish to draw strings in multiple languages, like Japanese and Chinese.
So, I tried to load all characters in a Multi Language Font "Microsoft JhengHei".
The font's first character is !(U+0021) and the last one is ○(U+FFEE).
But when I tried to compile the program, the compiler gave me an error:
.../Content/MyFont.spritefont : error : Importer 'FontDescriptionImporter' had unexpected failure!
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: CharacterRegion.End must be greater than CharacterRegion.Start
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.FontDescription.set_CharacterRegions(CharacterRegion[] value)
And when I changed the ○ to 忮, MSBuild stucks and takes forever to proceed the content.
Code in MyFont.spritefont below:
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<FontName>Microsoft JhengHei</FontName>
<Size>14</Size>
<Spacing>0</Spacing>
<UseKerning>true</UseKerning>
<Style>Regular</Style>
<CharacterRegions>
<CharacterRegion>
<Start>!</Start>
<End>○</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>
I searched for the solution for a few days but in vain, any help is appreciated.
I was not able to reproduce the steps of the accepted answer from J3soon in Monogame 3.7.1.
However in Monogame 3.7.1, it is not longer necessary to use the Custom Content Pipeline because the pipeline tool now natively contains a LocalizedFontProcessor.
My steps were :
Set the .spritefont Processor to LocalizedFontProcessor in the pipeline tool
In the .spritefont, include the path to the resx file.
In the .spritefont, replace Asset Type="Graphics:FontDescription" with Asset Type="Graphics:LocalizedFontDescription"
Rebuild the Content
I would have thought step #1 would have done #3 behind the scenes but for me it was necessary to do this both in the pipeline tool and the .spritefont file.
spritefont file
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:LocalizedFontDescription">
<FontName>Arial</FontName>
<Size>16</Size>
<Spacing>2</Spacing>
<UseKerning>true</UseKerning>
<Style>Regular</Style>
<CharacterRegions>
<CharacterRegion>
<Start> </Start>
<End>~</End>
</CharacterRegion>
</CharacterRegions>
<ResourceFiles>
<Resx>..\Strings.fr.resx</Resx>
</ResourceFiles>
</Asset>
</XnaContent>
Content file
#begin MyFont.spritefont
/importer:FontDescriptionImporter
/processor:LocalizedFontProcessor
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Compressed
/build:MyFont.spritefont
Since processing all 65 thousand characters takes too much time. We should only process the characters we are using.
So the easiest way is to make a MonoGame Custom Content Pipeline and load the characters we are using by some .resx files.
It took me so much time searching for this solution. So I'll post how did I succeed, hope it can help someone who has the same question in the future.
Step-by-step Tutorial
Create a Class Library.
Reference the MonoGame.Framework.Content.Pipeline.Portable package using NuGet. (Make sure you checked the Include Prerelease checkbox )
Download the LocalizationSample here and unzip the file.
Under LocalizationPipeline\ copy LocalizedFontDescription.cs and LocalizedFontProcessor.cs into the class library
Build the class library so it outputs a LocalizationPipeline.dll file.
Open Myfont.spritefont and change its Asset Type to LocalizationPipeline.LocalizedFontDescription
Then add the resources <ResourceFiles><Resx>..\strings.resx</Resx></ResourceFiles> (these files should contain the string we want to draw)
Open Content.mgcb and reference to LocalizationPipeline.dll
Set the MyFont.spritefont's processor to LocalizedFontProcessor
ReBuild the project.
MyFont.spritefont
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="LocalizationPipeline.LocalizedFontDescription">
<FontName>Microsoft JhengHei</FontName>
<Size>14</Size>
<Spacing>0</Spacing>
<UseKerning>true</UseKerning>
<Style>Regular</Style>
<CharacterRegions>
<CharacterRegion>
<Start> </Start>
<End>~</End>
</CharacterRegion>
</CharacterRegions>
<ResourceFiles>
<Resx>..\strings.resx</Resx>
</ResourceFiles>
</Asset>
</XnaContent>
Content.mgcb
...
#-------------------------------- References --------------------------------#
/reference:..\LocalizationPipeline.dll
#---------------------------------- Content ---------------------------------#
...
#begin MyFont.spritefont
/importer:FontDescriptionImporter
/processor:LocalizedFontProcessor
/build:MyFont.spritefont
...
Sources
Part 1 of Creating custom content importers for the MonoGame Pipeline
How to: Create a Localized Game
LocalizationSample (Thanks to #Groo for giving me this link.)
I want to generate below code snippet into xml with c#:
<?xml version="1.0" encoding="utf-8" ?>
<PrincetonStorageRequest
xmlns="http://munichre.com/eai/dss/pct/v1.0"
requestId="RequestOut_MAG_Test_02"
timestampUtc="2015-02-19T09:25:30.7138903Z">
<StorageItems>
and my code is :
XmlWriter writer = XmlWriter.Create(fileName);
writer.WriteStartDocument(true);
writer.WriteStartElement("PrincetonStorageRequest");
writer.WriteAttributeString("xmlns","http://example.com/abc/dss/pct/v1.0");
writer.WriteAttributeString("requestId",name);
writer.WriteAttributeString("timestampUtc","2015-02-19T09:25:30.7138903Z");
writer.WriteStartElement("StorageItems");
But I am getting
"The prefix " cannot be redefined from " to within the same start element tag.
From your XML and the error, I believe it's because you are adding a default namespace after adding an element with no namespace declaration, so you're effectively creating an element and then changing its namespace.
Try the following code - it stops the error when I test it locally just for the XML I think you're trying to get:
XmlWriter writer = XmlWriter.Create(fileName);
writer.WriteStartDocument(true);
writer.WriteStartElement("PrincetonStorageRequest", "http://example.com/abc/dss/pct/v1.0");
writer.WriteAttributeString("xmlns", "http://example.com/abc/dss/pct/v1.0");
writer.WriteAttributeString("requestId", name);
writer.WriteAttributeString("timestampUtc", "2015-02-19T09:25:30.7138903Z");
writer.WriteStartElement("StorageItems");
So when I create the PrincetonStorageRequest element I am specifying a namespace URI.
Edit: Just to check, this is the XML that gets created but I did have to add the code to write the end elements:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<PrincetonStorageRequest xmlns="http://example.com/abc/dss/pct/v1.0" requestId="RequestOut_MAG_Test_02" timestampUtc="2015-02-19T09:25:30.7138903Z">
<StorageItems/>
Even though the solution is so obvious I should have never have posted this, I'm leaving it up as a reminder and a useful point of reference to others.
I've got the following in my app.config file:
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
</sectionGroup>
Followed by:
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object name="mediaLibrary" type="AlbumLibraryWPF.AlbumLibrary, AlbumLibraryWPF"/>
</objects>
</spring>
Then in my app I've got:
using Spring.Context;
using Spring.Context.Support;
public partial class AlbumChecker : Window
{
private DataTable dataTable;
private Library library;
private Thread libraryThread;
public AlbumChecker()
{
InitializeComponent();
CreateToolTips();
IApplicationContext ctx = ContextRegistry.GetContext();
library = (Library)ctx.GetObject("mediaLibrary");
// Other initialisation
}
// Other code
}
It all compiles quite nicely, however, I'm getting an exception raised on the call to GetContext():
Error creating context 'spring.root': Could not load type from string value
'AlbumLibraryWPF.AlbumLibrary, AlbumLibraryWPF'.
I've checked the Spring.NET documentation and can't see what I'm doing wrong - but I clearly have got something wrong, otherwise it wouldn't raise the exception!
AlbumLibraryWPF is the namespace and AlbumLibraryWPF.AlbumLibrary is the fully qualified name of the class I want to instantiate. I'm guessing that it's this I've got wrong, but can't see how.
I feel such a fool.
It was because I'd failed to copy the AlbumLibrary.dll to the correct output directory. That meant that Spring couldn't find it - even after I'd fixed the assembly name problem Kent highlighted.
The name after the comma should be the assembly name, which is not necessarily the same as the namespace name.
I was getting this error because by mistake there was a typo [!*2] in app.config file. Once I took that out , error went away. some thing like this
<context>
<!--<resource uri="~//Aspects.xml"/>-->
<!--<resource uri="~//Dao.xml"/>-->
<!--<resource uri="~//Spring.xml"/>-->
<resource uri="file://Spring.xml"/>
<resource uri="file://Dao.xml"/>
</context>
!*2
You should use tha id attribute instead of name:
<object id="mediaLibrary" type="AlbumLibraryWPF.AlbumLibrary, AlbumLibraryWPF"/>
Also it should be config://spring/objects instead of config://spring/obects.
You need to double check that you have a type called AlbumLibrary in AlbumLibraryWPF namespace defined in AlbumLibraryWPF assembly.
You can try change the type. The type="AlbumLibraryWPF.AlbumLibrary, AlbumLibraryWPF", first parameter means NameSpace and the second parameter (behind the dot) means Solution Name.
"AlbumLibraryWPF.AlbumLibrary" = NameSapce name
"AlbumLibraryWPF" = solution name
Open VS2012 or VS2010 with Administrator Permissions
Config: type="namespace.type, assembly"
Then try running your solution again.