C# 클래스 SIL.FieldWorks.FdoUi.CmObjectUi

상속: IxCoreColleague, IFWDisposable
파일 보기 프로젝트 열기: sillsdev/FieldWorks 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
m_cache SIL.FieldWorks.FDO.FdoCache
m_hostControl System.Windows.Forms.Control
m_hvo int
m_mediator XCore.Mediator
m_obj ICmObject
m_vc IVwViewConstructor

공개 메소드들

메소드 설명
CanDelete ( string &cannotDeleteMsg ) : bool
CheckDisposed ( ) : void

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.

CmObjectUi ( ICmObject obj ) : System

If you KNOW for SURE the right subclass of CmObjectUi, you can just make one directly. Most clients should use MakeUi.

ConsiderDeletingRelatedFile ( ICmFile file, XCore.Mediator mediator ) : void
CreateNewUiObject ( XCore.Mediator mediator, int classId, int hvoOwner, int flid, int insertionPosition ) : CmObjectUi

Create a new FDO object.

DeleteUnderlyingObject ( ) : bool

Delete the object, after showing a confirmation dialog. Return true if deleted, false, if cancelled.

Dispose ( ) : void

Must not be virtual.

GetMessageTargets ( ) : IxCoreColleague[]

return an array of all of the objects which should 1) be queried when looking for someone to deliver a message to 2) be potential recipients of a broadcast

GetSelfOrParentOfClass ( ICmObject cmo, int classIdToSearchFor ) : ICmObject

Return either the object or an owner ("parent") up the ownership chain that is of the desired class. Being a subclass of the desired class also matches, unlike ICmObject.OwnerOfClass() where the class must match exactly.

GuidForJumping ( object commandObject ) : System.Guid

gives the guid of the object to use in the URL we construct when doing a jump

HandleCtrlClick ( XCore.Mediator mediator, Control hostControl ) : bool

Handle a control-click by invoking the first active JumpToTool menu item. Note that the item selected here should be the same one that is selected by Mark

HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed ) : bool

Handle a right click by popping up the implied context menu.

HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed, Action adjustMenu ) : bool

Handle a right click by popping up the implied context menu.

HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed, string sMenuId ) : bool

Handle the right click by popping up an explicit context menu id.

HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed, string sMenuId, Action adjustMenu ) : bool

Handle the right click by popping up an explicit context menu id.

Init ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
LaunchGuiControl ( Command command ) : void
MakeUi ( SIL.FieldWorks.FDO.FdoCache cache, int hvo ) : CmObjectUi

In many cases we don't really need the FDO object, which can be relatively expensive to create. This version saves the information, and creates it when needed.

MakeUi ( ICmObject obj ) : CmObjectUi

This is the main class factory that makes a corresponding CmObjectUi for any given CmObject.

MarkCtrlClickItem ( ContextMenuStrip menu ) : void

Given a populated choice group, mark the one that will be invoked by a ctrl-click. This method is typically used as the menuAdjuster argument in calling HandleRightClick. It's important that it marks the same menu item as selected by HandlCtrlClick.

MergeUnderlyingObject ( bool fLoseNoTextData ) : void

Merge the underling objects. This method handles the confirm dialog, then delegates the actual merge to ReallyMergeUnderlyingObject. If the flag is true, we merge strings and owned atomic objects; otherwise, we don't change any that aren't null to begin with.

MoveUnderlyingObjectToCopyOfOwner ( ) : void

OnDeleteSelectedItem ( object commandObject ) : void
OnDisplayDeleteSelectedItem ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

Hack to "remove" the delete menu from the popup menu.

OnDisplayJumpToTool ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool

called by the mediator to decide how/if a MenuItem or toolbar button should be displayed

OnJumpToTool ( object commandObject ) : bool

This method CALLED BY REFLECTION is required to make various right-click menu commands like Show Entry in Lexicon work in browse views. FWR-3695.

ParseSinglePropertySequenceValueIntoHvos ( string singlePropertySequenceValue, SIL.FieldWorks.FDO.FdoCache cacheForCheckingValidity, int expectedClassId ) : List

RGB ( Color c ) : uint

Convert a .NET color to the type understood by Views code and other Win32 stuff.

RGB ( int r, int g, int b ) : uint

Make a standard Win32 color from three components.

