コード例 #1
0
 /// <summary>
 /// This method should release all non managered object and UnRegister this object from CasterLocator.
 /// Whether disposing is true or false, COM resource should be released.
 /// </summary>
 /// <param name="disposing">true if invoked by user, false if invoked by GC</param>
 protected virtual void Dispose(bool disposing)
 {
     if (RegisterToLocator)
     {
         CasterLocator.UnRegister(this);
     }
     if (disposing)
     {
     }
 }
コード例 #2
0
        /// <summary>
        /// Constructor of base class of all CapeOpen component
        /// </summary>
        /// <param name="name">ComponentName</param>
        /// <param name="description">description of component</param>
        /// <param name="canRename">if false, component will raise an exception when trying to change ComponentName</param>
        /// <param name="registerToLocator">should this block be registered to CasterLocator</param>
        protected CapeOpenBaseObject(string name    = "COComponent", string description = "",
                                     bool canRename = true, bool registerToLocator      = false)
        {
            _name             = name;
            _description      = description;
            CanRename         = canRename;
            Dirty             = false;
            RegisterToLocator = registerToLocator;

            if (RegisterToLocator)
            {
                CasterLocator.Register(this);
            }
        }