Opening ArcFM Attribute Editor from ArcObjects - esri

I am trying to get the ArcFM Attribute Editor to open, after selecting a certain feature programatically.
I figured the simplest way would be to grab a hold on a reference to its button, and call its OnClick method. Will that be the best solution? And how do I find the UID of the button? (If there's a general way of finding a button/command UID, I'd appreciate it).
It seems both ESRI and M&M (not the candy...) went to great lengths to supply really bad documentation...

I got it at the end (with the help of my co-workers here). If anyone will ever be interested in opening the Attribute Editor, here goes:
UID uid = new UID();
uid.Value = "mmDesktop.MMAttributeCmd";
ICommandItem commandItem = document.CommandBars.Find(uid, false, false);
commandItem.Command.OnClick();
Share and enjoy.

Related

How to update ad description using pre_item_add hook in OsClass?

I am writing a function to change the external links to my redirection link. I use pre_item_add hook, but I don't know how to update the submitted description with the new one. Does anyone know how to do it?
This is my idea:
function link_process($aItem){
$desc = $_POST['description'][$language_code];
Session::newInstance()->_setForm('description' , rewriteExternal($desc));
}
osc_add_hook('pre_item_add', 'link_process');
I made a similar change described here
Look for point 8. In my solution, but read all the answers to understand. Also there is a link in the solution to where I got this idea.

VB.NET How do I pass parameters to a class?

Relatively new to coding and have taken up lots of small projects to help learn the basics, and I have now set myself a challenge of a "bigger" one. Essentially I want to recreate the Message Box but with my own styling and customisable elements.
I have got the basics in a class and created it, however I want the class to have two options.
1) load all the details from an XML file for the message, I have done this and that works.
2) I want it to be like the standard message box where you can pass in parameters.
My question is, How can I achieve number 2.
I have tried adding details into the Show/Load subs but no luck, the only way around it I can see is with properties but that would take too long.
I want to be something like the below.
classname.show("message","tittle",icon,"buttons",imagefile,"caption")
However alot of my code is done in the load method as opposed to show, so it needs to be visible / accessible there.
Any help / advice would be appreciated.
Properties are definitely the way to go. It also makes sense: Conceptually, the message being shown is a property of the message box.
Your Show method would look like this:
Public Shared Show(message As String, title As String, ...)
Dim box as New MyMessageBoxWindow()
box.Message = message
box.Title = title
...
box.ShowDialog()
End Sub
In the Load method of MyMessageBoxWindow, you access these properties and configure the UI elements.

How do I go to the nth method of the eclipse editor's file?

I need to write a function goToNthMethod(int n) to let the user jump to the nth method in the file being edited.
Ideas so far:
I imagine the ContentOutline reads its tree from some sort of IContentSource (made up) or something, if I can read from the same source, that would probably be cleaner. Does something like this exist?
Read the contents of the outline view, and maybe simulate a double click on one of the Outline view's entries. This is as far as I got before I realized I was in over my head:
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart part = page.findView("org.eclipse.ui.views.ContentOutline");
ContentOutline outline = (ContentOutline)part;
PageBook pageBook = outline.book; // Doesn't work, book is private
Tree root = pageBook.currentPage; // Doesn't work, currentPage is private
String label = root.getLabel(); // Nothing like getLabel exists
Read the entire IDocument's contents, parse the java source code within, get the offsets in the file, and feed that to the editor.selectAndReveal method. However, parsing the java source code within is a massive task, so this approach probably won't work.
Use outline.getCurrentPage(), which is a JavaOutlinePage, but I can't seem to import that class. I'm guessing I need to pull in the entire JDT project to do that. This approach also means I'm tied to a specific language, when I want my goToNthMethod to be language agnostic.
Any ideas on how I can jump to the nth method? Thanks!
Some context: I'm integrating Dragon NaturallySpeaking with eclipse to be able to program with my voice. It's working well so far, but one tedious part is navigating around the file, which would be made easier if I could say "go to 8th method". In fact, just "go to 8th entry" to just go to the 8th row in the outline view would be sufficient. Any other ideas appreciated!

How to make my own property attribute in objective-c?

I was thinking how could I make my own property attribute, for example:
#property(retain,nonatomic,'myAttribute') int numberOfWheels
#property('unique',nonatomic) NSString productCode
but when I try to get a help from Xcode pressing command button or option button nothing happens
I was looking in this page and many others but no one ask how to make your own attribute, most of then just asking about how to use property attributes or difference between them
I dont know if its possible to make a new attribute, but if its true, could someone help me
The only way to do this is to modify the compiler directly to add this functionality. I have no idea where you'd begin to do that, except to point you to http://llvm.org and say "good luck".

NSDocument - how to prevent a document from being marked as updated automatically?

I have a cocoa app that allows the user to enter a query. I'm using an NSWebView with a TextArea HTML object. The problem is, as soon as I type anything into the textarea, my document gets marked as updated. Does anyone know of a way to prevent this?
I've verified that using a NSTextField does not reproduce this behaviour, but I specifically want to go with the HTML/TextArea for styling.
So basically: Can I make it so an NSDocument does not get marked as edited unless I manually call:
[document updateChangeCount: NSChangeDone];
This post on the Apple mailing list seems to match your problem exactly.
The solution suggested is to set a custom undo manager to the webview (sounds like hard work), however a quick-and-dirty hack looks to me like subclassing updateChangeCount and perverting things to your way of thinking.