コード例 #1
0
ファイル: MergeableFileHeader.cs プロジェクト: kazuki/p2pncs
 public MergeableFileHeader(Key key, string title, MergeableFileHeaderFlags flags, DateTime created, DateTime lastManaged, IHashComputable content, AuthServerInfo[] authServers, byte[] sign, Key recordsetHash)
 {
     if (created.Kind != DateTimeKind.Utc || lastManaged.Kind != DateTimeKind.Utc)
         throw new ArgumentException ();
     if (content == null)
         throw new ArgumentNullException ();
     _key = key;
     _title = title;
     _flags = flags;
     _created = created;
     _lastManaged = lastManaged;
     _content = content;
     _authServers = authServers;
     _sign = sign;
     _recordsetHash = (recordsetHash != null ? recordsetHash : new Key (new byte[DefaultAlgorithm.HashByteSize]));
     if (_recordsetHash.KeyBytes != DefaultAlgorithm.HashByteSize)
         throw new FormatException ();
 }
コード例 #2
0
ファイル: WebAppWiki.cs プロジェクト: kazuki/p2pncs
 public bool ParseNewPagePostData(Dictionary<string, string> dic, out IHashComputable header, out IHashComputable[] records)
 {
     header = new WikiHeader ();
     records = null;
     return true;
 }
コード例 #3
0
ファイル: MergeableFileHeader.cs プロジェクト: kazuki/p2pncs
 public MergeableFileHeader(string title, MergeableFileHeaderFlags flags, IHashComputable content, AuthServerInfo[] authServers)
     : this(null, title, flags, DateTime.UtcNow, DateTime.UtcNow, content, authServers, null, null)
 {
 }
コード例 #4
0
ファイル: BBSApp.cs プロジェクト: kazuki/p2pncs
        public bool ParseNewPagePostData(Dictionary<string, string> dic, out IHashComputable header, out IHashComputable[] records)
        {
            string fpname, fpbody;
            ParseNewPagePostData (dic, out fpname, out fpbody);

            header = new SimpleBBSHeader ();
            if (fpbody.Length == 0) {
                records = null;
            } else {
                records = new IHashComputable[] {
                    new SimpleBBSRecord (fpname, fpbody)
                };
            }
            return true;
        }