本文整理汇总了C#中KeePass.UI.DynamicMenuEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DynamicMenuEventArgs类的具体用法?C# DynamicMenuEventArgs怎么用?C# DynamicMenuEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DynamicMenuEventArgs类属于KeePass.UI命名空间,在下文中一共展示了DynamicMenuEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OnShowEntriesByTag
private void OnShowEntriesByTag(object sender, DynamicMenuEventArgs e)
{
if(e == null) { Debug.Assert(false); return; }
ShowEntriesByTag(e.Tag as string);
}
开发者ID:riking,项目名称:go-keepass2,代码行数:5,代码来源:MainForm_Functions.cs
示例2: OnCopyCustomString
private void OnCopyCustomString(object sender, DynamicMenuEventArgs e)
{
string strKey = (e.Tag as string);
if(strKey == null) { Debug.Assert(false); return; }
PwEntry pe = GetSelectedEntry(false);
if(pe == null) { Debug.Assert(false); return; }
if(ClipboardUtil.CopyAndMinimize(pe.Strings.GetSafe(strKey), true,
this, pe, m_docMgr.ActiveDatabase))
StartClipboardCountdown();
}
开发者ID:riking,项目名称:go-keepass2,代码行数:12,代码来源:MainForm_Functions.cs
示例3: OnEntryBinaryOpen
private void OnEntryBinaryOpen(object sender, DynamicMenuEventArgs e)
{
if(e == null) { Debug.Assert(false); return; }
EntryBinaryDataContext ctx = (e.Tag as EntryBinaryDataContext);
if(ctx == null) { Debug.Assert(false); return; }
PwEntry pe = ctx.Entry;
if(pe == null) { Debug.Assert(false); return; }
Debug.Assert(object.ReferenceEquals(pe, GetSelectedEntry(false)));
if(string.IsNullOrEmpty(ctx.Name)) { Debug.Assert(false); return; }
ProtectedBinary pb = pe.Binaries.Get(ctx.Name);
if(pb == null) { Debug.Assert(false); return; }
ProtectedBinary pbMod = BinaryDataUtil.Open(ctx.Name, pb, ctx.Options);
if(pbMod != null)
{
pe.Binaries.Set(ctx.Name, pbMod);
pe.Touch(true, false);
RefreshEntriesList();
UpdateUIState(true);
}
}
开发者ID:riking,项目名称:go-keepass2,代码行数:25,代码来源:MainForm_Functions.cs
示例4: OnEntryBinaryView
private void OnEntryBinaryView(object sender, DynamicMenuEventArgs e)
{
PwEntry pe = GetSelectedEntry(false);
if(pe == null) { Debug.Assert(false); return; }
ProtectedBinary pbData = pe.Binaries.Get(e.ItemName);
if(pbData == null) { Debug.Assert(false); return; }
DataViewerForm dvf = new DataViewerForm();
dvf.InitEx(e.ItemName, pbData.ReadData());
dvf.ShowDialog();
}
开发者ID:jonbws,项目名称:strengthreport,代码行数:13,代码来源:MainForm_Functions.cs
示例5: ExecuteBinaryOpen
private void ExecuteBinaryOpen(PwEntry pe, string strBinName)
{
EntryBinaryDataContext ctx = new EntryBinaryDataContext();
ctx.Entry = pe;
ctx.Name = strBinName;
DynamicMenuEventArgs args = new DynamicMenuEventArgs(strBinName, ctx);
OnEntryBinaryOpen(null, args);
}
开发者ID:riking,项目名称:go-keepass2,代码行数:9,代码来源:MainForm_Functions.cs
示例6: OnEntryMoveToGroup
private void OnEntryMoveToGroup(object sender, DynamicMenuEventArgs e)
{
PwGroup pgTo = (e.Tag as PwGroup);
if(pgTo == null) { Debug.Assert(false); return; }
m_pgActiveAtDragStart = GetSelectedGroup();
MoveOrCopySelectedEntries(pgTo, DragDropEffects.Move);
}
开发者ID:riking,项目名称:go-keepass2,代码行数:8,代码来源:MainForm_Functions.cs
示例7: OnOpenUrl
private void OnOpenUrl(object sender, DynamicMenuEventArgs e)
{
if(e == null) { Debug.Assert(false); return; }
OpenWithItem it = (e.Tag as OpenWithItem);
if(it == null) { Debug.Assert(false); return; }
PwEntry[] v = Program.MainForm.GetSelectedEntries();
if(v == null) { Debug.Assert(false); return; }
foreach(PwEntry pe in v)
{
string strUrl = pe.Strings.ReadSafe(PwDefs.UrlField);
if(string.IsNullOrEmpty(strUrl)) continue;
WinUtil.OpenUrlWithApp(strUrl, pe, it.FilePath);
}
}
开发者ID:eis,项目名称:keepass-eis-flavored,代码行数:18,代码来源:OpenWithMenu.cs
示例8: OnEntryBinaryView
private void OnEntryBinaryView(object sender, DynamicMenuEventArgs e)
{
PwEntry pe = GetSelectedEntry(false);
if(pe == null) { Debug.Assert(false); return; }
EditableBinaryAttachment eba = (e.Tag as EditableBinaryAttachment);
ProtectedBinary pbData = pe.Binaries.Get((eba != null) ? eba.Name :
e.ItemName);
if(pbData == null) { Debug.Assert(false); return; }
if(eba == null) // Not editable
{
DataViewerForm dvf = new DataViewerForm();
dvf.InitEx(e.ItemName, pbData.ReadData());
UIUtil.ShowDialogAndDestroy(dvf);
}
else
{
DataEditorForm def = new DataEditorForm();
def.InitEx(eba.Name, pbData.ReadData());
def.ShowDialog();
if(def.EditedBinaryData != null) // User changed the data
{
pe.Binaries.Set(eba.Name, new ProtectedBinary(false,
def.EditedBinaryData));
pe.Touch(true, false);
RefreshEntriesList();
UpdateUIState(true);
}
UIUtil.DestroyForm(def);
}
}
开发者ID:elitak,项目名称:keepass,代码行数:35,代码来源:MainForm_Functions.cs
示例9: OnShowEntriesByTag
private void OnShowEntriesByTag(object sender, DynamicMenuEventArgs e)
{
string strTag = (e.Tag as string);
if(strTag == null) { Debug.Assert(false); return; }
if(strTag.Length == 0) return; // No assert
PwDatabase pd = m_docMgr.ActiveDatabase;
if((pd == null) || !pd.IsOpen) { Debug.Assert(false); return; }
PwObjectList<PwEntry> vEntries = new PwObjectList<PwEntry>();
pd.RootGroup.FindEntriesByTag(strTag, vEntries, true);
PwGroup pgResults = new PwGroup(true, true);
pgResults.IsVirtual = true;
foreach(PwEntry pe in vEntries) pgResults.AddEntry(pe, false);
UpdateUI(false, null, false, null, true, pgResults, false);
}
开发者ID:elitak,项目名称:keepass,代码行数:18,代码来源:MainForm_Functions.cs
示例10: ExecuteBinaryEditView
private void ExecuteBinaryEditView(string strBinName, ProtectedBinary pb)
{
BinaryDataClass bdc = BinaryDataClassifier.Classify(strBinName,
pb.ReadData());
DynamicMenuEventArgs args = new DynamicMenuEventArgs(strBinName,
DataEditorForm.SupportsDataType(bdc) ?
new EditableBinaryAttachment(strBinName) : null);
OnEntryBinaryView(null, args);
}
开发者ID:elitak,项目名称:keepass,代码行数:9,代码来源:MainForm_Functions.cs
示例11: OnCopyCustomString
private void OnCopyCustomString(object sender, DynamicMenuEventArgs e)
{
PwEntry pe = GetSelectedEntry(false);
if(pe == null) return;
if(ClipboardUtil.CopyAndMinimize(pe.Strings.GetSafe(e.ItemName), true,
this, pe, m_docMgr.ActiveDatabase))
StartClipboardCountdown();
}
开发者ID:elitak,项目名称:keepass,代码行数:9,代码来源:MainForm_Functions.cs
示例12: m_dynCustomStrings_MenuClick
void m_dynCustomStrings_MenuClick(object sender, DynamicMenuEventArgs e)
{
PwEntry pe = m_host.MainWindow.GetSelectedEntry(false);
if (pe == null) return;
if (ClipboardUtil.CopyAndMinimize(pe.Strings.ReadSafe((string)e.Tag), true, m_host.MainWindow, pe, m_host.Database))
m_host.MainWindow.StartClipboardCountdown();
}
开发者ID:mitchcapper,项目名称:KPEntryTemplates,代码行数:8,代码来源:KPEntryTemplates.cs
示例13: OnProfilesDynamicMenuClick
private void OnProfilesDynamicMenuClick(object sender, DynamicMenuEventArgs e)
{
PwProfile pwp = null;
if(e.ItemName == DeriveFromPrevious)
{
byte[] pbCur = m_secPassword.ToUtf8();
ProtectedString psCur = new ProtectedString(true, pbCur);
Array.Clear(pbCur, 0, pbCur.Length);
pwp = PwProfile.DeriveFromPassword(psCur);
}
else
{
foreach(PwProfile pwgo in Program.Config.PasswordGenerator.UserProfiles)
{
if(pwgo.Name == e.ItemName)
{
pwp = pwgo;
break;
}
}
}
if(pwp != null)
{
ProtectedString psNew = new ProtectedString(true);
PwGenerator.Generate(psNew, pwp, null, Program.PwGeneratorPool);
byte[] pbNew = psNew.ReadUtf8();
m_secPassword.SetPassword(pbNew);
m_secRepeat.SetPassword(pbNew);
Array.Clear(pbNew, 0, pbNew.Length);
}
else { Debug.Assert(false); }
}
开发者ID:amiryal,项目名称:keepass2,代码行数:33,代码来源:PwEntryForm.cs
示例14: OnShowQRCode
public void OnShowQRCode(object sender, DynamicMenuEventArgs e)
{
var key = e.Tag as string;
if (key == null)
{
return;
}
var pe = host.MainWindow.GetSelectedEntry(true);
if (pe == null)
{
return;
}
var context = new SprContext(pe, host.Database, SprCompileFlags.All);
var value = SprEngine.Compile(pe.Strings.GetSafe(key).ReadString(), context);
try
{
var data = new QRCodeGenerator().CreateQrCode(value, QRCodeGenerator.ECCLevel.L);
if (data != null)
{
var form = new ShowQRCodeForm(
host,
data.GetBitmap(10, Color.Black, Color.White),
SprEngine.Compile(pe.Strings.GetSafe(PwDefs.TitleField).ReadString(), context),
TryTranslateKey(key)
);
form.ShowDialog();
}
}
catch
{
MessageBox.Show("The data can't be displayed as a QR Code.");
}
}
开发者ID:KN4CK3R,项目名称:KeePassQRCodeView,代码行数:36,代码来源:KeePassQRCodeViewExt.cs
示例15: OnAddEntryTag
private void OnAddEntryTag(object sender, DynamicMenuEventArgs e)
{
string strTag = (e.Tag as string);
if(strTag == null) { Debug.Assert(false); return; }
if(strTag.Length == 0)
{
SingleLineEditForm dlg = new SingleLineEditForm();
dlg.InitEx(KPRes.TagNew, KPRes.TagAddNew, KPRes.Name + ":",
Properties.Resources.B48x48_KMag, string.Empty, null);
if(UIUtil.ShowDialogNotValue(dlg, DialogResult.OK)) return;
strTag = dlg.ResultString;
UIUtil.DestroyForm(dlg);
}
if(!string.IsNullOrEmpty(strTag))
AddOrRemoveTagsToFromSelectedEntries(strTag, true);
}
开发者ID:riking,项目名称:go-keepass2,代码行数:19,代码来源:MainForm_Functions.cs
示例16: OnDynBinOpen
private void OnDynBinOpen(object sender, DynamicMenuEventArgs e)
{
if(e == null) { Debug.Assert(false); return; }
BinaryDataOpenOptions opt = (e.Tag as BinaryDataOpenOptions);
if(opt == null) { Debug.Assert(false); return; }
OpenSelBin(opt);
}
开发者ID:rdealexb,项目名称:keepass,代码行数:9,代码来源:PwEntryForm.cs
示例17: OnRemoveEntryTag
private void OnRemoveEntryTag(object sender, DynamicMenuEventArgs e)
{
string strTag = (e.Tag as string);
if(strTag == null) { Debug.Assert(false); return; }
if(strTag.Length == 0) return;
AddOrRemoveTagsToFromSelectedEntries(strTag, false);
}
开发者ID:riking,项目名称:go-keepass2,代码行数:8,代码来源:MainForm_Functions.cs
示例18: OnProfilesDynamicMenuClick
private void OnProfilesDynamicMenuClick(object sender, DynamicMenuEventArgs e)
{
string strProfile = (e.Tag as string);
if(strProfile == null) { Debug.Assert(false); return; }
PwProfile pwp = null;
if(strProfile == DeriveFromPrevious)
{
byte[] pbCur = m_icgPassword.GetPasswordUtf8();
ProtectedString psCur = new ProtectedString(true, pbCur);
MemUtil.ZeroByteArray(pbCur);
pwp = PwProfile.DeriveFromPassword(psCur);
}
else if(strProfile == AutoGenProfile)
pwp = Program.Config.PasswordGenerator.AutoGeneratedPasswordsProfile;
else
{
foreach(PwProfile pwgo in PwGeneratorUtil.GetAllProfiles(false))
{
if(pwgo.Name == strProfile)
{
pwp = pwgo;
break;
}
}
}
if(pwp != null)
{
ProtectedString psNew;
PwGenerator.Generate(out psNew, pwp, null, Program.PwGeneratorPool);
byte[] pbNew = psNew.ReadUtf8();
m_icgPassword.SetPassword(pbNew, true);
MemUtil.ZeroByteArray(pbNew);
}
else { Debug.Assert(false); }
}
开发者ID:rdealexb,项目名称:keepass,代码行数:37,代码来源:PwEntryForm.cs
示例19: OnMenuClick
private void OnMenuClick(object sender, EventArgs e)
{
ToolStripItem tsi = (sender as ToolStripItem);
Debug.Assert(tsi != null); if(tsi == null) return;
string strText = tsi.Text;
Debug.Assert(strText != null); if(strText == null) return;
DynamicMenuEventArgs args = new DynamicMenuEventArgs(strText, tsi.Tag);
if(this.MenuClick != null) this.MenuClick(sender, args);
}
开发者ID:haro-freezd,项目名称:KeePass,代码行数:11,代码来源:DynamicMenu.cs
示例20: OnProfilesDynamicMenuClick
private void OnProfilesDynamicMenuClick(object sender, DynamicMenuEventArgs e)
{
PwProfile pwp = null;
if (e.ItemName == DeriveFromPrevious) {
pwp = PwProfile.DeriveFromPassword(new ProtectedString(true, current_password_field.ToUtf8()));
}
else {
foreach (PwProfile pwgo in Program.Config.PasswordGenerator.UserProfiles) {
if (pwgo.Name == e.ItemName) {
pwp = pwgo;
break;
}
}
}
if (pwp != null) {
ProtectedString psNew;
PwGenerator.Generate(out psNew, pwp, null, m_host.PwGeneratorPool);
current_password_field.SetPassword(psNew.ReadUtf8());
current_password_confirm_field.SetPassword(psNew.ReadUtf8());
}
else { Debug.Assert(false); }
}
开发者ID:mitchcapper,项目名称:KPEntryTemplates,代码行数:25,代码来源:EntryTemplateManager.ChildViewer.cs
注:本文中的KeePass.UI.DynamicMenuEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论