FromUnixTimeStamp() public static method

public static FromUnixTimeStamp ( long unixTimeStamp ) : System.DateTime
unixTimeStamp long
return System.DateTime
Exemplo n.º 1
0
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.Identity
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));
            entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.member_name)));
            entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.membership_no)));
            entry.Strings.Set(PwDefs.UrlField, new ProtectedString(pwStorage.MemoryProtection.ProtectUrl, StringExt.GetValueOrEmpty(secureContents.website)));
            entry.Strings.Set("Mitglied seit", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.member_since_mm).PadLeft(2, '0') + " / " + StringExt.GetValueOrEmpty(secureContents.member_since_yy).PadLeft(4, '0')));
            entry.Strings.Set("Organisation", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.org_name)));

            if (!string.IsNullOrEmpty(StringExt.GetValueOrEmpty(secureContents.notesPlain)))
            {
                entry.Strings.Set(PwDefs.NotesField, new ProtectedString(pwStorage.MemoryProtection.ProtectNotes, StringExt.GetValueOrEmpty(secureContents.notesPlain)));
            }

            return(entry);
        }
Exemplo n.º 2
0
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.Money
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));
            entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.cardholder)));
            entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.ccnum)));
            entry.Strings.Set("Verification code", new ProtectedString(true, StringExt.GetValueOrEmpty(secureContents.cvv)));
            entry.Strings.Set("Date of Expiry", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.expiry_mm).PadLeft(2, '0') + " / " + StringExt.GetValueOrEmpty(secureContents.expiry_yy).PadLeft(4, '0')));
            entry.Strings.Set("Bank", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.bank)));

            if (!String.IsNullOrEmpty(secureContents.phoneIntl))
            {
                entry.Strings.Set("Phone", new ProtectedString(false, secureContents.phoneIntl));
            }

            if (!string.IsNullOrEmpty(StringExt.GetValueOrEmpty(secureContents.notesPlain)))
            {
                entry.Strings.Set(PwDefs.NotesField, new ProtectedString(pwStorage.MemoryProtection.ProtectNotes, StringExt.GetValueOrEmpty(secureContents.notesPlain)));
            }

            return(entry);
        }
Exemplo n.º 3
0
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.NetworkServer
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));
            entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.username)));
            entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.password)));

            if (!String.IsNullOrEmpty(secureContents.server))
            {
                entry.Strings.Set("Server", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.server)));
            }

            if (!string.IsNullOrEmpty(StringExt.GetValueOrEmpty(secureContents.notesPlain)))
            {
                entry.Strings.Set(PwDefs.NotesField, new ProtectedString(pwStorage.MemoryProtection.ProtectNotes, StringExt.GetValueOrEmpty(secureContents.notesPlain)));
            }

            return(entry);
        }
Exemplo n.º 4
0
        private static PwGroup CreateFolder(PwGroup groupAddTo, FolderRecord folderRecord)
        {
            PwGroup folder = new PwGroup(true, true);

            folder.Name                 = StringExt.GetValueOrEmpty(folderRecord.title);
            folder.CreationTime         = DateTimeExt.FromUnixTimeStamp(folderRecord.createdAt);
            folder.LastModificationTime = DateTimeExt.FromUnixTimeStamp(folderRecord.updatedAt);
            groupAddTo.AddGroup(folder, true);
            return(folder);
        }
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.Package
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));

            if (!String.IsNullOrEmpty(secureContents.reg_name))
            {
                entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.reg_name)));

                if (!String.IsNullOrEmpty(secureContents.reg_email))
                {
                    entry.Strings.Set("Registration E-mail", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.reg_email)));
                }
            }
            else
            {
                entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.reg_email)));
            }

            entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.reg_code)));

            if (!String.IsNullOrEmpty(secureContents.download_link))
            {
                entry.Strings.Set(PwDefs.UrlField, new ProtectedString(pwStorage.MemoryProtection.ProtectUrl, StringExt.GetValueOrEmpty(secureContents.download_link)));

                if (!String.IsNullOrEmpty(secureContents.publisher_website))
                {
                    entry.Strings.Set("Publisher website", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.publisher_website)));
                }
            }
            else if (!String.IsNullOrEmpty(secureContents.publisher_website))
            {
                entry.Strings.Set(PwDefs.UrlField, new ProtectedString(pwStorage.MemoryProtection.ProtectUrl, StringExt.GetValueOrEmpty(secureContents.publisher_website)));
            }

            entry.Strings.Set("Publisher", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.publisher_name)));
            entry.Strings.Set("Version", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.product_version)));
            entry.Strings.Set("Support E-mail", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.support_email)));
            entry.Strings.Set("Order number", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.order_number)));

            if (!string.IsNullOrEmpty(StringExt.GetValueOrEmpty(secureContents.notesPlain)))
            {
                entry.Strings.Set(PwDefs.NotesField, new ProtectedString(pwStorage.MemoryProtection.ProtectNotes, StringExt.GetValueOrEmpty(secureContents.notesPlain)));
            }

            return(entry);
        }