ToStatusBar ( ) : string

Get a string suitable for use in the left panel of the LexText status bar. It will show the created and modified dates, if the object has them.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.

If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.

DoRelatedCleanupForDeleteObject ( ) : void

Do any cleanup that involves interacting with the user, after the user has confirmed that our object should be deleted.

GetMergeinfo ( SIL.FieldWorks.LexText.Controls.WindowParams wp, List mergeCandidates, string &guiControl, string &helpTopic ) : DummyCmObject
IsAcceptableContextToJump ( string toolCurrent, string toolTarget ) : bool
ReallyDeleteUnderlyingObject ( ) : void
ReallyMergeUnderlyingObject ( int survivorHvo, bool fLoseNoTextData ) : void

Merge the underling objects. This method handles the transaction, then delegates the actual merge to MergeObject. If the flag is true, we merge strings and owned atomic objects; otherwise, we don't change any that aren't null to begin with.

ShouldDisplayMenuForClass ( int specifiedClsid, XCore.UIItemDisplayProperties display ) : bool

비공개 메소드들

메소드 설명
CmObjectUi ( ) : System

This should only be used by MakeUi.

DefaultCreateNewUiObject ( int classId, int hvoOwner, int flid, int insertionPosition, SIL.FieldWorks.FDO.FdoCache cache ) : CmObjectUi
GetCurrentCmObject ( ) : ICmObject
IsCtrlClickItem ( object item ) : bool
MakeUi ( SIL.FieldWorks.FDO.FdoCache cache, int hvo, int clsid ) : CmObjectUi

메소드 상세

CanDelete() 공개 메소드

public CanDelete ( string &cannotDeleteMsg ) : bool
cannotDeleteMsg string
리턴 bool

CheckDisposed() 공개 메소드

Check to see if the object has been disposed. All public Properties and Methods should call this before doing anything else.
public CheckDisposed ( ) : void
리턴 void

CmObjectUi() 공개 메소드

If you KNOW for SURE the right subclass of CmObjectUi, you can just make one directly. Most clients should use MakeUi.
public CmObjectUi ( ICmObject obj ) : System
obj ICmObject
리턴 System

ConsiderDeletingRelatedFile() 공개 정적인 메소드

public static ConsiderDeletingRelatedFile ( ICmFile file, XCore.Mediator mediator ) : void
file ICmFile
mediator XCore.Mediator
리턴 void

CreateNewUiObject() 공개 정적인 메소드

Create a new FDO object.
public static CreateNewUiObject ( XCore.Mediator mediator, int classId, int hvoOwner, int flid, int insertionPosition ) : CmObjectUi
mediator XCore.Mediator
classId int
hvoOwner int
flid int
insertionPosition int
리턴 CmObjectUi

DeleteUnderlyingObject() 공개 메소드

Delete the object, after showing a confirmation dialog. Return true if deleted, false, if cancelled.
public DeleteUnderlyingObject ( ) : bool
리턴 bool

Dispose() 공개 메소드

Must not be virtual.
public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

Executes in two distinct scenarios. 1. If disposing is true, the method has been called directly or indirectly by a user's code via the Dispose method. Both managed and unmanaged resources can be disposed. 2. If disposing is false, the method has been called by the runtime from inside the finalizer and you should not reference (access) other managed objects, as they already have been garbage collected. Only unmanaged resources can be disposed.
If any exceptions are thrown, that is fine. If the method is being done in a finalizer, it will be ignored. If it is thrown by client code calling Dispose, it needs to be handled by fixing the bug. If subclasses override this method, they should call the base implementation.
protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

DoRelatedCleanupForDeleteObject() 보호된 메소드

Do any cleanup that involves interacting with the user, after the user has confirmed that our object should be deleted.
protected DoRelatedCleanupForDeleteObject ( ) : void
리턴 void

GetMergeinfo() 보호된 메소드

protected GetMergeinfo ( SIL.FieldWorks.LexText.Controls.WindowParams wp, List mergeCandidates, string &guiControl, string &helpTopic ) : DummyCmObject
wp SIL.FieldWorks.LexText.Controls.WindowParams
mergeCandidates List
guiControl string
helpTopic string
리턴 DummyCmObject

GetMessageTargets() 공개 메소드

