本文整理汇总了C#中PwGroup类的典型用法代码示例。如果您正苦于以下问题:C# PwGroup类的具体用法?C# PwGroup怎么用?C# PwGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PwGroup类属于命名空间,在下文中一共展示了PwGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitEx
public void InitEx(PwGroup pgDataSource, bool bPrintMode)
{
Debug.Assert(pgDataSource != null); if(pgDataSource == null) throw new ArgumentNullException("pgDataSource");
m_pgDataSource = pgDataSource;
m_bPrintMode = bPrintMode;
}
示例2: ImportRecord
private static void ImportRecord(Node<BaseRecord> currentNode, PwGroup groupAddTo, PwDatabase pwStorage)
{
BaseRecord record = currentNode.AssociatedObject;
if (record.GetType() == typeof(FolderRecord))
{
FolderRecord folderRecord = (FolderRecord)record;
var folder = CreateFolder(groupAddTo, folderRecord);
foreach (var node in currentNode.Nodes)
{
ImportRecord(node, folder, pwStorage);
}
}
else if (record.GetType() == typeof(WebFormRecord))
{
WebFormRecord webForm = (WebFormRecord)record;
CreateWebForm(groupAddTo, pwStorage, webForm);
}
else if (record.GetType() == typeof(BaseRecord))
{
//Trace.WriteLine(String.Format("Error. Can't import unknown record type: {0}", record.RawJson));
}
else if (record.GetType() == typeof(UnknownRecord))
{
//CreateUnknown(groupAddTo, pwStorage, record as UnknownRecord);
}
}
示例3: InitEx
public void InitEx(PwGroup pgEntrySource, ImageList ilClientIcons,
string strDefaultRef)
{
m_pgEntrySource = pgEntrySource;
m_ilIcons = ilClientIcons;
m_strDefaultRef = (strDefaultRef ?? string.Empty);
}
示例4: CreateSummaryList
public static string CreateSummaryList(PwGroup pgItems, bool bStartWithNewPar)
{
List<PwEntry> l = pgItems.GetEntries(true).CloneShallowToList();
string str = CreateSummaryList(pgItems, l.ToArray());
if((str.Length == 0) || !bStartWithNewPar) return str;
return (MessageService.NewParagraph + str);
}
示例5: InitEx
public void InitEx(PwGroup pgDataSource, bool bPrintMode, int nDefaultSortColumn)
{
Debug.Assert(pgDataSource != null); if(pgDataSource == null) throw new ArgumentNullException("pgDataSource");
m_pgDataSource = pgDataSource;
m_bPrintMode = bPrintMode;
m_nDefaultSortColumn = nDefaultSortColumn;
}
示例6: ModifyWith
public GxiContext ModifyWith(PwGroup pg)
{
GxiContext c = (GxiContext)MemberwiseClone();
Debug.Assert(object.ReferenceEquals(c.m_dStringKeyRepl, m_dStringKeyRepl));
c.m_pg = pg;
return c;
}
示例7: MoveElement
public MoveElement(IStructureItem elementToMove, PwGroup targetGroup, Context ctx, IKp2aApp app, OnFinish finish)
: base(finish)
{
_elementToMove = elementToMove;
_targetGroup = targetGroup;
_ctx = ctx;
_app = app;
}
示例8: InitEx
public void InitEx(PwGroup pg, bool bCreatingNew, ImageList ilClientIcons,
PwDatabase pwDatabase)
{
m_pwGroup = pg;
m_bCreatingNew = bCreatingNew;
m_ilClientIcons = ilClientIcons;
m_pwDatabase = pwDatabase;
}
示例9: Save
// public void Save(string strFile, PwGroup pgDataSource, KdbxFormat format,
// IStatusLogger slLogger)
// {
// bool bMadeUnhidden = UrlUtil.UnhideFile(strFile);
//
// IOConnectionInfo ioc = IOConnectionInfo.FromPath(strFile);
// this.Save(IOConnection.OpenWrite(ioc), pgDataSource, format, slLogger);
//
// if(bMadeUnhidden) UrlUtil.HideFile(strFile, true); // Hide again
// }
/// <summary>
/// Save the contents of the current <c>PwDatabase</c> to a KDBX file.
/// </summary>
/// <param name="sSaveTo">Stream to write the KDBX file into.</param>
/// <param name="pgDataSource">Group containing all groups and
/// entries to write. If <c>null</c>, the complete database will
/// be written.</param>
/// <param name="format">Format of the file to create.</param>
/// <param name="slLogger">Logger that recieves status information.</param>
public void Save(Stream sSaveTo, PwGroup pgDataSource, KdbxFormat format,
IStatusLogger slLogger)
{
Debug.Assert(sSaveTo != null);
if(sSaveTo == null) throw new ArgumentNullException("sSaveTo");
m_format = format;
m_slLogger = slLogger;
HashingStreamEx hashedStream = new HashingStreamEx(sSaveTo, true, null);
UTF8Encoding encNoBom = StrUtil.Utf8;
CryptoRandom cr = CryptoRandom.Instance;
try
{
m_pbMasterSeed = cr.GetRandomBytes(32);
m_pbTransformSeed = cr.GetRandomBytes(32);
m_pbEncryptionIV = cr.GetRandomBytes(16);
m_pbProtectedStreamKey = cr.GetRandomBytes(32);
m_craInnerRandomStream = CrsAlgorithm.Salsa20;
m_randomStream = new CryptoRandomStream(m_craInnerRandomStream,
m_pbProtectedStreamKey);
m_pbStreamStartBytes = cr.GetRandomBytes(32);
Stream writerStream;
if(m_format == KdbxFormat.Default)
{
WriteHeader(hashedStream); // Also flushes the stream
Stream sEncrypted = AttachStreamEncryptor(hashedStream);
if((sEncrypted == null) || (sEncrypted == hashedStream))
throw new SecurityException(KLRes.CryptoStreamFailed);
sEncrypted.Write(m_pbStreamStartBytes, 0, m_pbStreamStartBytes.Length);
Stream sHashed = new HashedBlockStream(sEncrypted, true);
if(m_pwDatabase.Compression == PwCompressionAlgorithm.GZip)
writerStream = new GZipStream(sHashed, CompressionMode.Compress);
else
writerStream = sHashed;
}
else if(m_format == KdbxFormat.PlainXml)
writerStream = hashedStream;
else { Debug.Assert(false); throw new FormatException("KdbFormat"); }
m_xmlWriter = new XmlTextWriter(writerStream, encNoBom);
WriteDocument(pgDataSource);
m_xmlWriter.Flush();
m_xmlWriter.Close();
writerStream.Close();
}
finally { CommonCleanUpWrite(sSaveTo, hashedStream); }
}
示例10: Launch
public static void Launch(Activity act, PwGroup parentGroup)
{
Intent i = new Intent(act, typeof(GroupEditActivity));
PwGroup parent = parentGroup;
i.PutExtra(KeyParent, parent.Uuid.ToHexString());
act.StartActivityForResult(i, 0);
}
示例11: GetGroupPath
public static string GetGroupPath(PwGroup group)
{
string path = GetGroupPathRec(group);
if (path.Length > 0) {
return path;
} else {
return "(Root)";
}
}
示例12: GetGroupPathRec
private static string GetGroupPathRec(PwGroup group)
{
if (group.ParentGroup != null) {
string parent = GetGroupPathRec(group.ParentGroup);
return parent + (parent.Length > 0 ? "/" : "") + group.Name;
} else {
// Empty, because we don't need the name of DB in path, which is the root.
return "";
}
}
示例13: AddProduct
private void AddProduct(PwDatabase database, PwGroup group, Product product)
{
var productGroup = group.FindCreateGroup(product.Name, true);
foreach (var key in product.Keys)
{
if(!GroupContainsKeyAsPassword(productGroup,key))
AddKey(database, productGroup, key);
}
}
开发者ID:jeff2001,项目名称:MicrosoftKeyImporterPlugin,代码行数:10,代码来源:MicrosoftKeysExportFileFormatProvider.cs
示例14: AddKey
private void AddKey(PwDatabase database, PwGroup group, Key key)
{
var entry = new PwEntry(true, true);
group.AddEntry(entry, true);
entry.Strings.Set(PwDefs.TitleField, new ProtectedString(database.MemoryProtection.ProtectTitle, key.Type));
entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(database.MemoryProtection.ProtectPassword, key.Value));
entry.Strings.Set(PwDefs.NotesField, new ProtectedString(database.MemoryProtection.ProtectNotes, key.Description));
}
开发者ID:jeff2001,项目名称:MicrosoftKeyImporterPlugin,代码行数:10,代码来源:MicrosoftKeysExportFileFormatProvider.cs
示例15: AddEntry
protected AddEntry(Context ctx, IKp2aApp app, PwEntry entry, PwGroup parentGroup, OnFinish finish)
: base(finish)
{
_ctx = ctx;
_parentGroup = parentGroup;
_app = app;
_entry = entry;
_onFinishToRun = new AfterAdd(app.GetDb(), entry, OnFinishToRun);
}