public PacketViewControl CreateControl(Guid class_id, Guid obj_id, PacketViewProperty viewp)
        {
            /* ビューIDからデバイスを検索 */
            var viewd = FindClass(class_id);

            if (viewd == null)
            {
                return(null);
            }

            /* デバイスインスタンス作成 */
            var viewi = viewd.CreateInstance(this, obj_id, viewp);

            if (viewi == null)
            {
                return(null);
            }

            var viewc = new PacketViewControl(this, viewi);

            /* デバイスインスタンス登録 */
            lock (viewc_list_) {
                viewc_list_.Add(viewc);
            }

            /* 初期化完了 */
            viewi.InitializeComplete = true;

            /* 初回の設定値バックアップ */
            viewi.BackupProperty();

            InstanceUpdated();

            return(viewc);
        }
        public PacketViewInstance(PacketViewManager viewm, PacketViewClass viewd, PacketViewProperty viewp, Guid id)
        {
            InitializeComponent();

            viewm_   = viewm;
            Class    = viewd;
            Property = viewp;
            ID       = id;
        }
        public PacketViewControl CreateControl(string class_id, Guid obj_id, PacketViewProperty viewp)
        {
            var id = Guid.Empty;

            if (!Guid.TryParse(class_id, out id))
            {
                return(null);
            }

            return(CreateControl(id, obj_id, viewp));
        }
Exemple #4
0
 protected virtual PacketViewInstance OnCreateInstance(PacketViewManager devm, Guid obj_id, PacketViewProperty devp)
 {
     return(null);
 }
Exemple #5
0
        internal PacketViewInstance CreateInstance(PacketViewManager viewm, Guid obj_id, PacketViewProperty viewp)
        {
            /* プロパティがnullのときはデフォルト値で新規作成 */
            if (viewp == null)
            {
                viewp = CreateProperty();
            }

            /* プロパティタイプが異なるときは失敗 */
            if (viewp.GetType() != GetPropertyType())
            {
                return(null);
            }

            return(OnCreateInstance(viewm, obj_id, viewp));
        }