示例#1
0
        private void PopulateAvailableColumns()
        {
            var handle = UrlHandle.Get();

            var itemUri = ItemUri.Parse(handle["id"]);

            var item = Sitecore.Data.Database.GetItem(itemUri);

            if (item == null)
            {
                return;
            }

            try
            {
                var referenceItem = new ReferenceItem(item);
                var viewer        = BaseViewer.Create(referenceItem.FullType, string.Empty);
                if (viewer == null)
                {
                    return;
                }


                foreach (var availableColumn in viewer.AvailableColumns)
                {
                    ColumnName.Controls.Add(new ListItem {
                        Header = availableColumn, Value = availableColumn.ToLowerInvariant()
                    });
                }
            }
            catch (FileNotFoundException)
            {
                //todo
            }
        }
示例#2
0
        public void LoadFile(string fileName, StringNoCaseDictionary <string> parameters, List <BaseCommand> commands)
        {
            if (_Viewer != null)
            {
                _Viewer.Parent = null;
                _Viewer.Dispose();
                _Viewer = null;

                ribbonPageGroupPrint.Visible = false;
                ribbonPageGroupFind.Visible  = false;
                ribbonPageGroupZoom.Visible  = false;
            }

            _Viewer = BaseViewer.CreateViewer(this, fileName, parameters, commands);
            if (_Viewer != null)
            {
                _Viewer.Dock   = DockStyle.Fill;
                _Viewer.Parent = this;
                _Viewer.BringToFront();

                ribbonPageGroupPrint.Visible = _Viewer.SupportPrint;
                ribbonPageGroupFind.Visible  = _Viewer.SupportFind;
                ribbonPageGroupZoom.Visible  = _Viewer.SupportZoom;
            }
        }
        public ChooseEntetyFromListHelper InitWindow <T>() where T : DataObject
        {
            ItemEditorViewer = BaseEditorStatic.GetDataViewer <T>();
            FilterViewer     = BaseEditorStatic.GetDataFilter <T>();
            var listItems = BaseEditorStatic.DataStorager.All <T>().ToList();

            FilterViewer.InitData(new ArrayList(listItems));
            _dicItems = new Dictionary <string, DataObject>();
            listItems.ForEach(i => _dicItems.Add(string.Format("{0}-{1}", i.Id, i.Name), i));
            _btnNames = _dicItems.Keys.ToArray();

            if (ItemEditorViewer.CanShow)
            {
                for (var i = 0; i < _btnNames.Length; i++)
                {
                    if (_btnNames[i] == string.Format("{0}-{1}", ItemEditorViewer.GetCurrent().Id, ItemEditorViewer.CurrentName))
                    {
                        _currentIndex = i;
                        break;
                    }
                }
            }
            else
            {
                _currentIndex = 0;
                ItemEditorViewer.SetCurrent(_dicItems[_btnNames[_currentIndex]]);
            }
            return(this);
        }
示例#4
0
        protected virtual void Disconnect()
        {
            if (_viewer != null)
            {
                _viewer.WorkspaceChanged -= new System.EventHandler(this.ContentChangedEventHandler);
            }

            _viewer = null;
        }
示例#5
0
        protected virtual void Connect(Aurigma.GraphicsMill.AjaxControls.BaseViewer viewer)
        {
            _viewer = viewer;

            if (_viewer != null)
            {
                _viewer.WorkspaceChanged += new System.EventHandler(this.ContentChangedEventHandler);
            }
        }
示例#6
0
        private void Awake()
        {
            _viewerEntity = BaseEditorStatic.GetDataViewer(CurrentBox.ObjectType);
            _viewerEntity.RefreshWindow += this.Repaint;
            _filterViewer = BaseEditorStatic.GetDataFilter(CurrentBox.ObjectType);
            _filterViewer.ChooseItemShow += item => _viewerEntity.SetCurrent(item);
            _filterViewer.RefreshWindow  += this.Repaint;

            ReloadData();
        }
 internal new static object InvokeRemoteScriptingMethod(Object instance, string methodName, object[] methodArgs)
 {
     return(BaseViewer.InvokeRemoteScriptingMethod(instance, methodName, methodArgs));
 }
 protected override void Connect(BaseViewer viewer)
 {
     base.Connect(viewer);
     this.Canvas.Zoom = viewer.Zoom;
 }