Exemplo n.º 6
0
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.IRCommunication
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));
            entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.network_name)));
            entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.wireless_password)));
            entry.Strings.Set(PwDefs.UrlField, new ProtectedString(pwStorage.MemoryProtection.ProtectUrl, StringExt.GetValueOrEmpty(secureContents.server)));

            if (!String.IsNullOrEmpty(secureContents.network_name))
            {
                entry.Strings.Set("Network name", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.network_name)));
            }

            if (!String.IsNullOrEmpty(secureContents.airport_id))
            {
                entry.Strings.Set("AirPort ID", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.airport_id)));
            }

            if (!String.IsNullOrEmpty(secureContents.wireless_security))
            {
                entry.Strings.Set("Wireless security", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.wireless_security)));
            }

            if (!String.IsNullOrEmpty(secureContents.name))
            {
                entry.Strings.Set("Name of base station", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.name)));
            }

            if (!String.IsNullOrEmpty(secureContents.password))
            {
                entry.Strings.Set("Password of base station", new ProtectedString(true, StringExt.GetValueOrEmpty(secureContents.password)));
            }

            if (!String.IsNullOrEmpty(secureContents.disk_password))
            {
                entry.Strings.Set("Password for network storage", new ProtectedString(true, StringExt.GetValueOrEmpty(secureContents.disk_password)));
            }

            if (!string.IsNullOrEmpty(StringExt.GetValueOrEmpty(secureContents.notesPlain)))
            {
                entry.Strings.Set(PwDefs.NotesField, new ProtectedString(pwStorage.MemoryProtection.ProtectNotes, StringExt.GetValueOrEmpty(secureContents.notesPlain)));
            }

            return(entry);
        }
Exemplo n.º 7
0
        private static void CreateUnknown(PwGroup groupAddTo, PwDatabase pwStorage, UnknownRecord record)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.Warning
            };

            entry.CreationTime         = DateTimeExt.FromUnixTimeStamp(record.createdAt);
            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(record.updatedAt);
            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(record.title)));
            entry.Strings.Set(PwDefs.UrlField, new ProtectedString(pwStorage.MemoryProtection.ProtectUrl, StringExt.GetValueOrEmpty(record.location)));
            entry.Strings.Set(PwDefs.NotesField,
                              new ProtectedString(pwStorage.MemoryProtection.ProtectNotes, StringExt.GetValueOrEmpty(record.typeName)));
        }
Exemplo n.º 8
0
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.Key
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));
            entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.password)));
            entry.Strings.Set(PwDefs.UrlField, new ProtectedString(pwStorage.MemoryProtection.ProtectUrl, StringExt.GetValueOrEmpty(location)));

            return(entry);
        }