return an array of all of the objects which should 1) be queried when looking for someone to deliver a message to 2) be potential recipients of a broadcast
public GetMessageTargets ( ) : IxCoreColleague[]
리턴 IxCoreColleague[]

GetSelfOrParentOfClass() 공개 정적인 메소드

Return either the object or an owner ("parent") up the ownership chain that is of the desired class. Being a subclass of the desired class also matches, unlike ICmObject.OwnerOfClass() where the class must match exactly.
public static GetSelfOrParentOfClass ( ICmObject cmo, int classIdToSearchFor ) : ICmObject
cmo ICmObject
classIdToSearchFor int
리턴 ICmObject

GuidForJumping() 공개 메소드

gives the guid of the object to use in the URL we construct when doing a jump
public GuidForJumping ( object commandObject ) : System.Guid
commandObject object
리턴 System.Guid

HandleCtrlClick() 공개 메소드

Handle a control-click by invoking the first active JumpToTool menu item. Note that the item selected here should be the same one that is selected by Mark
public HandleCtrlClick ( XCore.Mediator mediator, Control hostControl ) : bool
mediator XCore.Mediator
hostControl System.Windows.Forms.Control
리턴 bool

HandleRightClick() 공개 메소드

Handle a right click by popping up the implied context menu.
public HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed ) : bool
mediator XCore.Mediator
hostControl System.Windows.Forms.Control
shouldDisposeThisWhenClosed bool True, if the menu handler is to dispose of the CmObjectUi after menu closing
리턴 bool

HandleRightClick() 공개 메소드

Handle a right click by popping up the implied context menu.
public HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed, Action adjustMenu ) : bool
mediator XCore.Mediator
hostControl System.Windows.Forms.Control
shouldDisposeThisWhenClosed bool True, if the menu handler is to dispose of the CmObjectUi after menu closing
adjustMenu Action
리턴 bool

HandleRightClick() 공개 메소드

Handle the right click by popping up an explicit context menu id.
public HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed, string sMenuId ) : bool
mediator XCore.Mediator
hostControl System.Windows.Forms.Control
shouldDisposeThisWhenClosed bool True, if the menu handler is to dispose of the CmObjectUi after menu closing
sMenuId string
리턴 bool

HandleRightClick() 공개 메소드

Handle the right click by popping up an explicit context menu id.
public HandleRightClick ( XCore.Mediator mediator, Control hostControl, bool shouldDisposeThisWhenClosed, string sMenuId, Action adjustMenu ) : bool
mediator XCore.Mediator
hostControl System.Windows.Forms.Control
shouldDisposeThisWhenClosed bool True, if the menu handler is to dispose of the CmObjectUi after menu closing
sMenuId string
adjustMenu Action
리턴 bool

Init() 공개 메소드

public Init ( XCore.Mediator mediator, XmlNode configurationParameters ) : void
mediator XCore.Mediator
configurationParameters System.Xml.XmlNode
리턴 void

IsAcceptableContextToJump() 보호된 메소드

protected IsAcceptableContextToJump ( string toolCurrent, string toolTarget ) : bool
toolCurrent string
toolTarget string
리턴 bool

LaunchGuiControl() 공개 메소드

public LaunchGuiControl ( Command command ) : void
command Command
리턴 void

MakeUi() 공개 정적인 메소드

In many cases we don't really need the FDO object, which can be relatively expensive to create. This version saves the information, and creates it when needed.
public static MakeUi ( SIL.FieldWorks.FDO.FdoCache cache, int hvo ) : CmObjectUi
cache SIL.FieldWorks.FDO.FdoCache
hvo int
리턴 CmObjectUi

MakeUi() 공개 정적인 메소드

This is the main class factory that makes a corresponding CmObjectUi for any given CmObject.
public static MakeUi ( ICmObject obj ) : CmObjectUi
obj ICmObject
리턴 CmObjectUi

MarkCtrlClickItem() 공개 정적인 메소드

Given a populated choice group, mark the one that will be invoked by a ctrl-click. This method is typically used as the menuAdjuster argument in calling HandleRightClick. It's important that it marks the same menu item as selected by HandlCtrlClick.
public static MarkCtrlClickItem ( ContextMenuStrip menu ) : void
menu System.Windows.Forms.ContextMenuStrip
리턴 void

MergeUnderlyingObject() 공개 메소드

