public CpRootCollectionContainer() { PropertyString ps = new PropertyString(T[CdsMetadata._DC.title], "All MediaServers"); this.m_ID = System.Guid.NewGuid().ToString(); ArrayList al = new ArrayList(); al.Add(ps); this.SetClass("object.container", ""); this.m_Properties[T[CdsMetadata._DC.title]] = al; }
/// <summary> /// <para> /// This method clears the hashtable values for all properties. /// </para> /// <para> /// Derived classes will have access to this and so will internal classes. /// Programmers deriving from this object are strongly encouraged to not use /// this unless they ABSOLUTELY know what they're doing. /// </para> /// </summary> internal void ClearProperties() { try { this.m_LockTable.AcquireWriterLock(-1); this.m_Table = new ArrayList(2); this.m_Title = null; this.m_Creator = null; this.m_Class = null; this.IncrementStateNumber(); } finally { this.m_LockTable.ReleaseWriterLock(); } }
/// <summary> /// Sets a value in the hashtable /// </summary> /// <param name="key">property name</param> private void SetVal(string key, ICdsElement[] objs) { //this.m_Table[key] = objs; if ((key == T[_DC.title])) { this.m_Title = (PropertyString)objs[0]; } else if ((key == T[_DC.creator])) { this.m_Creator = (PropertyString)objs[0]; } else if ((key == T[_UPNP.Class])) { this.m_Class = (MediaClass)objs[0]; } else { Exception error = null; try { this.m_LockTable.AcquireWriterLock(-1); try { _Hashtable.Set(m_Table, key, objs); } catch (Exception e) { error = e; } } finally { this.m_LockTable.ReleaseWriterLock(); } if (error != null) { Exception ne = new Exception("MediaProperties.set_this[string]()", error); throw ne; } } this.IncrementStateNumber(); }
/// <summary> /// Special ISerializable constructor. /// Do basic initialization and then serialize from the info object. /// </summary> /// <param name="info"></param> /// <param name="context"></param> private MediaProperties(SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { Init(); this.m_Table = (ArrayList)info.GetValue("m_Table", typeof(ArrayList)); this.m_Title = (PropertyString)info.GetValue("m_Title", typeof(PropertyString)); this.m_Creator = (PropertyString)info.GetValue("m_Creator", typeof(PropertyString)); this.m_Class = (MediaClass)info.GetValue("m_Class", typeof(MediaClass)); this.IsEnabled_OnMetadataChanged = info.GetBoolean("IsEnabled_OnMetadataChanged"); }