コード例 #1
0
ファイル: TextDialog.cs プロジェクト: kanbang/Colt
 public TextDialog(EditorBindableCollapsiblePanel parent, ISimpleSymbolDefinition sym, ITextGraphic text)
 {
     InitializeComponent();
     _ed = parent;
     _sym = sym;
     _text = text;
 }
コード例 #2
0
ファイル: ImageDialog.cs プロジェクト: kanbang/Colt
        public ImageDialog(EditorBindableCollapsiblePanel parent, IResourceService resSvc, ISimpleSymbolDefinition ssd, IImageGraphic image)
        {
            InitializeComponent();
            _ed = parent;
            _ssd = ssd;
            _image = image;
            _resSvc = resSvc;
            try
            {
                _init = true;
                if (_image.Item.Type == ImageType.Reference)
                {
                    _imageRef = (IImageReference)_image.Item;
                    rdResourceRef.Checked = true;
                }
                else
                {
                    _imageInline = (IInlineImage)_image.Item;
                    rdInline.Checked = true;
                }

                if (_imageRef == null)
                    _imageRef = ssd.CreateImageReference("", "");
                else
                    rdResourceRef.Checked = true;

                if (_imageInline == null)
                    _imageInline = ssd.CreateInlineImage(new byte[0]);
                else
                    rdInline.Checked = true;

                txtResourceId.Text = _imageRef.ResourceId;
                txtResData.Text = _imageRef.LibraryItemName;

                txtImageBase64.Text = Convert.ToBase64String(_imageInline.Content);
                txtImageBase64.Tag = _imageInline.Content;

                imageType_CheckedChanged(this, null);
            }
            finally
            {
                _init = false;
            }
        }