C# 클래스 JWC.MruStripMenu

Represents a most recently used (MRU) menu.
This class shows the MRU list in a popup menu. To display the MRU list "inline" use .

The class will optionally load the last set of files from the registry on construction and store them when instructed by the main program.

Internally, this class uses zero-based numbering for the items. The displayed numbers, however, will start with one.

파일 보기 프로젝트 열기: procfxgen/MGShaderEditor 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
maxEntries int
maxShortenPathLength int
mruStripMutex System.Threading.Mutex
numEntries int
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
registryKeyName string

공개 메소드들

메소드 설명
AddFile ( string filename ) : void
AddFile ( string filename, string entryname ) : void
AddFiles ( string filenames ) : void
FindFilenameMenuIndex ( string filename ) : int

Returns the menu index of the passed filename.

FindFilenameNumber ( string filename ) : int

Returns the entry number matching the passed filename.

FixupEntryname ( int number, string entryname ) : string
GetFileAt ( int number ) : string
GetFiles ( ) : string[]
GetFilesFullEntrystring ( ) : string[]
GetMenuIndex ( int number ) : int

Returns the menu index for a specified MRU item number.

LoadFromRegistry ( ) : void
LoadFromRegistry ( string keyName ) : void
MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler ) : System

Initializes a new instance of the MruMenu class.

MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, int maxEntries ) : System

Initializes a new instance of the MruMenu class.

MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName ) : System

Initializes a new instance of the MruMenu class.

MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, bool loadFromRegistry ) : System

Initializes a new instance of the MruMenu class.

MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, bool loadFromRegistry, int maxEntries ) : System

Initializes a new instance of the MruMenu class.

MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, int maxEntries ) : System

Initializes a new instance of the MruMenu class.

RemoveAll ( ) : void
RemoveFile ( int number ) : void
RemoveFile ( string filename ) : void
RenameFile ( string oldFilename, string newFilename ) : void
RenameFile ( string oldFilename, string newFilename, string newEntryname ) : void
SaveToRegistry ( ) : void
SaveToRegistry ( string keyName ) : void
SetFiles ( string filenames ) : void
SetFirstFile ( int number ) : void
ShortenPathname ( string pathname, int maxLength ) : string

Shortens a pathname for display purposes.

Shortens a pathname by either removing consecutive components of a path and/or by removing characters from the end of the filename and replacing then with three elipses (...)

In all cases, the root of the passed path will be preserved in it's entirety.

If a UNC path is used or the pathname and maxLength are particularly short, the resulting path may be longer than maxLength.

This method expects fully resolved pathnames to be passed to it. (Use Path.GetFullPath() to obtain this.)

보호된 메소드들

메소드 설명
Disable ( ) : void
Enable ( ) : void
FixupPrefixes ( int startNumber ) : void
Init ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, bool loadFromRegistry, int maxEntries ) : void
MruStripMenu ( ) : System
OnClick ( object sender, System e ) : void
SetFirstFile ( MruMenuItem menuItem ) : void

메소드 상세

AddFile() 공개 메소드

public AddFile ( string filename ) : void
filename string
리턴 void

AddFile() 공개 메소드

public AddFile ( string filename, string entryname ) : void
filename string
entryname string
리턴 void

AddFiles() 공개 메소드

public AddFiles ( string filenames ) : void
filenames string
리턴 void

Disable() 보호된 메소드

protected Disable ( ) : void
리턴 void

Enable() 보호된 메소드

protected Enable ( ) : void
리턴 void

FindFilenameMenuIndex() 공개 메소드

Returns the menu index of the passed filename.
public FindFilenameMenuIndex ( string filename ) : int
filename string The filename to search for.
리턴 int

FindFilenameNumber() 공개 메소드

Returns the entry number matching the passed filename.
public FindFilenameNumber ( string filename ) : int
filename string The filename to search for.
리턴 int

FixupEntryname() 공개 정적인 메소드

public static FixupEntryname ( int number, string entryname ) : string
number int
entryname string
리턴 string

FixupPrefixes() 보호된 메소드

protected FixupPrefixes ( int startNumber ) : void
startNumber int
리턴 void

GetFileAt() 공개 메소드

public GetFileAt ( int number ) : string
number int
리턴 string

GetFiles() 공개 메소드

public GetFiles ( ) : string[]
리턴 string[]

GetFilesFullEntrystring() 공개 메소드

public GetFilesFullEntrystring ( ) : string[]
리턴 string[]

GetMenuIndex() 공개 메소드

Returns the menu index for a specified MRU item number.
public GetMenuIndex ( int number ) : int
number int The MRU item number.
리턴 int

Init() 보호된 메소드

