www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/@mbcmodel/@model/pAssertIsBeingEdited.m

    function e = pAssertIsBeingEdited(obj,message)
%PASSERTISBEINGEDITED -- 
%
%  E = PASSERTISBEINGEDITED(OBJ)
%  E = PASSERTISBEINGEDITED(OBJ,MESSAGE)
%
%  See also PASSERTNOTBEINGEDITED.

%  Copyright 2006 The MathWorks, Inc.

if nargin<2,
    message = 'Model objects cannot be edited until BeginEdit has been invoked';
end

if obj.IsBeingEdited,
    e = struct( 'identifier', {}, 'message', {} );
else
    e = struct( ...
        'identifier', 'mbc:mbcmodel:model:InvalidState', ...
        'message', message );
end