本文整理汇总了C#中EA.ShowInProjectView方法的典型用法代码示例。如果您正苦于以下问题:C# EA.ShowInProjectView方法的具体用法?C# EA.ShowInProjectView怎么用?C# EA.ShowInProjectView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EA
的用法示例。
在下文中一共展示了EA.ShowInProjectView方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: locate
public override void locate(EA.Repository rep)
{
rep.ShowInProjectView(_dia);
}
示例2: OpenBehaviorForElement
public static void OpenBehaviorForElement(EA.Repository repository, EA.Element el)
{
// find the diagram
if (el.Diagrams.Count > 0)
{
// get the diagram
var dia = (EA.Diagram)el.Diagrams.GetAt(0);
// open diagram
repository.OpenDiagram(dia.DiagramID);
}
// no diagram found, select element
repository.ShowInProjectView(el);
}
示例3: UpdateVc
/// <summary>
/// Update VC (Version Control state of a controlled package:
/// - Returns user name of user who have checked out the package
/// - Updates the package flags
/// </summary>
/// <param name="rep">Repository</param>
/// <param name="pkg">Package to check</param>
public static string UpdateVc(EA.Repository rep, EA.Package pkg)
{
string userNameLockedPackage = "";
if (pkg.IsVersionControlled)
{
// find VC=...;
// replace by: VC=currentState();
string flags = pkg.Flags;
// remove check out flags
flags = Regex.Replace(flags, @"VC=[^;]*;", "");
flags = Regex.Replace(flags, @"CheckedOutTo=[^;]*;", "");
var svnHandle = new Svn(rep, pkg);
userNameLockedPackage = svnHandle.GetLockingUser();
if (userNameLockedPackage != "") flags = flags + "CheckedOutTo=" + userNameLockedPackage + ";";
try
{
SetVcFlags(rep, pkg, flags);
rep.ShowInProjectView(pkg);
}
catch (Exception e)
{
string s = e.Message + " ;" + pkg.GetLastError();
s = s + "!";
MessageBox.Show(s, @"Error UpdateVC state");
}
}
return userNameLockedPackage;
}
示例4: GetLatest
public static bool GetLatest(EA.Repository rep, EA.Package pkg, bool recursive, ref int count, int level, ref int errorCount)
{
if (pkg.IsControlled)
{
level = level + 1;
// check if checked out
string path = GetVccFilePath(rep, pkg);
string fText;
//rep.WriteOutput("Debug", "Path:" + pkg.Name + path, 0);
var sLevel = new string(' ', level * 2);
rep.WriteOutput("Debug", sLevel + (count+1).ToString(",0") + " Work for:" + path, 0);
if (path != "")
{
count = count + 1;
rep.ShowInProjectView(pkg);
// delete a potential write protection
try
{
var fileInfo = new FileInfo(path);
var attributes = (FileAttributes)(fileInfo.Attributes - FileAttributes.ReadOnly);
System.IO.File.SetAttributes(fileInfo.FullName, attributes);
System.IO.File.Delete(path);
}
catch (FileNotFoundException e)
{
fText = path + " " + e.Message;
rep.WriteOutput("Debug", fText, 0);
errorCount = errorCount + 1;
}
catch (DirectoryNotFoundException e)
{
fText = path + " " + e.Message;
rep.WriteOutput("Debug", fText, 0);
errorCount = errorCount + 1;
}
// get latest
try
{
// to make sure pkg is the correct reference
// new load of pkg after GetLatest
string pkgGuid = pkg.PackageGUID;
pkg.VersionControlGetLatest(true);
pkg = rep.GetPackageByGuid(pkgGuid);
count = count + 1;
}
catch
{
fText = path + " " + pkg.GetLastError();
rep.WriteOutput("Debug", fText, 0);
errorCount = errorCount + 1;
}
}
else
{
fText = pkg.XMLPath + " invalid path";
rep.WriteOutput("Debug", fText, 0);
errorCount = errorCount + 1;
}
}
//rep.WriteOutput("Debug", "Recursive:" +recursive.ToString(), 0);
if (recursive)
{
//rep.WriteOutput("Debug","Recursive count:" + pkg.Packages.Count.ToString(), 0);
// over all contained packages
foreach (EA.Package pkgNested in pkg.Packages)
{
//rep.WriteOutput("Debug", "Recursive:"+ pkgNested.Name, 0);
GetLatest(rep, pkgNested, true, ref count, level, ref errorCount);
}
}
return true;
}
示例5: CreateActivityForOperation
//.........这里部分代码省略.........
EA.Element frame = null; // frame beneath package
if (ActivityIsSimple == false)
{
// create Class Activity Diagram in target package
var pkgActDia = (EA.Diagram)pkgTrg.Diagrams.AddNew("Operation:" + m.Name + " Content", "Activity");
pkgActDia.Update();
pkgTrg.Diagrams.Refresh();
// add frame in Activity diagram
var frmObj = (EA.DiagramObject)pkgActDia.DiagramObjects.AddNew("l=100;r=400;t=25;b=50", "");
frame = (EA.Element)pkgTrg.Elements.AddNew(m.Name, "UMLDiagram");
frame.Update();
frmObj.ElementID = frame.ElementID;
//frmObj.Style = "fontsz=200;pitch=34;DUID=265D32D5;font=Arial Narrow;bold=0;italic=0;ul=0;charset=0;";
frmObj.Update();
pkgTrg.Elements.Refresh();
pkgActDia.DiagramObjects.Refresh();
}
// create activity with the name of the operation
var act = (EA.Element)pkgTrg.Elements.AddNew(m.Name, "Activity");
if (ActivityIsSimple == false)
{
act.Notes = "Generated from Operation:\r\n" + m.Visibility + " " + m.Name + ":" + m.ReturnType + ";\r\nDetails see Operation definition!!";
}
act.StereotypeEx = m.StereotypeEx;
act.Update();
pkgTrg.Elements.Refresh();
// create activity diagram beneath Activity
var actDia = (EA.Diagram)act.Diagrams.AddNew(m.Name, "Activity");
// update diagram properties
actDia.ShowDetails = 0; // hide details
// scale page to din A4
actDia.StyleEx = actDia.StyleEx.Length > 0 ? actDia.StyleEx.Replace("HideQuals=0", "HideQuals=1") : "HideQuals=1;";
// Hide Qualifier
actDia.ExtendedStyle = actDia.ExtendedStyle.Length > 0 ? actDia.ExtendedStyle.Replace("ScalePI=0", "ScalePI=1") : "ScalePI=1;";
actDia.Update();
act.Diagrams.Refresh();
// put the activity on the diagram
Util.AddSequenceNumber(rep, actDia);
var actObj = (EA.DiagramObject)actDia.DiagramObjects.AddNew("l=30;r=780;t=30;b=1120", "");
actObj.ElementID = act.ElementID;
actObj.Sequence = 1;
actObj.Update();
Util.SetSequenceNumber(rep, actDia, actObj, "1");
actDia.DiagramObjects.Refresh();
// add default nodes (init/final)
CreateDefaultElementsForActivity(rep, actDia, act);
if (ActivityIsSimple == false)
{
// Add Heading to diagram
Util.AddSequenceNumber(rep, actDia);
var noteObj = (EA.DiagramObject)actDia.DiagramObjects.AddNew("l=40;r=700;t=25;b=50", "");
var note = (EA.Element)pkgTrg.Elements.AddNew("Text", "Text");
note.Notes = m.Visibility + " " + elClass.Name + "_" + m.Name + ":" + m.ReturnType;
note.Update();
noteObj.ElementID = note.ElementID;
noteObj.Style = "fontsz=200;pitch=34;DUID=265D32D5;font=Arial Narrow;bold=0;italic=0;ul=0;charset=0;";
noteObj.Sequence = 1;
noteObj.Update();
Util.SetSequenceNumber(rep, actDia, noteObj, "1");
}
pkgTrg.Elements.Refresh();
actDia.DiagramObjects.Refresh();
// Link Operation to activity
Util.SetBehaviorForOperation(rep, m, act);
// Set show behavior
Util.SetShowBehaviorInDiagram(rep, m);
// add parameters to activity
UpdateParameterFromOperation(rep, act, m);
int pos = 0;
foreach (EA.Element actPar in act.EmbeddedElements)
{
if (! actPar.Type.Equals("ActivityParameter")) continue;
Util.VisualizePortForDiagramobject(pos, actDia, actObj, actPar, null);
pos = pos + 1;
}
if (ActivityIsSimple == false)
{
// link Overview frame to diagram
Util.SetFrameLinksToDiagram(rep, frame, actDia);
frame.Update();
}
// select operation
rep.ShowInProjectView(m);
return true;
}