Beispiel #1
0
            public Stream(uint session, string name, StreamApplyMethod apply,
                          Guid guid)
            {
                if (String.IsNullOrWhiteSpace(name))
                {
                    throw new ArgumentException("name");
                }

                Name        = name;
                _session    = session;
                ApplyMethod = apply;

                Guid typeGuid;

                if (!_searchStream(out typeGuid))
                {
                    Id      = Native.INVALID_STREAM_ID;
                    _handle = IntPtr.Zero;
                }
                else
                {
                    if ((!guid.Equals(Guid.Empty)) && (!guid.Equals(typeGuid)))
                    {
                        throw new ReplayException(String.Format(
                                                      "Expected type {0} for stream '{1}', but found {2}.",
                                                      guid, name, typeGuid));
                    }
                }
            }
Beispiel #2
0
 public Stream(uint session, string name, StreamApplyMethod apply) :
     this(session, name, apply, Guid.Empty)
 {
 }