protected Init ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, bool loadFromRegistry, int maxEntries ) : void
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
clickedHandler ClickedHandler
registryKeyName string
loadFromRegistry bool
maxEntries int
리턴 void

LoadFromRegistry() 공개 메소드

public LoadFromRegistry ( ) : void
리턴 void

LoadFromRegistry() 공개 메소드

public LoadFromRegistry ( string keyName ) : void
keyName string
리턴 void

MruStripMenu() 보호된 메소드

protected MruStripMenu ( ) : System
리턴 System

MruStripMenu() 공개 메소드

Initializes a new instance of the MruMenu class.
public MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler ) : System
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
clickedHandler ClickedHandler
리턴 System

MruStripMenu() 공개 메소드

Initializes a new instance of the MruMenu class.
public MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, int maxEntries ) : System
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
clickedHandler ClickedHandler
maxEntries int
리턴 System

MruStripMenu() 공개 메소드

Initializes a new instance of the MruMenu class.
public MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName ) : System
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
clickedHandler ClickedHandler
registryKeyName string
리턴 System

MruStripMenu() 공개 메소드

Initializes a new instance of the MruMenu class.
public MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, bool loadFromRegistry ) : System
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
clickedHandler ClickedHandler
registryKeyName string
loadFromRegistry bool
리턴 System

MruStripMenu() 공개 메소드

Initializes a new instance of the MruMenu class.
public MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, bool loadFromRegistry, int maxEntries ) : System
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
clickedHandler ClickedHandler
registryKeyName string
loadFromRegistry bool
maxEntries int
리턴 System

MruStripMenu() 공개 메소드

Initializes a new instance of the MruMenu class.
public MruStripMenu ( ToolStripMenuItem recentFileMenuItem, ClickedHandler clickedHandler, string registryKeyName, int maxEntries ) : System
recentFileMenuItem System.Windows.Forms.ToolStripMenuItem
clickedHandler ClickedHandler
registryKeyName string
maxEntries int
리턴 System

OnClick() 보호된 메소드

protected OnClick ( object sender, System e ) : void
sender object
e System
리턴 void

RemoveAll() 공개 메소드

public RemoveAll ( ) : void
리턴 void

RemoveFile() 공개 메소드

public RemoveFile ( int number ) : void
number int
리턴 void

RemoveFile() 공개 메소드

public RemoveFile ( string filename ) : void
filename string
리턴 void

RenameFile() 공개 메소드

public RenameFile ( string oldFilename, string newFilename ) : void
oldFilename string
newFilename string
리턴 void

RenameFile() 공개 메소드

public RenameFile ( string oldFilename, string newFilename, string newEntryname ) : void
oldFilename string
newFilename string
newEntryname string
리턴 void

SaveToRegistry() 공개 메소드

public SaveToRegistry ( ) : void
리턴 void

SaveToRegistry() 공개 메소드

public SaveToRegistry ( string keyName ) : void
keyName string
리턴 void

SetFiles() 공개 메소드

public SetFiles ( string filenames ) : void
filenames string
리턴 void

SetFirstFile() 보호된 메소드

protected SetFirstFile ( MruMenuItem menuItem ) : void
menuItem MruMenuItem
리턴 void

SetFirstFile() 공개 메소드

public SetFirstFile ( int number ) : void
number int
리턴 void

ShortenPathname() 정적인 공개 메소드

Shortens a pathname for display purposes.
Shortens a pathname by either removing consecutive components of a path and/or by removing characters from the end of the filename and replacing then with three elipses (...)

In all cases, the root of the passed path will be preserved in it's entirety.

If a UNC path is used or the pathname and maxLength are particularly short, the resulting path may be longer than maxLength.

This method expects fully resolved pathnames to be passed to it. (Use Path.GetFullPath() to obtain this.)

static public ShortenPathname ( string pathname, int maxLength ) : string
pathname string
maxLength int
리턴 string

프로퍼티 상세

maxEntries 보호되어 있는 프로퍼티

protected int maxEntries
리턴 int

maxShortenPathLength 보호되어 있는 프로퍼티

protected int maxShortenPathLength
리턴 int

mruStripMutex 보호되어 있는 프로퍼티

protected Mutex,System.Threading mruStripMutex
리턴 System.Threading.Mutex

numEntries 보호되어 있는 프로퍼티

protected int numEntries
리턴 int

recentFileMenuItem 보호되어 있는 프로퍼티

protected ToolStripMenuItem,System.Windows.Forms recentFileMenuItem
리턴 System.Windows.Forms.ToolStripMenuItem

registryKeyName 보호되어 있는 프로퍼티

protected string registryKeyName
리턴 string