C # questions on knowledge point assessment for Secondary Development of Visio

Source: Internet
Author: User
Tags visio viewer

 

In addition to fully introducing the relevant knowledge and concepts of Visio, this training also provides practical development methods to enhance the knowledge of the secondary development of Visio, in addition, I also passed the questions to assess the mastery of various students. This article mainly introduces the secondary development questions of Visio that I have obtained based on my previous experience in Visio development, we also provide relevant answers and analyses. We hope you can criticize and correct them and communicate with each other.

Although Visio has been widely used in all walks of life, I have written some of the blog articles I have been paying attention to over the past two years, there are basically no articles related to other peers (maybe there is no time to write this article ), although there are few projects that have been used to sublimate and study the secondary development of Visio (unless there are some special project cooperation needs ). Therefore, if I have some new experiences or materials, I would like to share them with you.

 

1) question (5 points for each question, total 20 questions, total score 100 points)

 

1) You do not need to install Office Visio to deploy the Visio secondary development application.Answer: Yes. Development and deployment are required.

 

2) the "run in developer mode" mode of Visio can help us to view more and more detailed information about Visio elements.Answer: Yes.

 

3) The field information displayed in the shape data window is a fixed internal data of the Visio elements and cannot be changed through code.Answer: Yes. You can modify the code to add, modify, or delete the code.

 

4) The macro recording function allows you to view the specific implementation code of a function and debug and track object attributes such as elements (Shape objects.Answer: Yes.

 

5) You can use Visio to draw, modify, and adjust the internal control content of the mold. However, the icons displayed in the mold cannot be modified.Answer: incorrect. The icon can also be modified.

 

6) The Visio Drawing Control is a COM Control. In addition to displaying the Visio Document on the interface, it also provides event processing for Window, Document, Shape, Page, Selection and other objects involved in the secondary development of Visio.Answer: Yes.

 

7) when the Data of the Shape Data attribute is saved in the Visio Document, the values of the numeric and numeric types must be added with double quotation marks.Answer: Wrong. You do not need to add double quotation marks to the numeric type.

 

8) the Second Development of Visio allows you to control the visibility of the Shape Data window, mold file window, scanning, scaling, and other windows through code, however, you cannot use code to call interface component objects (such as CommandBar and other UI component objects) in the Visio control ).Answer: Yes.

 

9) in addition to editing documents through controls in Winform, you can also install the Visio Viewer tool to modify and edit Visio documents on the Web.Answer: Wrong. You can only view the Web interface and cannot modify it.

 

10) in the Visio Drawing Control, an important SRC attribute is used to open or close the current document. If you specify a specific file path for this attribute, set SRC to null again, the control displays a blank document.Answer: Wrong. SRC only closes the operation on the Referenced File and does not affect the document display or display the original document.

 

11) to modify the attributes of a mold file, you must open the mold document in read/write mode before performing relevant operations.Answer: Yes.

 

12) after opening a specified file through SRC in the Visio Document, if you want to re-associate it with different files, you need to use Marshal. the ReleaseComObject method is used to release existing objects. If a new Visio Document is created, this operation is not required.Answer: Yes. All objects need to be released.

 

13) you can right-click the Winform program developed by Visio in either of the following ways: capture the MouseUpEvent event of the Visio control, or use the RUNADDONWARGS function. The two methods have the same effect and contain basic menu items, such as copy, paste, format, and data, which are commonly used by Visio.Answer: Yes. The first option has no other menus.

 

14) the drop-down list of attribute data is divided into fixed list and Variable list. The difference between the two is that the former can not add list items through code, and the latter can be added. However, both can select data from the list or enter new content.Answer: Yes. They can add a list project through code, but the latter can select an existing project or enter other content.

 

15) the Visio Document provides operations such as printing the current page, current view, and page printing. It also supports printing the selected area.Answer: Yes.

 

16) if the Shape data definition of the Master object of the mold is modified, if an attribute field is added, the Master and Shape corresponding to the drawing can also be automatically updated.Answer: Yes. After updating the mold Shape attributes, You need to manually update the drawing information.

 

17) through code operations, in addition to modifying the value of the Shape object, you can also modify the text content, font size, line width, display color, and other attributes of the Shape object.Yes.

 

18) the Visio Document has only one mold template (Master object), and one mold object can have multiple elements (Shape object) in the document ).Answer: Yes.

 

19) A shape file contains a series of mold combinations, such as switching the mold group and crossing the mold group.Answer: Yes.

 

20) the Visio Document can be saved as an XML file, through which you can see the organizational relationships between various Visio objects.Answer: Yes.

 

 

2) practical development questions (50 points per question, total 1 Question, total score 50 points)

 

Example requirements:

1. Open the specified Visio and mold files, save the Visio file, and export Visio as CAD.

2. Open different Visio files to release and reload objects. 3. Simulate the EnventSink. cs code to listen for and process events. 4. Right-click the page and choose test. In the displayed test dialog box, the page quantity, current page name, and Shape quantity are displayed.

5. You can open or hide the mold file window.

 

Answer:

Open the relevant Visio file and right-click the drawing. Right-click the drawing and choose test from the shortcut menu]

After responding to the menu operation, a dialog box is displayed, prompting related information, as shown in.

The key code of the example is as follows:

Private void btnOpen_Click (object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog ();
Dlg. Filter = "Visio file (*. Sealing) | *. Sealing | all files (*. *) | *.*";
Dlg. FilterIndex = 1;
If (dlg. ShowDialog () = DialogResult. OK)
{
OpenVisio (dlg. FileName );
}
}

Private void OpenVisio (string fileName)
{
VisioUtility. CloseAllStencileDocument (VisApplication );

Marshal. ReleaseComObject (VisApplication );
Marshal. ReleaseComObject (VisDocument. EventList );
Marshal. ReleaseComObject (VisDocument );
Marshal. ReleaseComObject (VisWindow );
GC. Collect ();

Thread. Sleep (100 );

This. axDrawingControl1.Src = fileName;
This. axDrawingControl1.Src = "";

InitEventSink (VisApplication, VisDocument );
This. axDrawingControl1.Document. Saved = true;

List <string> filePaths = GetFilePaths (maid );
Foreach (string stencel in filePaths)
{
VisioUtility. OpenStencilRead (VisApplication. Documents, stencel );
}

AddContextMenu ();
}

Private void AddContextMenu ()
{
Visio. Page page = VisioUtility. GetPage (VisDocument, "feeder map ");
Bool isEnable = true;
If (page! = Null)
{
// Clear all related menu events
Page. PageSheet. DeleteSection (short) VisSectionIndices. visSectionAction );

// Add a new menu
VisioUtility. AddRightMouseAction (page. PageSheet,
"\" Test \"",
"RUNADDONWARGS (\" QUEUEMARKEREVENT \ ", \"/Drawing = test \")",
IsEnable, true, false, false, true, true );
}
}

 
The source code of this example is provided below, hoping to help you with your study: the Demo of the Second Development of Visio (source code)

 

 

 

 

Main research technologies: code generation tools, secondary development of Visio, water delivery management software, and other shared software development

Reprinted please indicate the source:

Written by: Wu huacong http://www.iqidi.com

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.