Merge the underling objects. This method handles the confirm dialog, then delegates the actual merge to ReallyMergeUnderlyingObject. If the flag is true, we merge strings and owned atomic objects; otherwise, we don't change any that aren't null to begin with.
public MergeUnderlyingObject ( bool fLoseNoTextData ) : void
fLoseNoTextData bool
리턴 void

MoveUnderlyingObjectToCopyOfOwner() 공개 메소드

public MoveUnderlyingObjectToCopyOfOwner ( ) : void
리턴 void

OnDeleteSelectedItem() 공개 메소드

public OnDeleteSelectedItem ( object commandObject ) : void
commandObject object
리턴 void

OnDisplayDeleteSelectedItem() 공개 메소드

Hack to "remove" the delete menu from the popup menu.
public OnDisplayDeleteSelectedItem ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
리턴 bool

OnDisplayJumpToTool() 공개 메소드

called by the mediator to decide how/if a MenuItem or toolbar button should be displayed
public OnDisplayJumpToTool ( object commandObject, XCore.UIItemDisplayProperties &display ) : bool
commandObject object
display XCore.UIItemDisplayProperties
리턴 bool

OnJumpToTool() 공개 메소드

This method CALLED BY REFLECTION is required to make various right-click menu commands like Show Entry in Lexicon work in browse views. FWR-3695.
public OnJumpToTool ( object commandObject ) : bool
commandObject object
리턴 bool

ParseSinglePropertySequenceValueIntoHvos() 정적인 공개 메소드

static public ParseSinglePropertySequenceValueIntoHvos ( string singlePropertySequenceValue, SIL.FieldWorks.FDO.FdoCache cacheForCheckingValidity, int expectedClassId ) : List
singlePropertySequenceValue string
cacheForCheckingValidity SIL.FieldWorks.FDO.FdoCache null, if you don't care about checking the validity of the items in singlePropertySequenceValue, /// otherwise, pass in a cache to check validity.
expectedClassId int if you pass a cache, you can also use this too make sure the object matches an expected class, /// otherwise it just checks that the object exists in the database (or is a valid virtual object)
리턴 List

RGB() 정적인 공개 메소드

Convert a .NET color to the type understood by Views code and other Win32 stuff.
static public RGB ( Color c ) : uint
c Color
리턴 uint

RGB() 정적인 공개 메소드

Make a standard Win32 color from three components.
static public RGB ( int r, int g, int b ) : uint
r int
g int
b int
리턴 uint

ReallyDeleteUnderlyingObject() 보호된 메소드

protected ReallyDeleteUnderlyingObject ( ) : void
리턴 void

ReallyMergeUnderlyingObject() 보호된 메소드

Merge the underling objects. This method handles the transaction, then delegates the actual merge to MergeObject. If the flag is true, we merge strings and owned atomic objects; otherwise, we don't change any that aren't null to begin with.
protected ReallyMergeUnderlyingObject ( int survivorHvo, bool fLoseNoTextData ) : void
survivorHvo int
fLoseNoTextData bool
리턴 void

ShouldDisplayMenuForClass() 보호된 메소드

protected ShouldDisplayMenuForClass ( int specifiedClsid, XCore.UIItemDisplayProperties display ) : bool
specifiedClsid int
display XCore.UIItemDisplayProperties
리턴 bool

ToStatusBar() 공개 메소드

Get a string suitable for use in the left panel of the LexText status bar. It will show the created and modified dates, if the object has them.
public ToStatusBar ( ) : string
리턴 string

프로퍼티 상세

m_cache 보호되어 있는 프로퍼티

protected FdoCache,SIL.FieldWorks.FDO m_cache
리턴 SIL.FieldWorks.FDO.FdoCache

m_hostControl 보호되어 있는 프로퍼티

protected Control,System.Windows.Forms m_hostControl
리턴 System.Windows.Forms.Control

m_hvo 보호되어 있는 프로퍼티

protected int m_hvo
리턴 int

m_mediator 보호되어 있는 프로퍼티

protected Mediator,XCore m_mediator
리턴 XCore.Mediator

m_obj 보호되어 있는 프로퍼티

protected ICmObject m_obj
리턴 ICmObject

m_vc 보호되어 있는 프로퍼티

protected IVwViewConstructor m_vc
리턴 IVwViewConstructor