Exemplo n.º 9
0
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.Identity
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));
            entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.owner)));
            entry.Strings.Set("BIC/SWIFT", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.swift)));
            entry.Strings.Set("IBAN", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.iban)));
            entry.Strings.Set("Kontonummer", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.accountNo)));
            entry.Strings.Set("Bankleitzahl", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.routingNo)));
            entry.Strings.Set("Bank", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.bankName)));

            if (!String.IsNullOrEmpty(secureContents.accountType))
            {
                entry.Strings.Set("Konto-Typ", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.accountType)));
            }

            if (!String.IsNullOrEmpty(secureContents.telephonePin))
            {
                entry.Strings.Set("Telefon-PIN", new ProtectedString(true, StringExt.GetValueOrEmpty(secureContents.telephonePin)));
            }

            if (!String.IsNullOrEmpty(secureContents.branchAddress))
            {
                entry.Strings.Set("Filiale", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.branchAddress)));
            }

            if (!String.IsNullOrEmpty(secureContents.branchPhone))
            {
                entry.Strings.Set("Filiale (Telefon)", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.branchPhone)));
            }

            if (!string.IsNullOrEmpty(StringExt.GetValueOrEmpty(secureContents.notesPlain)))
            {
                entry.Strings.Set(PwDefs.NotesField, new ProtectedString(pwStorage.MemoryProtection.ProtectNotes, StringExt.GetValueOrEmpty(secureContents.notesPlain)));
            }

            return(entry);
        }
Exemplo n.º 10
0
        public override PwEntry CreatePwEntry(PwDatabase pwStorage)
        {
            PwEntry entry = new PwEntry(true, true)
            {
                IconId = PwIcon.EMail
            };

            entry.CreationTime = DateTimeExt.FromUnixTimeStamp(createdAt);

            entry.LastModificationTime = DateTimeExt.FromUnixTimeStamp(updatedAt);

            entry.Strings.Set(PwDefs.TitleField, new ProtectedString(pwStorage.MemoryProtection.ProtectTitle, StringExt.GetValueOrEmpty(title)));
            entry.Strings.Set(PwDefs.UserNameField, new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.pop_username)));
            entry.Strings.Set(PwDefs.PasswordField, new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.pop_password)));
            entry.Strings.Set(PwDefs.UrlField, new ProtectedString(pwStorage.MemoryProtection.ProtectUrl, StringExt.GetValueOrEmpty(secureContents.provider_website)));

            if (!String.IsNullOrEmpty(secureContents.pop_type))
            {
                entry.Strings.Set("POP Typ", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.pop_security)));
            }

            if (!String.IsNullOrEmpty(secureContents.pop_server))
            {
                entry.Strings.Set("POP Server", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.pop_server)));
            }

            if (!String.IsNullOrEmpty(secureContents.pop_port))
            {
                entry.Strings.Set("POP Port", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.pop_port)));
            }

            if (!String.IsNullOrEmpty(secureContents.pop_security))
            {
                entry.Strings.Set("POP Sicherheit", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.pop_security)));
            }

            if (!String.IsNullOrEmpty(secureContents.pop_authentication))
            {
                entry.Strings.Set("POP Authentifizierung", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.pop_authentication)));
            }

            if (!String.IsNullOrEmpty(secureContents.smtp_server))
            {
                entry.Strings.Set("SMTP Server", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.smtp_server)));
            }

            if (!String.IsNullOrEmpty(secureContents.smtp_port))
            {
                entry.Strings.Set("SMTP Port", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.smtp_port)));
            }

            if (!String.IsNullOrEmpty(secureContents.smtp_security))
            {
                entry.Strings.Set("SMTP Sicherheit", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.smtp_security)));
            }

            if (!String.IsNullOrEmpty(secureContents.smtp_authentication))
            {
                entry.Strings.Set("SMTP Authentifizierung", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.smtp_authentication)));
            }

            if (!String.IsNullOrEmpty(secureContents.smtp_username))
            {
                entry.Strings.Set("SMTP Benutzername", new ProtectedString(pwStorage.MemoryProtection.ProtectUserName, StringExt.GetValueOrEmpty(secureContents.smtp_username)));
            }

            if (!String.IsNullOrEmpty(secureContents.smtp_password))
            {
                entry.Strings.Set("SMTP Passwort", new ProtectedString(pwStorage.MemoryProtection.ProtectPassword, StringExt.GetValueOrEmpty(secureContents.smtp_password)));
            }

            if (!String.IsNullOrEmpty(secureContents.provider))
            {
                entry.Strings.Set("Anbieter", new ProtectedString(false, StringExt.GetValueOrEmpty(secureContents.provider)));
            }

            return(entry);
        }