コード例 #1
0
ファイル: ResourceListEditor.cs プロジェクト: Joxx0r/ATF
        /// <summary>
        /// Finishes initializing component by creating ListView and initializing it, subscribing to drag events,
        /// and registering the control</summary>
        void IInitializable.Initialize()
        {
            m_resourcesListView = new ListView();
            m_resourcesListView.SmallImageList = ResourceUtil.GetImageList16();
            m_resourcesListView.AllowDrop = true;
            m_resourcesListView.MultiSelect = true;
            m_resourcesListView.AllowColumnReorder = true;
            m_resourcesListView.LabelEdit = true;
            m_resourcesListView.Dock = DockStyle.Fill;

            m_resourcesListView.DragOver += new DragEventHandler(resourcesListView_DragOver);
            m_resourcesListView.DragDrop += new DragEventHandler(resourcesListView_DragDrop);
            m_resourcesListView.MouseUp += new MouseEventHandler(resourcesListView_MouseUp);
            m_resourcesListViewAdapter = new ListViewAdapter(m_resourcesListView);
            m_resourcesListViewAdapter.LabelEdited +=
                new EventHandler<LabelEditedEventArgs<object>>(resourcesListViewAdapter_LabelEdited);

            m_resourcesControlInfo = new ControlInfo(
                Localizer.Localize("Resources"),
                Localizer.Localize("Resources for selected Event"),
                StandardControlGroup.Bottom);

            m_controlHostService.RegisterControl(m_resourcesListView, m_resourcesControlInfo, this);

            if (m_settingsService != null)
            {
                SettingsServices.RegisterSettings(
                    m_settingsService,
                    this,
                    new BoundPropertyDescriptor(this, () => ListViewSettings, "ListViewSettings", "", "")
                );
            }
        }
コード例 #2
0
ファイル: CodeDocument.cs プロジェクト: Joxx0r/ATF
        /// <summary>
        /// Constructor</summary>
        /// <param name="uri">URI of document</param>
        public CodeDocument(Uri uri)
        {
            if (uri == null)
                throw new ArgumentNullException("uri");

            m_uri = uri;

            string filePath = uri.LocalPath;
            string fileName = Path.GetFileName(filePath);

            m_type = GetDocumentType(fileName);

            m_editor = TextEditorFactory.CreateSyntaxHighlightingEditor();

            Languages lang = GetDocumentLanguage(fileName);
            m_editor.SetLanguage(lang);
            Control ctrl = (Control)m_editor;
            ctrl.Tag = this;

            m_editor.EditorTextChanged += editor_EditorTextChanged;

            m_controlInfo = new ControlInfo(fileName, filePath, StandardControlGroup.Center);
            // tell ControlHostService this control should be considered a document in the menu, 
            // and using the full path of the document for menu text to avoid adding a number in the end 
            // in control header,  which is not desirable for documents that have the same name 
            // but located at different directories.
            m_controlInfo.IsDocument = true;
        }
コード例 #3
0
ファイル: StoryDocument.cs プロジェクト: lxjk/ButterflyEngine
        public void Init(Uri uri)
        {         
            if (uri == null)
                throw new ArgumentNullException("uri");

            string filePath = uri.LocalPath;
            string fileName = Path.GetFileName(filePath);

            Control ctrl = m_editor.Control;
            ctrl.Tag = this;

            //m_editor.EditorTextChanged += editor_EditorTextChanged;

            Story story = this.Cast<Story>();
            if (story.Settings == null)
            {
                story.Settings = Settings.New(Schema.storyType.settingsChild);
            }

            story.Settings.DomNode.AttributeChanged += DomNode_AttributeChanged;
            story.Settings.DomNode.ChildInserted += DomNode_ChildInserted;
            story.Settings.DomNode.ChildRemoved += DomNode_ChildRemoved;

            MakeSyntaxXml();

            m_controlInfo = new ControlInfo(fileName, filePath, StandardControlGroup.Center);
            // tell ControlHostService this control should be considered a document in the menu, 
            // and using the full path of the document for menu text to avoid adding a number in the end 
            // in control header,  which is not desirable for documents that have the same name 
            // but located at different directories.
            m_controlInfo.IsDocument = true;

            Uri = uri;

        }
コード例 #4
0
        /// <summary>
        /// Finishes initializing component by creating ListView and initializing it, subscribing to drag events,
        /// and registering the control</summary>
        void IInitializable.Initialize()
        {
            m_characterListView = new ListView();
            //m_characterListView.SmallImageList = ResourceUtil.GetImageList16();
            m_characterListView.AllowDrop = false;
            m_characterListView.MultiSelect = true;
            m_characterListView.AllowColumnReorder = true;
            m_characterListView.LabelEdit = true;
            m_characterListView.Dock = DockStyle.Top;
            
            m_characterListView.MouseUp += characterListView_MouseUp;
            m_characteListViewAdapter = new ListViewAdapter(m_characterListView);
            m_characteListViewAdapter.LabelEdited +=
                resourcesListViewAdapter_LabelEdited;

            m_characteControlInfo = new ControlInfo(
                "Characters".Localize(),
                "Characters".Localize(),
                StandardControlGroup.Right);

            m_controlHostService.RegisterControl(m_characterListView, m_characteControlInfo, this);

            if (m_settingsService != null)
            {
                m_settingsService.RegisterSettings(this, new BoundPropertyDescriptor(this, () => ListViewSettings, "ListViewSettings", "", ""));
            }
        }
コード例 #5
0
ファイル: ResourcePreview.cs プロジェクト: ldh9451/XLE
 public ResourcePreview()
 {
     m_controlInfo = new ControlInfo(
         "Resource Preview".Localize(),
         "Preview selected 3d resource".Localize(),
         StandardControlGroup.Hidden);
 }
コード例 #6
0
        public SledTreeListViewEditor(
            string name,
            string image,
            string[] columns,
            TreeListView.Style style,
            StandardControlGroup controlGroup)
            : base(style)
        {
            TreeListView.Name = name;

            foreach (var column in columns)
                TreeListView.Columns.Add(new TreeListView.Column(column));

            {
                var theImage =
                    (!string.IsNullOrEmpty(image) &&
                    ResourceUtil.GetImageList16().Images.ContainsKey(image))
                        ? ResourceUtil.GetImageList16().Images[image]
                        : null;

                m_controlInfo =
                    new ControlInfo(
                        TreeListView.Name,
                        TreeListView.Name,
                        controlGroup,
                        theImage);
            }
        }
コード例 #7
0
ファイル: ResourceListEditor.cs プロジェクト: sbambach/ATF
        /// <summary>
        /// Finishes initializing component by creating ListView, and initializing it and subscribing it to events</summary>
        void IInitializable.Initialize()
        {
            m_resourcesListView = new ListView();
            m_resourcesListView.AllowDrop = true;
            m_resourcesListView.MultiSelect = true;
            m_resourcesListView.AllowColumnReorder = true;
            m_resourcesListView.LabelEdit = true;
            m_resourcesListView.Dock = DockStyle.Fill;

            m_resourcesListView.DragOver += resourcesListView_DragOver;
            m_resourcesListView.DragDrop += resourcesListView_DragDrop;
            m_resourcesListView.MouseUp += resourcesListView_MouseUp;
            m_resourcesListViewAdapter = new ListViewAdapter(m_resourcesListView);
            m_resourcesListViewAdapter.LabelEdited +=
                resourcesListViewAdapter_LabelEdited;

            m_resourcesControlInfo = new ControlInfo(
                "Resources".Localize(),
                "Resources for selected Event".Localize(),
                StandardControlGroup.Bottom);

            m_controlHostService.RegisterControl(m_resourcesListView, m_resourcesControlInfo, this);

            if (m_settingsService != null)
            {
                m_settingsService.RegisterSettings(this, new BoundPropertyDescriptor(this, () => ListViewSettings, "ListViewSettings", "", ""));
            }
        }
コード例 #8
0
 private static Rectangle CreateRectangle(ControlInfo control)
 {
     return new Rectangle(
         control.Left,
         control.Top,
         control.Width,
         control.Height);
 }
コード例 #9
0
ファイル: PropertyEditor.cs プロジェクト: vincenthamm/ATF
 /// <summary>
 /// Configures the property editor</summary>
 /// <param name="propertyGrid">Property grid control</param>
 /// <param name="controlInfo">Information about the control for the hosting service</param>
 protected virtual void Configure(out PropertyGrid propertyGrid, out ControlInfo controlInfo)
 {
     propertyGrid = new PropertyGrid();
     controlInfo = new ControlInfo(
         "Property Editor".Localize(),
         "Edits selected object properties".Localize(),
         StandardControlGroup.Right, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize());
 }
コード例 #10
0
ファイル: GridPropertyEditor.cs プロジェクト: GeertVL/ATF
 /// <summary>
 /// Configures the property editor</summary>
 /// <param name="gridControl">Grid control</param>
 /// <param name="controlInfo">Information about the control for the hosting service</param>
 protected virtual void Configure(out GridControl gridControl, out ControlInfo controlInfo)
 {
     gridControl = new GridControl();
     controlInfo = new ControlInfo(
         "Grid Property Editor".Localize(),
         "Edits selected object properties".Localize(),
         StandardControlGroup.Bottom, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize());
 }
コード例 #11
0
 public PerformanceMonitor(IControlRegistry controlRegistry, IControlHostService controlHostService)
 {
     m_controlRegistry = controlRegistry;
     m_controlHostService = controlHostService;
     m_controlInfo = new ControlInfo(
         "Performance Monitor".Localize(),
         "Displays performance data on the currently active Control".Localize(),
         StandardControlGroup.Floating);
     m_controlInfo.VisibleByDefault = false;
 }
コード例 #12
0
        public ControlInfo GetControlsInfo(string pstrSource, ref int plonProcessLocation)
        {
            int slonNestDepth = 0;
            slonNestDepth = 0;

            ControlInfo sclsControlInfo = null;
//150503            sclsControlInfo = new ControlInfo(pstrSource, ref plonProcessLocation, ref slonNestDepth, ref mcolAllControls, ref mcolControlsByName); //not sure slstAllControls is being used
            sclsControlInfo = new ControlInfo(pstrSource, ref plonProcessLocation, ref slonNestDepth, ref mcolAllControls, ref mcolControlsByName, false); //not sure slstAllControls is being used

            return sclsControlInfo;
        }
コード例 #13
0
 /// <summary>
 /// Registers a control with the control host service</summary>
 /// <param name="controlHostService">Control host service</param>
 /// <param name="control">Control</param>
 /// <param name="name">Control name</param>
 /// <param name="description">Control description</param>
 /// <param name="group">Initial location of control on main form</param>
 /// <param name="client">Client that owns control, or null</param>
 /// <returns>ControlInfo for registered control</returns>
 public static ControlInfo RegisterControl(
     this IControlHostService controlHostService,
     Control control,
     string name,
     string description,
     StandardControlGroup group,
     IControlHostClient client)
 {
     var info = new ControlInfo(name, description, group);
     controlHostService.RegisterControl(control, info, client);
     return info;
 }
コード例 #14
0
ファイル: GridPropertyEditor.cs プロジェクト: sbambach/ATF
 /// <summary>
 /// Configures the property editor</summary>
 /// <param name="gridControl">Grid control</param>
 /// <param name="controlInfo">Information about the control for the hosting service</param>
 protected virtual void Configure(out GridControl gridControl, out ControlInfo controlInfo)
 {
     gridControl = new GridControl();
     controlInfo = new ControlInfo(
         "Grid Property Editor", //Is the ID in the layout. We'll localize DisplayName instead.
         "Edits selected object properties".Localize(),
         StandardControlGroup.Bottom, null,
         "https://github.com/SonyWWS/ATF/wiki/Property-Editing-in-ATF".Localize())
     {
         DisplayName = "Grid Property Editor".Localize()
     };
 }
コード例 #15
0
        /// <summary>
        /// Configures the TemplateLister</summary>
        /// <param name="controlInfo">Information about the control for the hosting service</param>
        protected virtual void Configure(
            out ControlInfo controlInfo)
        {
            controlInfo = new ControlInfo(
                "Templates".Localize(),
                "Reference subgraphs from templates".Localize(),
                StandardControlGroup.Right,
                m_templateLibraryImage);

            TreeControl.ShowRoot = false;
            TreeControl.AllowDrop = true;
            TreeControl.SelectionMode = SelectionMode.One;            
        }
コード例 #16
0
ファイル: PerformanceMonitor.cs プロジェクト: sbambach/ATF
 public PerformanceMonitor(IControlRegistry controlRegistry, IControlHostService controlHostService)
 {
     m_controlRegistry = controlRegistry;
     m_controlHostService = controlHostService;
     m_controlInfo = new ControlInfo(
         "Performance Monitor", //Is the ID in the layout. We'll localize DisplayName instead.
         "Displays performance data on the currently active Control".Localize(),
         StandardControlGroup.Floating)
     {
         DisplayName = "Performance Monitor".Localize()
     };
     m_controlInfo.VisibleByDefault = false;
 }
コード例 #17
0
        /// <summary>
        /// Configures the PrototypeLister</summary>
        /// <param name="controlInfo">Information about the Control for the hosting service</param>
        protected virtual void Configure(
            out ControlInfo controlInfo)
        {
            controlInfo = new ControlInfo(
                "Prototypes".Localize(),
                "Creates new instances from prototypes".Localize(),
                StandardControlGroup.Right,
                s_factoryImage);

            TreeControl.ShowRoot = false;
            TreeControl.AllowDrop = true;
            TreeControl.SelectionMode = SelectionMode.One;            
        }
コード例 #18
0
ファイル: LayerLister.cs プロジェクト: vincenthamm/ATF
        /// <summary>
        /// Configures the LayerLister</summary>
        /// <param name="controlInfo">Information about the control for the hosting service</param>
        protected virtual void Configure(
            out ControlInfo controlInfo)
        {
            controlInfo = new ControlInfo(
                "Layers".Localize(),
                "Edits document layers".Localize(),
                StandardControlGroup.Right,
                s_layerImage);

            TreeControl.ShowRoot = false;
            TreeControl.AllowDrop = true;
            TreeControl.SelectionMode = SelectionMode.MultiExtended;
        }
コード例 #19
0
ファイル: CurveEditor.cs プロジェクト: vincenthamm/ATF
        /// <summary>
        /// Constructor that a derived class can use to provide additional customizations</summary>
        public CurveEditor(ICommandService commandService,
            IControlHostService controlHostService,
            IContextRegistry contextRegistry,
            CurveEditingControl curveEditingControl,
            ControlInfo controlInfo)
        {
            // The commandService parameter is currently unused 
            // but kept for backwards compatibility & potential future use

            m_controlHostService = controlHostService;
            m_contextRegistry = contextRegistry;
            m_curveEditorControl = curveEditingControl;
            m_controlInfo = controlInfo;
        }
コード例 #20
0
ファイル: LayerLister.cs プロジェクト: arsaccol/LevelEditor
        /// <summary>
        /// Configures the LayerLister</summary>
        /// <param name="controlInfo">Information about the control for the hosting service</param>
        protected virtual void Configure(
            out ControlInfo controlInfo)
        {
            controlInfo = new ControlInfo(
                "Layers".Localize(),
                "Edits document layers".Localize(),
                StandardControlGroup.Hidden,
                s_layerImage);

            TreeControl.ShowRoot = false;
            TreeControl.AllowDrop = true;
            TreeControl.SelectionMode = SelectionMode.MultiExtended;
            TreeControl.Text = "Drag items from the Project Lister and drop them here to create layers whose visibility can be controlled by clicking on a check box.".Localize();
        }
コード例 #21
0
        /// <summary>
        /// Configures the BookmarkLister</summary>
        /// <param name="controlInfo">Information about the control for the hosting service</param>
        protected virtual void Configure(
            out ControlInfo controlInfo)
        {
            Image bkmImage = ResourceUtil.GetImage16(LevelEditorCore.Resources.BookmarkImage);
            controlInfo = new ControlInfo(
                "Bookmarks".Localize(),
                "Edits document bookmarks".Localize(),
                StandardControlGroup.Hidden,
                bkmImage);

            TreeControl.ShowRoot = false;
            TreeControl.AllowDrop = false;
            TreeControl.SelectionMode = SelectionMode.One;
            TreeControl.MouseDown += new MouseEventHandler(TreeControl_MouseDown);
        }
コード例 #22
0
ファイル: PrototypeLister.cs プロジェクト: sbambach/ATF
        /// <summary>
        /// Configures the PrototypeLister</summary>
        /// <param name="controlInfo">Information about the Control for the hosting service</param>
        protected virtual void Configure(
            out ControlInfo controlInfo)
        {
            controlInfo = new ControlInfo(
                "Prototypes", //Is the ID in the layout. We'll localize DisplayName instead.
                "Creates new instances from prototypes".Localize(),
                StandardControlGroup.Right,
                s_factoryImage)
            {
                DisplayName = "Prototypes".Localize()
            };

            TreeControl.ShowRoot = false;
            TreeControl.AllowDrop = true;
            TreeControl.SelectionMode = SelectionMode.One;            
        }
コード例 #23
0
ファイル: CurveEditor.cs プロジェクト: vincenthamm/ATF
        public CurveEditor(ICommandService commandService,
            IControlHostService controlHostService,
            IContextRegistry contextRegistry)
        {
            // The commandService parameter is currently unused 
            // but kept for backwards compatibility & potential future use

            m_controlHostService = controlHostService;
            m_contextRegistry = contextRegistry;
            
            m_curveEditorControl = new CurveEditingControl();
            m_controlInfo = new ControlInfo(
                "Curve Editor".Localize(),
                "Edits selected object curves".Localize(),
                StandardControlGroup.Bottom);
        }
コード例 #24
0
ファイル: LayerLister.cs プロジェクト: sbambach/ATF
        /// <summary>
        /// Configures the LayerLister</summary>
        /// <param name="controlInfo">Information about the control for the hosting service</param>
        protected virtual void Configure(
            out ControlInfo controlInfo)
        {
            controlInfo = new ControlInfo(
                "Layers", //Is the ID in the layout. We'll localize DisplayName instead.
                "Edits document layers".Localize(),
                StandardControlGroup.Right,
                s_layerImage)
            {
                DisplayName = "Layers".Localize()
            };

            TreeControl.ShowRoot = false;
            TreeControl.AllowDrop = true;
            TreeControl.SelectionMode = SelectionMode.MultiExtended;
        }
コード例 #25
0
ファイル: CurveEditor.cs プロジェクト: sbambach/ATF
        public CurveEditor(ICommandService commandService,
            IControlHostService controlHostService,
            IContextRegistry contextRegistry)
        {
            // The commandService parameter is currently unused 
            // but kept for backwards compatibility & potential future use

            m_controlHostService = controlHostService;
            m_contextRegistry = contextRegistry;
            
            m_curveEditorControl = new CurveEditingControl();
            m_controlInfo = new ControlInfo(
                "Curve Editor", //Is the ID in the layout. We'll localize DisplayName instead.
                "Edits selected object curves".Localize(),
                StandardControlGroup.Bottom)
            {
                DisplayName = "Curve Editor".Localize()
            };
        }
コード例 #26
0
ファイル: FragmentEffect.cs プロジェクト: cyberjaxx/OpenPDN
        protected override ControlInfo OnCreateConfigUI(PropertyCollection props)
        {
            ControlInfo configUI = PropertyBasedEffect.CreateDefaultConfigUI(props);

            configUI.SetPropertyControlValue(
                PropertyNames.Fragments,
                ControlInfoPropertyNames.DisplayName,
                PdnResources.GetString("FragmentEffect.ConfigDialog.Fragments.DisplayName"));

            configUI.SetPropertyControlValue(
                PropertyNames.Distance,
                ControlInfoPropertyNames.DisplayName,
                PdnResources.GetString("FragmentEffect.ConfigDialog.Distance.DisplayName"));

            configUI.SetPropertyControlValue(
                PropertyNames.Rotation,
                ControlInfoPropertyNames.DisplayName,
                PdnResources.GetString("FragmentEffect.ConfigDialog.Rotation.DisplayName"));

            configUI.SetPropertyControlType(PropertyNames.Rotation, PropertyControlType.AngleChooser);

            return(configUI);
        }
コード例 #27
0
ファイル: GcsMainPanel.cs プロジェクト: shizhexu/gluonpilot
        private void ContrlInfo(ControlInfo ci)
        {
            if (ci.FlightMode == ControlInfo.FlightModes.MANUAL)
            {
                _lbl_control_mode.Text      = "Manual";
                _lbl_control_mode.BackColor = Color.Red;
            }
            else if (ci.FlightMode == ControlInfo.FlightModes.AUTOPILOT)
            {
                _lbl_control_mode.Text      = "Autopilot";
                _lbl_control_mode.BackColor = Color.Green;
            }
            else if (ci.FlightMode == ControlInfo.FlightModes.STABILIZED)
            {
                _lbl_control_mode.Text      = "Stabilization";
                _lbl_control_mode.BackColor = Color.Yellow;
            }

            double time = (DateTime.Now - _beginDateTime).TotalSeconds;

            _heightLine.AddPoint(new PointPair(time, ci.Altitude));
            Scale xScale = _zgc_height.GraphPane.XAxis.Scale;

            if (time > xScale.Max - xScale.MajorStep)
            {
                xScale.Max = time + xScale.MajorStep;
                xScale.Min = xScale.Max - _timewindow;
            }

            _zgc_height.AxisChange();
            _zgc_height.Invalidate(true);

            _dtb_altitude.DistanceM = ci.Altitude;
            _tb_navigationline.Text = ci.CurrentNavigationLine.ToString();

            _tb_battvoltage.Text = ci.Batt1Voltage.ToString();
        }
コード例 #28
0
        protected override ControlInfo OnCreateConfigUI(PropertyCollection props)
        {
            /*
             * Use this to have preview
             * Surface sourceSurface = this.EnvironmentParameters.SourceSurface;
             * Bitmap bitmap = sourceSurface.CreateAliasedBitmap();
             * ImageResource imageResource = ImageResource.FromImage(bitmap);
             * configUI.SetPropertyControlValue(PropertyNames.Center, ControlInfoPropertyNames.StaticImageUnderlay, imageResource);
             * return configUI;
             */


            ControlInfo configUI = CreateDefaultConfigUI(props);

            //configUI.SetPropertyControlValue(PropertyNames.Type, ControlInfoPropertyNames.DisplayName, "Choose the color mode");

            //PropertyControlInfo pci = configUI.FindControlForPropertyName(PropertyNames.Type);
            //pci.SetValueDisplayName(ChoiceList.Keep, "Keep original colors");
            //pci.SetValueDisplayName(ChoiceList.Primal, "Reduce to primal colors");
            //pci.SetValueDisplayName(ChoiceList.BandW, "Reduce to black and white");
            //configUI.SetPropertyControlType(PropertyNames.Type, PropertyControlType.RadioButton);

            configUI.SetPropertyControlValue(PropertyNames.Aperture, ControlInfoPropertyNames.DisplayName, "Aperture size");
            configUI.SetPropertyControlValue(PropertyNames.Aperture, ControlInfoPropertyNames.SliderLargeChange, 5);
            configUI.SetPropertyControlValue(PropertyNames.Aperture, ControlInfoPropertyNames.SliderSmallChange, 1);
            configUI.SetPropertyControlValue(PropertyNames.Aperture, ControlInfoPropertyNames.UpDownIncrement, 1);

            //configUI.SetPropertyControlValue(PropertyNames.Tolerance, ControlInfoPropertyNames.DisplayName, "Color tolerance level");
            //configUI.SetPropertyControlValue(PropertyNames.Tolerance, ControlInfoPropertyNames.SliderLargeChange, 5);
            //configUI.SetPropertyControlValue(PropertyNames.Tolerance, ControlInfoPropertyNames.SliderSmallChange, 1);
            //configUI.SetPropertyControlValue(PropertyNames.Tolerance, ControlInfoPropertyNames.UpDownIncrement, 1);

            //configUI.SetPropertyControlValue(PropertyNames.Alpha, ControlInfoPropertyNames.DisplayName, "Include transparent pixels");
            //configUI.SetPropertyControlValue(PropertyNames.Alpha, ControlInfoPropertyNames.Description, "OFF:no ON:yes");

            return(configUI);
        }
コード例 #29
0
 //----------------------------------------------------------------------------------------
 // FindAllControls
 // Recursive function to process all controls contained in the initially passed
 // control container and store it in the Control dictionary
 //----------------------------------------------------------------------------------------
 public void FindAllControls(Control thisCtrl)
 {
     //-- If the current control has a parent, store all original relative position
     //-- and size information in the dictionary.
     //-- Recursively call FindAllControls for each control contained in the
     //-- current Control
     foreach (Control ctl in thisCtrl.Controls)
     {
         try
         {
             if (!(ctl.Parent == null))
             {
                 var         parentHeight = ctl.Parent.Height;
                 var         parentWidth  = ctl.Parent.Width;
                 ControlInfo c            = new ControlInfo();
                 c.name              = ctl.Name;
                 c.parentName        = ctl.Parent.Name;
                 c.topOffsetPercent  = Convert.ToDouble(ctl.Top) / Convert.ToDouble(parentHeight);
                 c.leftOffsetPercent = Convert.ToDouble(ctl.Left) / Convert.ToDouble(parentWidth);
                 c.heightPercent     = Convert.ToDouble(ctl.Height) / Convert.ToDouble(parentHeight);
                 c.widthPercent      = Convert.ToDouble(ctl.Width) / Convert.ToDouble(parentWidth);
                 c.originalFontSize  = ctl.Font.Size;
                 c.originalHeight    = ctl.Height;
                 c.originalWidth     = ctl.Width;
                 ctrlDict.Add(c.name, c);
             }
         }
         catch (Exception ex)
         {
             Debug.Print(ex.Message);
         }
         if (ctl.Controls.Count > 0)
         {
             FindAllControls(ctl);
         }
     }             //-- For Each
 }
コード例 #30
0
        /// <summary>
        /// 根据当前行字符串显示提示信息
        /// </summary>
        /// <param name="currentWord"></param>
        public void ShowTipText(string CurrentString)
        {
            string[] rowInfo = CurrentString.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);

            if (rowInfo.Length == 1 && PLCCodeEditor.CtrlPropertys.ContainsKey(rowInfo[0])
                //this.toolTip1.ToolTipTitle != ""
                )
            {
                ControlInfo dicCS = PLCCodeEditor.CtrlPropertys[rowInfo[0]];

                //this.toolTip1.Show(String.Join(",", GetTipmessage(dicCS, -1).ToArray()), this, new Point(Size.Width, 0));
                GetTipmessage(dicCS, -1);
            }
            else if (rowInfo.Length >= 2)
            {
                if (rowInfo.Length != 2)
                {//参数中间有空格键产生分段时合并这些分段
                    for (int x = 2; x < rowInfo.Length; x++)
                    {
                        rowInfo[1] += rowInfo[x];
                    }
                }
                string keyWord   = rowInfo[0].Trim().ToUpper();
                int    tempIndex = getParaIndex(rowInfo[1]);

                // 关键字存在
                if (PLCCodeEditor.CtrlPropertys.ContainsKey(keyWord))
                {
                    ControlInfo dicCS = PLCCodeEditor.CtrlPropertys[keyWord];
                    GetTipmessage(dicCS, tempIndex);
                }
            }
            else if (rowInfo == null || rowInfo.Length == 0 || !PLCCodeEditor.CtrlPropertys.ContainsKey(rowInfo[0]))
            {//数组为空 清空提示
                this.HideALL();
            }
        }
コード例 #31
0
ファイル: ControlController.cs プロジェクト: Gnail-nehc/Black
        public ActionResult Index(ControlInfo info, int pageIndex = 1)
        {
            ActionResult ar = VerifyIfProjectSelected("PRJNAME");

            if (null != ar)
            {
                return(ar);
            }
            this.ControlService.CurrentProjectId = (int)Session["PID"];
            string requestKey = Request.Form.Keys[Request.Form.Keys.Count - 1] as string;

            if (requestKey.Contains("."))
            {
                requestKey = requestKey.Substring(0, requestKey.IndexOf("."));
            }
            object pageindex = Session["QueriedPageIndex_c"] ?? pageIndex;

            switch (requestKey)
            {
            case "query":
                return(Query(info, 1));

            case "edit":
                return(Edit(info.SelectedControl.Id, info.SelectedControl.ControlProperty.Type, (int)pageindex));

            case "delete":
                return(Delete(info.SelectedControl.Id, (int)pageindex));

            case "save":
                return(Save(info.SelectedControl, (int)pageindex));

            default:
                Session["UpdatedId_c"] = null;
                Session["Log_c"]       = null;
                return(RedirectToAction("Index", new { pageIndex = (int)pageindex }));
            }
        }
コード例 #32
0
        public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props)
        {
            ControlInfo info = PropertyBasedFileType.CreateDefaultSaveConfigUI(props);

            info.SetPropertyControlValue(PropertyNames.FileFormat, ControlInfoPropertyNames.DisplayName, string.Empty);
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_DXT1, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.DXT1"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_DXT3, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.DXT3"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_DXT5, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.DXT5"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_A8R8G8B8, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.A8R8G8B8"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_X8R8G8B8, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.X8R8G8B8"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_A8B8G8R8, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.A8B8G8R8"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_X8B8G8R8, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.X8B8G8R8"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_A1R5G5B5, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.A1R5G5B5"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_A4R4G4B4, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.A4R4G4B4"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_R8G8B8, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.R8G8B8"));
            info.FindControlForPropertyName(PropertyNames.FileFormat).SetValueDisplayName(DdsFileFormat.DDS_FORMAT_R5G6B5, PdnResources.GetString("DdsFileType.SaveConfigWidget.FileFormatList.R5G6B5"));
            info.SetPropertyControlValue(PropertyNames.CompressorType, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("DdsFileType.SaveConfigWidget.CompressorTypeLabel.Text"));
            info.SetPropertyControlType(PropertyNames.CompressorType, PropertyControlType.RadioButton);
            info.FindControlForPropertyName(PropertyNames.CompressorType).SetValueDisplayName(DdsCompressorType.RangeFit, PdnResources.GetString("DdsFileType.SaveConfigWidget.RangeFit.Text"));
            info.FindControlForPropertyName(PropertyNames.CompressorType).SetValueDisplayName(DdsCompressorType.ClusterFit, PdnResources.GetString("DdsFileType.SaveConfigWidget.ClusterFit.Text"));
            info.FindControlForPropertyName(PropertyNames.CompressorType).SetValueDisplayName(DdsCompressorType.IterativeFit, PdnResources.GetString("DdsFileType.SaveConfigWidget.IterativeFit.Text"));
            info.SetPropertyControlValue(PropertyNames.ErrorMetric, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("DdsFileType.SaveConfigWidget.ErrorMetricLabel.Text"));
            info.SetPropertyControlType(PropertyNames.ErrorMetric, PropertyControlType.RadioButton);
            info.FindControlForPropertyName(PropertyNames.ErrorMetric).SetValueDisplayName(DdsErrorMetric.Perceptual, PdnResources.GetString("DdsFileType.SaveConfigWidget.Perceptual.Text"));
            info.FindControlForPropertyName(PropertyNames.ErrorMetric).SetValueDisplayName(DdsErrorMetric.Uniform, PdnResources.GetString("DdsFileType.SaveConfigWidget.Uniform.Text"));
            info.SetPropertyControlValue(PropertyNames.GenerateMipMaps, ControlInfoPropertyNames.DisplayName, string.Empty);
            info.SetPropertyControlValue(PropertyNames.GenerateMipMaps, ControlInfoPropertyNames.Description, PdnResources.GetString("DdsFileType.SaveConfigWidget.GenerateMipMaps.Text"));
            info.SetPropertyControlValue(PropertyNames.WeightColorByAlpha, ControlInfoPropertyNames.DisplayName, PdnResources.GetString("DdsFileType.SaveConfigWidget.AdditionalOptions.Text"));
            info.SetPropertyControlValue(PropertyNames.WeightColorByAlpha, ControlInfoPropertyNames.Description, PdnResources.GetString("DdsFileType.SaveConfigWidget.WeightColourByAlpha"));
            info.SetPropertyControlValue(PropertyNames.MipMapResamplingAlgorithm, ControlInfoPropertyNames.DisplayName, string.Empty);
            info.FindControlForPropertyName(PropertyNames.MipMapResamplingAlgorithm).SetValueDisplayName(ResamplingAlgorithm.Fant, PdnResources.GetString("DdsFileType.SaveConfigWidget.MipMapResamplingAlgorithm.Fant"));
            info.FindControlForPropertyName(PropertyNames.MipMapResamplingAlgorithm).SetValueDisplayName(ResamplingAlgorithm.SuperSampling, PdnResources.GetString("DdsFileType.SaveConfigWidget.MipMapResamplingAlgorithm.SuperSampling"));
            info.FindControlForPropertyName(PropertyNames.MipMapResamplingAlgorithm).SetValueDisplayName(ResamplingAlgorithm.Bicubic, PdnResources.GetString("DdsFileType.SaveConfigWidget.MipMapResamplingAlgorithm.Bicubic"));
            info.FindControlForPropertyName(PropertyNames.MipMapResamplingAlgorithm).SetValueDisplayName(ResamplingAlgorithm.Bilinear, PdnResources.GetString("DdsFileType.SaveConfigWidget.MipMapResamplingAlgorithm.Bilinear"));
            info.FindControlForPropertyName(PropertyNames.MipMapResamplingAlgorithm).SetValueDisplayName(ResamplingAlgorithm.NearestNeighbor, PdnResources.GetString("DdsFileType.SaveConfigWidget.MipMapResamplingAlgorithm.NearestNeighbor"));
            return(info);
        }
コード例 #33
0
        /// <summary>
        /// 更新xml文件内容
        /// </summary>
        /// <param name="ui"></param>
        /// <param name="columnName"></param>
        /// <param name="comment"></param>
        /// <param name="tableName"></param>
        /// <param name="parentCtrlName"></param>
        /// <param name="mdi"></param>
        void UpdateXml(FrameworkElement ui, string columnName, string comment, string tableName, string parentCtrlName, MetaDataInfo mdi)
        {
            ControlInfo ci = new ControlInfo();

            ci.Name       = ui.Name;
            ci.ColumnName = columnName;
            ci.MetaData   = tableName;
            ci.Comment    = comment;
            ci.Type       = ui.GetType().Name;
            if (!parentCtrlName.IsNullOrEmpty())
            {
                ci.ParentCtrlName = parentCtrlName;
            }
            if (ui is ICompositeCtrl)
            {
                //-->查找 metadata 里 row里的信息
                ci.ControlType = ConstantCollection.COMPOSITE_CONTROL;
                CtrlPlatformCommandInfo ctrlCmd = new CtrlPlatformCommandInfo();
                ctrlCmd.MetaDataInfo = mdi;
                ctrlCmd.ControlInfo  = ci;
                (ui as ICompositeCtrl).InitTitle(ctrlCmd);
            }
            _XmlTemplate.ControlItem.Add(ci);
        }
コード例 #34
0
        public void ResizeAllControls(Control Myctrl)
        {
            Single fontRatioW;
            Single fontRatioH;
            Single fontRatio;
            Font   f;

            foreach (Control ctrl in Myctrl.Controls)
            {
                try{
                    int         parentHeight = ctrl.Parent.Height;
                    int         parentWidth  = ctrl.Parent.Width;
                    ControlInfo c            = new ControlInfo();
                    if (ctrlDict.TryGetValue(ctrl.Name, out c))
                    {
                        ctrl.Width  = (int)(parentWidth * c.widthPercent);
                        ctrl.Height = (int)(parentHeight * c.heightPercent);

                        ctrl.Top  = (int)(parentHeight * c.topOffsetPercent);
                        ctrl.Left = (int)(parentWidth * c.leftOffsetPercent);

                        f          = ctrl.Font;
                        fontRatioW = ctrl.Width / c.originalWidth;
                        fontRatioH = ctrl.Height / c.originalHeight;
                        fontRatio  = (fontRatioW + fontRatioH) / 2;
                        ctrl.Font  = new Font(f.FontFamily, c.originalFontSize * fontRatio, f.Style);
                    }
                }catch (Exception ex) {
                    //MessageBox.Show(ex.ToString());
                }
                if (ctrl.Controls.Count > 0)
                {
                    ResizeAllControls(ctrl);
                }
            }
        }
コード例 #35
0
        public override ControlInfo OnCreateSaveConfigUI(PropertyCollection props)
        {
            ControlInfo configUI = CreateDefaultSaveConfigUI(props);

            configUI.SetPropertyControlValue(
                PropertyNames.BitDepth,
                ControlInfoPropertyNames.DisplayName,
                PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.DisplayName"));

            PropertyControlInfo bitDepthPCI = configUI.FindControlForPropertyName(PropertyNames.BitDepth);

            bitDepthPCI.SetValueDisplayName(BmpBitDepthUIChoices.AutoDetect, PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.AutoDetect.DisplayName"));
            bitDepthPCI.SetValueDisplayName(BmpBitDepthUIChoices.Bpp24, PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.Bpp24.DisplayName"));
            bitDepthPCI.SetValueDisplayName(BmpBitDepthUIChoices.Bpp8, PdnResources.GetString("BmpFileType.ConfigUI.BitDepth.Bpp8.DisplayName"));

            configUI.SetPropertyControlType(PropertyNames.BitDepth, PropertyControlType.RadioButton);

            configUI.SetPropertyControlValue(
                PropertyNames.DitherLevel,
                ControlInfoPropertyNames.DisplayName,
                PdnResources.GetString("BmpFileType.ConfigUI.DitherLevel.DisplayName"));

            return(configUI);
        }
コード例 #36
0
        protected override ControlInfo OnCreateConfigUI(PropertyCollection props)
        {
            ControlInfo configUI = CreateDefaultConfigUI(props);

            configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.DisplayName, L10nStrings.Scale);
            configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.SliderLargeChange, 0.25);
            configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.SliderSmallChange, 0.05);
            configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.UpDownIncrement, 0.001);
            configUI.SetPropertyControlValue(PropertyNames.Scale, ControlInfoPropertyNames.DecimalPlaces, 3);
            configUI.SetPropertyControlValue(PropertyNames.LineWidth, ControlInfoPropertyNames.DisplayName, L10nStrings.LineWidth);
            configUI.SetPropertyControlValue(PropertyNames.Pattern, ControlInfoPropertyNames.DisplayName, L10nStrings.Pattern);
            PropertyControlInfo patternControl = configUI.FindControlForPropertyName(PropertyNames.Pattern);

            patternControl.SetValueDisplayName(Pattern.AltHorVer, L10nStrings.AltHorVer);
            patternControl.SetValueDisplayName(Pattern.AltNone, L10nStrings.AltNone);
            patternControl.SetValueDisplayName(Pattern.AltHor, L10nStrings.AltHor);
            patternControl.SetValueDisplayName(Pattern.AltVer, L10nStrings.AltVer);
            configUI.SetPropertyControlValue(PropertyNames.Transparent, ControlInfoPropertyNames.DisplayName, L10nStrings.LineColor);
            configUI.SetPropertyControlValue(PropertyNames.Transparent, ControlInfoPropertyNames.Description, L10nStrings.Transparent);
            configUI.SetPropertyControlValue(PropertyNames.LineColor, ControlInfoPropertyNames.DisplayName, string.Empty);
            configUI.SetPropertyControlType(PropertyNames.LineColor, PropertyControlType.ColorWheel);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.DisplayName, L10nStrings.Position);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeX, 0.05);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeX, 0.25);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementX, 0.001);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderSmallChangeY, 0.05);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.SliderLargeChangeY, 0.25);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.UpDownIncrementY, 0.001);
            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.DecimalPlaces, 3);
            Rectangle     selBounds = EnvironmentParameters.SelectionBounds;
            ImageResource selImage  = ImageResource.FromImage(EnvironmentParameters.SourceSurface.CreateAliasedBitmap(selBounds));

            configUI.SetPropertyControlValue(PropertyNames.Offset, ControlInfoPropertyNames.StaticImageUnderlay, selImage);

            return(configUI);
        }
コード例 #37
0
        protected override ControlInfo OnCreateConfigUI(PropertyCollection props)
        {
            ControlInfo cInfo = base.OnCreateConfigUI(props);

            cInfo.SetPropertyControlValue(PropertyNames.LowerThreshold, ControlInfoPropertyNames.DecimalPlaces, 3);
            cInfo.SetPropertyControlValue(PropertyNames.LowerThreshold, ControlInfoPropertyNames.UpDownIncrement, 0.001);
            cInfo.SetPropertyControlValue(PropertyNames.LowerThreshold, ControlInfoPropertyNames.SliderLargeChange, 0.01);
            cInfo.SetPropertyControlValue(PropertyNames.LowerThreshold, ControlInfoPropertyNames.SliderSmallChange, 0.001);
            cInfo.SetPropertyControlValue(PropertyNames.UpperThreshold, ControlInfoPropertyNames.DecimalPlaces, 3);
            cInfo.SetPropertyControlValue(PropertyNames.UpperThreshold, ControlInfoPropertyNames.UpDownIncrement, 0.001);
            cInfo.SetPropertyControlValue(PropertyNames.UpperThreshold, ControlInfoPropertyNames.SliderLargeChange, 0.01);
            cInfo.SetPropertyControlValue(PropertyNames.UpperThreshold, ControlInfoPropertyNames.SliderSmallChange, 0.001);
            cInfo.SetPropertyControlType(PropertyNames.Color, PropertyControlType.ColorWheel);
            cInfo.SetPropertyControlType(PropertyNames.Color2, PropertyControlType.ColorWheel);
            cInfo.SetPropertyControlType(PropertyNames.Angle, PropertyControlType.AngleChooser);
            cInfo.SetPropertyControlValue(PropertyNames.DifferenceFilter, ControlInfoPropertyNames.ShowResetButton, true);

            cInfo.SetPropertyControlValue(PropertyNames.LowerThreshold, ControlInfoPropertyNames.DisplayName, "Lower Threshold");
            cInfo.SetPropertyControlValue(PropertyNames.UpperThreshold, ControlInfoPropertyNames.DisplayName, "Upper Threshold");
            cInfo.SetPropertyControlValue(PropertyNames.HueDirection, ControlInfoPropertyNames.DisplayName, "Hue Direction");
            cInfo.SetPropertyControlValue(PropertyNames.DifferenceFilter, ControlInfoPropertyNames.DisplayName, "Difference Filter");
            cInfo.SetPropertyControlValue(PropertyNames.SmoothingRadius, ControlInfoPropertyNames.DisplayName, "Smoothing Radius");
            return(cInfo);
        }
コード例 #38
0
        void IInitializable.Initialize()
        {
            m_control.Initialize();

            var controlHostService =
                SledServiceInstance.Get <IControlHostService>();

            // Grab image
            var image =
                ResourceUtil.GetImage(Atf.Resources.UnsortedImage);

            // Rotate image
            image.RotateFlip(RotateFlipType.Rotate90FlipX);

            var controlInfo =
                new ControlInfo(
                    m_control.Name,
                    m_control.Name,
                    StandardControlGroup.Bottom,
                    image);

            // Show GUI
            controlHostService.RegisterControl(
                m_control,
                controlInfo,
                this);

            // Subscribe to events
            m_debugService                     = SledServiceInstance.Get <ISledDebugService>();
            m_debugService.DataReady          += DebugServiceDataReady;
            m_debugService.BreakpointContinue += DebugServiceBreakpointContinue;
            m_debugService.UpdateEnd          += DebugServiceUpdateEnd;
            m_debugService.Disconnected       += DebugServiceDisconnected;

            m_projectService.Get.Closed += ProjectServiceClosed;
        }
コード例 #39
0
 /// <summary>
 /// 更新控件
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public bool UpdateControl(ControlInfo info)
 {
     try
     {
         string         sql   = "P_K2_UpdateControl";
         SqlParameter[] parms =
         {
             new SqlParameter("@ID",          info.ID),
             new SqlParameter("@Name",        info.Name),
             new SqlParameter("@Type",        info.Type),
             new SqlParameter("@Class",       info.Class),
             new SqlParameter("@Json",        info.Json),
             new SqlParameter("@Html",        info.Html),
             new SqlParameter("@Description", info.Description)
         };
         SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringLocalTransaction, CommandType.StoredProcedure, sql, parms);
         return(true);
     }
     catch (Exception ex)
     {
         DBManager.RecoreErrorProfile(ex, "FormDesignDAL.UpdateControl", DBManager.GetCurrentUserAD());
         return(false);
     }
 }
コード例 #40
0
ファイル: Editor.cs プロジェクト: zoombapup/ATF
        private void control_DoubleClick(object sender, EventArgs e)
        {
            AdaptableControl d2dHoverControl = (AdaptableControl)sender;
            Point            clientPoint     = d2dHoverControl.PointToClient(Control.MousePosition);

            D2dGraphAdapter <Module, Connection, ICircuitPin> graphAdapter =
                d2dHoverControl.As <D2dGraphAdapter <Module, Connection, ICircuitPin> >();
            GraphHitRecord <Module, Connection, ICircuitPin> hitRecord = graphAdapter.Pick(clientPoint);
            Group subGraph          = null;
            var   subGraphReference = hitRecord.Node.As <GroupReference>();

            if (subGraphReference != null)
            {
                var templatingContext = m_contextRegistry.GetMostRecentContext <TemplatingContext>();
                if (templatingContext != null && templatingContext.IsExternalTemplate(subGraphReference.Template))
                {
                    return;                                 // templates should only be editable in the document that owns the template
                }
                DialogResult checkResult = DialogResult.No; //direct editing
                if (checkResult == DialogResult.No)
                {
                    subGraph = subGraphReference.Group.As <Group>();
                    var graphValidator = subGraphReference.DomNode.GetRoot().Cast <CircuitValidator>();
                    graphValidator.UpdateTemplateInfo(subGraph);
                }
            }
            else
            {
                subGraph = hitRecord.Node.As <Group>();
            }
            if (subGraph != null)
            {
                var viewingContext = subGraph.Cast <ViewingContext>();
                if (viewingContext.Control != null)
                {
                    // sub-graph is already open, just show control
                    m_controlHostService.Show(viewingContext.Control);
                }
                else
                {
                    // create new circuit editing control for sub-circuit
                    AdaptableControl subCircuitControl = CreateCircuitControl(subGraph.DomNode);
                    viewingContext.Control = subCircuitControl;

                    // use group’s hierarchy as control name
                    string name  = string.Empty;
                    bool   first = true;
                    foreach (var domNode in subGraph.DomNode.GetPath())
                    {
                        if (domNode.Is <Group>())
                        {
                            if (first)
                            {
                                name  = domNode.Cast <Group>().Name;
                                first = false;
                            }
                            else
                            {
                                name += "/" + domNode.Cast <Group>().Name;
                            }
                        }
                    }

                    string description = name;

                    var editingContext = subGraph.DomNode.Cast <CircuitEditingContext>();
                    editingContext.GetLocalBound       = GetLocalBound;
                    editingContext.GetWorldOffset      = GetWorldOffset;
                    editingContext.GetTitleHeight      = GetTitleHeight;
                    editingContext.GetLabelHeight      = GetLabelHeight;
                    editingContext.GetSubContentOffset = GetSubContentOffset;

                    subCircuitControl.Context   = editingContext;
                    editingContext.SchemaLoader = m_schemaLoader; // schema needed for cut and paste between applications

                    ControlInfo controlInfo = new ControlInfo(name, description, StandardControlGroup.Center);
                    //controlInfo.Docking = new ControlInfo.DockingInfo() // smart docking behavior
                    //{
                    //    GroupTag = subGraph.DomNode.Lineage.AsIEnumerable<Group>().Last(),// use the top-level parent group
                    //    Order = subGraph.Level
                    //};
                    m_circuitControlRegistry.RegisterControl(subGraph.DomNode, subCircuitControl, controlInfo, this);

                    var enumerableContext = subGraph.DomNode.Cast <CircuitEditingContext>().Cast <IEnumerableContext>();
                    var items             = (enumerableContext != null) ? enumerableContext.Items : null;
                    subCircuitControl.As <IViewingContext>().Frame(items);
                }
            }
        }
コード例 #41
0
ファイル: Editor.cs プロジェクト: zoombapup/ATF
        /// <summary>
        /// Opens or creates a document at the given URI.
        /// Creates and configures with control adapters D2dAdaptableControl to display subcircuit</summary>
        /// <param name="uri">Document URI</param>
        /// <returns>Document, or null if the document couldn't be opened or created</returns>
        public IDocument Open(Uri uri)
        {
            DomNode node     = null;
            string  filePath = uri.LocalPath;

            if (File.Exists(filePath))
            {
                // read existing document using standard XML reader
                using (FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
                {
                    CircuitReader reader = new CircuitReader(m_schemaLoader);
                    node = reader.Read(stream, uri);
                }
            }
            else
            {
                // create new document by creating a Dom node of the root type defined by the schema
                node = new DomNode(Schema.circuitDocumentType.Type, Schema.circuitRootElement);
                // create an empty root prototype folder
                node.SetChild(
                    Schema.circuitDocumentType.prototypeFolderChild,
                    new DomNode(Schema.prototypeFolderType.Type));
            }

            CircuitDocument circuitCircuitDocument = null;

            if (node != null)
            {
                // now that the data is complete, initialize all other extensions to the Dom data
                node.InitializeExtensions();

                AdaptableControl control = CreateCircuitControl(node);
                control.AddHelp("https://github.com/SonyWWS/ATF/wiki/Adaptable-Controls".Localize());

                var viewingContext = node.Cast <ViewingContext>();
                viewingContext.Control = control;

                circuitCircuitDocument = node.Cast <CircuitDocument>();
                string      fileName    = Path.GetFileName(filePath);
                ControlInfo controlInfo = new ControlInfo(fileName, filePath, StandardControlGroup.Center);

                //Set IsDocument to true to prevent exception in command service if two files with the
                //  same name, but in different directories, are opened.
                controlInfo.IsDocument = true;

                circuitCircuitDocument.ControlInfo = controlInfo;
                circuitCircuitDocument.Uri         = uri;

                var editingContext = node.Cast <CircuitEditingContext>();
                editingContext.GetLocalBound       = GetLocalBound;
                editingContext.GetWorldOffset      = GetWorldOffset;
                editingContext.GetTitleHeight      = GetTitleHeight;
                editingContext.GetLabelHeight      = GetLabelHeight;
                editingContext.GetSubContentOffset = GetSubContentOffset;

                control.Context             = editingContext;
                editingContext.SchemaLoader = m_schemaLoader; // schema needed for cut and paste between applications

                m_circuitControlRegistry.RegisterControl(node, control, controlInfo, this);
                SkinService.ApplyActiveSkin(control);
                // Set the zoom and translation to show the existing items (if any).
                var enumerableContext = editingContext.Cast <IEnumerableContext>();
                if (viewingContext.CanFrame(enumerableContext.Items))
                {
                    viewingContext.Frame(enumerableContext.Items);
                }

                //var viewingAdapter = control.As<ViewingAdapter>();
                // enable toggle after initial frame operation.
                //  viewingAdapter.ToggleFramingEnabled = true; // toggle frame/unframe.
            }

            return(circuitCircuitDocument);
        }
コード例 #42
0
        public SamplesConfiguration()
        {
            DemoInfo ribbonDemo = new DemoInfo()
            {
                Name          = "Getting Started",
                Category      = "Ribbon",
                Description   = "The WinUI Ribbon control supports all the basic features and functionality including Ribbon Tab which contains controls like Button, SplitButton, DropdownButton etc.",
                DemoType      = DemoTypes.None,
                DemoView      = typeof(Views.Ribbon.RibbonView),
                ShowInfoPanel = true
            };


            List <Documentation> documentations = new List <Documentation>();

            documentations.Add(new Documentation()
            {
                Content = "Ribbon - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Ribbon.html")
            });
            documentations.Add(new Documentation()
            {
                Content = "Ribbon - Getting Started Documentation", Uri = new Uri("https://help.syncfusion.com/winui/ribbon/getting-started")
            });

            ribbonDemo.Documentation.AddRange(documentations);

            DemoInfo simplifiedribbonDemo = new DemoInfo()
            {
                Name          = "Simplified Ribbon",
                Category      = "Ribbon",
                Description   = "Ribbon supports the simplified mode with Ribbon items arranged in single row arrangements and some ribbon items are moved to overflow menu.",
                DemoType      = DemoTypes.New,
                DemoView      = typeof(Views.Ribbon.SimplifiedRibbonView),
                ShowInfoPanel = true
            };


            List <Documentation> simplifiedribbondocumentations = new List <Documentation>();

            simplifiedribbondocumentations.Add(new Documentation()
            {
                Content = "Ribbon - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Ribbon.html")
            });
            simplifiedribbondocumentations.Add(new Documentation()
            {
                Content = "Ribbon - Getting Started Documentation", Uri = new Uri("https://help.syncfusion.com/winui/ribbon/getting-started")
            });

            simplifiedribbonDemo.Documentation.AddRange(simplifiedribbondocumentations);

            DemoInfo ribbongalleryDemo = new DemoInfo()
            {
                Name          = "Ribbon Gallery",
                Category      = "Ribbon",
                Description   = "RibbonGallery displays the collection of items in a uniform order. It allows you to view items by grouping while the control is expanded.",
                DemoType      = DemoTypes.New,
                DemoView      = typeof(Views.Ribbon.RibbonGalleryView),
                ShowInfoPanel = true
            };


            List <Documentation> ribbongallerydocumentations = new List <Documentation>();

            ribbongallerydocumentations.Add(new Documentation()
            {
                Content = "Ribbon - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Ribbon.html")
            });
            ribbongallerydocumentations.Add(new Documentation()
            {
                Content = "Ribbon - Getting Started Documentation", Uri = new Uri("https://help.syncfusion.com/winui/ribbon/getting-started")
            });

            ribbongalleryDemo.Documentation.AddRange(ribbongallerydocumentations);

            var ribbonControlInfo = new ControlInfo()
            {
                Control         = DemoControl.SfRibbon,
                ControlBadge    = ControlBadge.Updated,
                ControlCategory = ControlCategory.Navigation,
                Description     = "The WinUI Ribbon control supports all the basic features and functionality including Ribbon Tab which contains controls like Button, SplitButton, DropdownButton etc.",
                Glyph           = "\uE70f"
            };

            ribbonControlInfo.Demos.Add(ribbonDemo);
            ribbonControlInfo.Demos.Add(simplifiedribbonDemo);
            ribbonControlInfo.Demos.Add(ribbongalleryDemo);


            var controlInfos = new List <ControlInfo>()
            {
                ribbonControlInfo
            };

            DemoHelper.ControlInfos.AddRange(controlInfos);
        }
コード例 #43
0
ファイル: CircuitMagnifier.cs プロジェクト: jethac/ATF
        private void InitMagnifier()
        {

            m_magnifierControl = new Control();
            m_magnifierControl.Name = "Magnifier";
            
            // create magnifier view
            m_controlInfo = new ControlInfo("Magnifier".Localize(), "Magnified view", StandardControlGroup.Left);

            m_circuitMagnifierControl = CreateControl(false);
            m_magnifierControl.Controls.Add(m_circuitMagnifierControl);


            m_circuitGroupMagnifierControl = CreateControl(true);            
            m_magnifierControl.Controls.Add(m_circuitGroupMagnifierControl);

            m_controlHostService.RegisterControl(m_magnifierControl, m_controlInfo, null);

            m_circuitMagnifierControl.DrawingD2d += m_magnifier_Painting;
            m_circuitGroupMagnifierControl.DrawingD2d += m_magnifier_Painting;
            UpdateControlName(1.25f);
        }
コード例 #44
0
ファイル: HistoryLister.cs プロジェクト: Jheengut/LevelEditor
        void IInitializable.Initialize()
        {            
            m_listbox = new CommandList();
            m_listbox.DrawMode = DrawMode.OwnerDrawFixed;
            m_listbox.BorderStyle = BorderStyle.None;
            m_listbox.SelectedIndexChanged += (sender, e) =>
                {
                    try
                    {
                        m_undoingOrRedoing = true;
                        int indexLastDone = m_commandHistory.Current - 1;
                        int cmdIndex = m_listbox.SelectedIndex + m_startIndex;
                        if (cmdIndex < indexLastDone)
                        {
                            while (cmdIndex < indexLastDone)
                            {
                                m_historyContext.Undo();
                                indexLastDone = m_commandHistory.Current - 1;
                            }

                        }
                        else
                        {
                            while (cmdIndex >= m_commandHistory.Current)
                                m_historyContext.Redo();
                        }
                    }                    
                    finally
                    {
                        m_undoingOrRedoing = false;                        
                    }
                };


            m_listbox.DrawItem2 += (sender, e) =>
                {
                    if (e.Index < 0) return;                    
                    int cmdIndex = e.Index + m_startIndex;                    
                    Command cmd = (Command)m_listbox.Items[e.Index];
                    if(cmdIndex >= m_commandHistory.Current)
                    {
                        m_textBrush.Color = m_redoForeColor;
                        m_fillBrush.Color = m_redoBackColor;
                    }
                    else
                    {
                        m_textBrush.Color = m_undoForeColor;
                        m_fillBrush.Color = m_undoBackColor;
                    }
                  
                    if (e.State == DrawItemState.Selected)
                    {
                        e.DrawBackground();
                        e.DrawFocusRectangle();
                    }
                    else
                    {                        
                        e.Graphics.FillRectangle(m_fillBrush, e.Bounds);
                    }
                    
                    e.Graphics.DrawString(cmd.Description, e.Font, m_textBrush,
                            e.Bounds, StringFormat.GenericDefault);                                        
                };

            ControlInfo cinfo = new ControlInfo("History", "Undo/Redo stack", StandardControlGroup.Right);
            m_controlHostService.RegisterControl(m_listbox, cinfo, null);
            m_documentRegistry.ActiveDocumentChanged += m_documentRegistry_ActiveDocumentChanged;

            m_listbox.BackColorChanged += (sender, e) => ComputeColors();
            m_listbox.ForeColorChanged += (sender, e) => ComputeColors();

            if (m_settingsService != null)
            {
                var descriptor = new BoundPropertyDescriptor(
                        this,
                        () => MaxCommandCount,
                        "Max Visual Command History Count".Localize(),
                        null,
                        "Maximum number of commands in the visual command history. Minimum value is 10".Localize());

                m_settingsService.RegisterSettings(this, descriptor);
                m_settingsService.RegisterUserSettings("Application", descriptor);

            }
            ComputeColors();
        }
コード例 #45
0
        /// <summary>
        /// Updates the margin of control by an indentation given in inches.
        /// </summary>
        /// <param name="margin">margin to update</param>
        /// <param name="controlInfo">control info to resolve indentation size</param>
        /// <param name="indent">indent</param>
        public static System.Windows.Forms.Padding UpdateMarginByIndent(System.Windows.Forms.Padding margin, ControlInfo controlInfo, int indent)
        {
            int indentSize = controlInfo.ControlSpacingInfo.Indention;

            margin.Left = indent * indentSize;
            return(margin);
        }
コード例 #46
0
        public SamplesConfiguration()
        {
            DemoInfo gettingstarted = new DemoInfo()
            {
                Name          = "Getting Started",
                Category      = "Getting Started",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the basic features such as selection, sorting, filtering, grouping, and autofit columns of the data grid.",
                DemoView      = typeof(DataGrid.GettingStarted),
                ShowInfoPanel = true
            };

            List <Documentation> gettingstartedDocumentations = new List <Documentation>();

            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.html")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Getting Started Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/getting-started")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Selection Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/selection")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Sorting Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/sorting")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filtering Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Grouping Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Editing Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/editing")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - CRUD Operations Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/crud-operations")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Printing Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/printing")
            });


            gettingstarted.Documentation.AddRange(gettingstartedDocumentations);

            DemoInfo selection = new DemoInfo()
            {
                Name          = "Selection",
                Category      = "Selection",
                DemoType      = DemoTypes.None,
                Description   = "The data grid provides support to select rows and cells in different modes. It supports selection of one or more rows and cells programmatically or by mouse and keyboard interaction.",
                DemoView      = typeof(DataGrid.Selection),
                ShowInfoPanel = true
            };

            List <Documentation> selectionDocumentations = new List <Documentation>();

            selectionDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - SelectionMode API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.GridSelectionMode.html")
            });
            selectionDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - SelectionUnit API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.GridSelectionUnit.html")
            });
            selectionDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Selection Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/selection")
            });
            selectionDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Selection Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/selection#events-processed-on-selection")
            });
            selectionDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Selection Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/selection#customizing-selection-behaviors")
            });
            selectionDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Selection Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/selection#selection-in-master-details-view")
            });


            selection.Documentation.AddRange(selectionDocumentations);


            DemoInfo editing = new DemoInfo()
            {
                Name          = "Editing",
                Category      = "Editing",
                DemoType      = DemoTypes.None,
                Description   = "The data grid provides support to edit cells with built-in editors such as TextBox, ComboBox and DatePicker. Trigger the edit mode with a single or double tap.",
                DemoView      = typeof(DataGrid.EditingDemo),
                ShowInfoPanel = true
            };

            List <Documentation> editingDocumentations = new List <Documentation>();

            editingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Editing API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.SfGridBase.html#Syncfusion_UI_Xaml_Grids_SfGridBase_AllowEditing")
            });
            editingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Editing Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/editing")
            });
            editingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Editing Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/editing#events")
            });
            editingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Programmatic Editing Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/editing#programmatically-edit-the-cell")
            });

            editing.Documentation.AddRange(editingDocumentations);

            DemoInfo sorting = new DemoInfo()
            {
                Name          = "Sorting",
                Category      = "Data Presentation",
                DemoType      = DemoTypes.None,
                Description   = "The data grid allows you to sort data against one or more columns. Additional sorting functionalities include tristate sorting and displaying sort numbers to indicate the sort order.",
                DemoView      = typeof(DataGrid.Sorting),
                ShowInfoPanel = true
            };

            List <Documentation> sortingDocumentations = new List <Documentation>();

            sortingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Sorting API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.SfGridBase.html#Syncfusion_UI_Xaml_Grids_SfGridBase_AllowSorting")
            });
            sortingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Sorting Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/sorting")
            });
            sortingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Custom Sorting Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/sorting#custom-sorting")
            });
            sortingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Programmatic Sorting Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/sorting#programmatic-sorting")
            });
            sortingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Sorting Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/sorting#handling-events")
            });

            sorting.Documentation.AddRange(sortingDocumentations);

            DemoInfo filtering = new DemoInfo()
            {
                Name          = "Filtering",
                Category      = "Filtering",
                DemoType      = DemoTypes.New,
                Description   = "This sample showcases the data filtering capabilities of the DataGrid control.",
                DemoView      = typeof(DataGrid.Filtering),
                ShowInfoPanel = true
            };

            List <Documentation> filteringDocumentations = new List <Documentation>();

            filteringDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - View Filter API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Data.ICollectionViewAdv.html#Syncfusion_UI_Xaml_Data_ICollectionViewAdv_Filter")
            });
            filteringDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - View Filter Refresh API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Data.ICollectionViewAdv.html#Syncfusion_UI_Xaml_Data_ICollectionViewAdv_RefreshFilter_System_Boolean_")
            });
            filteringDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - View Filtering Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering#view-filtering")
            });
            filteringDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Instant Filtering Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering#instant-filtering")
            });
            filteringDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filtering Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering#events")
            });

            filtering.Documentation.AddRange(filteringDocumentations);

            DemoInfo filterRow = new DemoInfo()
            {
                Name          = "Filter Row",
                Category      = "Filtering",
                DemoType      = DemoTypes.New,
                Description   = "This sample showcases the filter row functionalities of the DataGrid control.",
                DemoView      = typeof(DataGrid.FilterRow),
                ShowInfoPanel = true
            };

            List <Documentation> filterRowDocumentations = new List <Documentation>();

            filterRowDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filter Row API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_FilterRowPosition")
            });
            filterRowDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filter Row Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filterrow")
            });
            filterRowDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filter Row Instant Filtering Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filterrow#instant-filtering")
            });
            filterRowDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filter Row Styling Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filterrow#styling")
            });
            filterRowDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filter Row Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filterrow#customizing-filter-row-editors")
            });

            filterRow.Documentation.AddRange(filterRowDocumentations);

            DemoInfo advancefilter = new DemoInfo()
            {
                Name          = "Advanced Filtering",
                Category      = "Filtering",
                DemoType      = DemoTypes.None,
                Description   = "The data grid supports filtering columns like the Excel inspired UI.",
                DemoView      = typeof(DataGrid.AdvanceFilter),
                ShowInfoPanel = true
            };

            List <Documentation> advancefilterDocumentations = new List <Documentation>();

            advancefilterDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filtering API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_AllowFiltering")
            });
            advancefilterDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Advanced Filtering Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering#advanced-filter-ui")
            });
            advancefilterDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filtering Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering")
            });
            advancefilterDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filtering Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering#events")
            });
            advancefilterDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Filtering Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/filtering#show-image-in-checkboxfiltercontrol-instead-of-image-path")
            });

            advancefilter.Documentation.AddRange(advancefilterDocumentations);

            DemoInfo grouping = new DemoInfo()
            {
                Name          = "Grouping",
                Category      = "Data Presentation",
                DemoType      = DemoTypes.None,
                Description   = "The data grid allows you to group data by one or more columns. You can group the required column by dragging it to an intuitive group drop area at the top of the data grid.",
                DemoView      = typeof(DataGrid.Grouping),
                ShowInfoPanel = true
            };

            List <Documentation> groupingDocumentations = new List <Documentation>();

            groupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Grouping API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_AllowGrouping")
            });
            groupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - GroupMode API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GridColumn.html#Syncfusion_UI_Xaml_DataGrid_GridColumn_GroupMode")
            });
            groupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Grouping Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping")
            });
            groupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Programmatic Grouping Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping#programmatic-grouping")
            });
            groupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Grouping Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping#grouping-events")
            });
            groupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Group Drop Area Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping#groupdroparea-customization")
            });

            grouping.Documentation.AddRange(groupingDocumentations);

            DemoInfo customGrouping = new DemoInfo()
            {
                Name          = "Custom Grouping",
                Category      = "Data Presentation",
                DemoType      = DemoTypes.New,
                Description   = "This sample showcases the custom grouping capabilities in the DataGrid Control.",
                DemoView      = typeof(DataGrid.CustomGrouping),
                ShowInfoPanel = true
            };

            List <Documentation> customGroupingDocumentations = new List <Documentation>();

            customGroupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Custom Grouping API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_GroupColumnDescriptions")
            });
            customGroupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - GroupColumnDescription API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GroupColumnDescription.html")
            });
            customGroupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Custom Grouping Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping#custom-grouping")
            });
            customGroupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Sortig the Grouped Column Records Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping#sorting-the-grouped-column-records")
            });
            customGroupingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Grouping Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping#grouping-events")
            });

            customGrouping.Documentation.AddRange(customGroupingDocumentations);

            DemoInfo columnSizer = new DemoInfo()
            {
                Name          = "Column Sizing",
                Category      = "Columns",
                DemoType      = DemoTypes.New,
                Description   = "This sample show cases the different types of column-sizing capabilities in the DataGrid control.",
                DemoView      = typeof(DataGrid.ColumnSizer),
                ShowInfoPanel = true
            };

            List <Documentation> columnSizerDocumentations = new List <Documentation>();

            columnSizerDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Column Sizer API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_ColumnWidthMode")
            });
            columnSizerDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - ColumnWidthMode API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.ColumnWidthMode.html")
            });
            columnSizerDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Column Sizer Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/autosize-columns")
            });
            columnSizerDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Column Sizer Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/grouping#sorting-the-grouped-column-records")
            });
            columnSizerDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Star Column Width Mode Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/autosize-columns#star-column-sizer-ratio-support")
            });

            columnSizer.Documentation.AddRange(columnSizerDocumentations);

            DemoInfo dataBinding = new DemoInfo()
            {
                Name          = "Data Binding",
                Category      = "Data Binding",
                DemoType      = DemoTypes.New,
                Description   = "This sample showcases the data binding capabilities in the DataGrid control.",
                DemoView      = typeof(DataGrid.DataBinding),
                ShowInfoPanel = true
            };

            List <Documentation> dataBindingDocumentations = new List <Documentation>();

            dataBindingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Binding API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_ItemsSource")
            });
            dataBindingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Binding Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-binding")
            });
            dataBindingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Binding With IEnumerable Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-binding#binding-with-ienumerable")
            });
            dataBindingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Binding With Dynamic Data Object Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-binding#binding-with-dynamic-data-object")
            });
            dataBindingDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Binding Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-binding#events")
            });

            dataBinding.Documentation.AddRange(dataBindingDocumentations);

            DemoInfo summaries = new DemoInfo()
            {
                Name          = "Summaries",
                Category      = "Data Presentation",
                DemoType      = DemoTypes.None,
                Description   = "The data grid supports display of concise information about the data objects using summaries. ",
                DemoView      = typeof(DataGrid.Summaries),
                ShowInfoPanel = true
            };

            List <Documentation> summariesDocumentations = new List <Documentation>();

            summariesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - GridTableSummaryRow API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_TableSummaryRows")
            });
            summariesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - GroupSummaryRow API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_GroupSummaryRows")
            });
            summariesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - CaptionSummaryRow API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_CaptionSummaryRow")
            });
            summariesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Summaries Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/summaries")
            });
            summariesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Summaries Formatting Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/summaries#formatting-summary")
            });
            summariesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Custom Summaries Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/summaries#custom-summaries")
            });

            summaries.Documentation.AddRange(summariesDocumentations);

            DemoInfo stackedheaders = new DemoInfo()
            {
                Name          = "Stacked Headers",
                Category      = "Row",
                DemoType      = DemoTypes.None,
                Description   = "The data grid allows you to add additional unbound header rows, known as stacked header rows, that span across columns.",
                DemoView      = typeof(DataGrid.StackedHeader),
                ShowInfoPanel = true
            };

            List <Documentation> stackedheadersDocumentations = new List <Documentation>();

            stackedheadersDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Stacked Headers API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.SfGridBase.html#Syncfusion_UI_Xaml_Grids_SfGridBase_StackedHeaderRows")
            });
            stackedheadersDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Stacked Headers Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/stacked-headers")
            });
            stackedheadersDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Stacked Headers Height Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/stacked-headers#changing-stacked-header-row-height")
            });

            stackedheaders.Documentation.AddRange(stackedheadersDocumentations);

            DemoInfo serialization = new DemoInfo()
            {
                Name          = "Serialization",
                Category      = "Serialization",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases serialization and deserialization settings of the data grid.",
                DemoView      = typeof(DataGrid.Serialization),
                ShowInfoPanel = true
            };

            List <Documentation> serializationDocumentations = new List <Documentation>();

            serializationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Serialization API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.Serialization.html")
            });
            serializationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Serialization Options API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.Serialization.SerializationOptions.html")
            });
            serializationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Deserialization Options API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.Serialization.DeserializationOptions.html")
            });
            serializationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Serialize and Deserialize Properties API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.Serialization.SerializableDataGrid.html")
            });
            serializationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Serialize and Deserialize Filters API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.Serialization.SerializableFilter.html")
            });
            serializationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Serialize and Deserialize StackedHeaders API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.Serialization.SerializableStackedHeaderRow.html")
            });
            serializationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Serialize and Deserialize Summaries API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.Serialization.SerializableGridSummaryRows.html")
            });

            serialization.Documentation.AddRange(serializationDocumentations);

            DemoInfo freezepanes = new DemoInfo()
            {
                Name          = "Freeze Panes",
                Category      = "Appearance",
                DemoType      = DemoTypes.None,
                Description   = "The data grid provides support to freeze rows at top or bottom and columns at left or right side, similar to Excel.",
                DemoView      = typeof(DataGrid.FreezePanes),
                ShowInfoPanel = true
            };

            List <Documentation> freezepanesDocumentations = new List <Documentation>();

            freezepanesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Frozen Rows API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_FrozenRowsCount")
            });
            freezepanesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Frozen Footer Rows API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_FrozenFooterRowsCount")
            });
            freezepanesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Frozen Columns API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.SfGridBase.html#Syncfusion_UI_Xaml_Grids_SfGridBase_FrozenColumnCount")
            });
            freezepanesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Frozen Footer Columns API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.SfGridBase.html#Syncfusion_UI_Xaml_Grids_SfGridBase_FrozenFooterColumnCount")
            });
            freezepanesDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Freeze Panes Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/rows#freeze-panes")
            });

            freezepanes.Documentation.AddRange(freezepanesDocumentations);

            DemoInfo contextflyout = new DemoInfo()
            {
                Name          = "Context Flyout",
                Category      = "Interactive Features",
                DemoType      = DemoTypes.None,
                Description   = "The context flyout is an entirely customizable flyout for the extensible functions of a data grid. It is enabled for various elements of the grid such as data cell, header cell, and so on.",
                DemoView      = typeof(DataGrid.ContextFlyout),
                ShowInfoPanel = true
            };

            List <Documentation> contextflyoutDocumentations = new List <Documentation>();

            contextflyoutDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - GroupDropAreaContextFlyout API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_GroupDropAreaContextFlyout")
            });
            contextflyoutDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - GroupCaptionContextFlyout API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_GroupCaptionContextFlyout")
            });
            contextflyoutDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - GroupSummaryContextFlyout API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_GroupSummaryContextFlyout")
            });
            contextflyoutDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - TableSummaryContextFlyout API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_TableSummaryContextFlyout")
            });
            contextflyoutDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - ContextFlyout Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/context-flyout")
            });

            contextflyout.Documentation.AddRange(contextflyoutDocumentations);

            DemoInfo clipboardoperation = new DemoInfo()
            {
                Name          = "Clipboard Operation",
                Category      = "Interactive Features",
                DemoType      = DemoTypes.None,
                Description   = "The data grid provides an interactive support to perform cut, copy, and paste operations by using the CopyOption and PasteOption properties.",
                DemoView      = typeof(DataGrid.ClipboardOperation),
                ShowInfoPanel = true
            };

            List <Documentation> clipboardoperationDocumentations = new List <Documentation>();

            clipboardoperationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - CopyOptions API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.GridCopyOptions.html#fields")
            });
            clipboardoperationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - PasteOptions API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.GridPasteOptions.html#fields")
            });
            clipboardoperationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Clipboard Operation Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/clipboard-operations")
            });
            clipboardoperationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Clipboard Operation Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/clipboard-operations#events")
            });
            clipboardoperationDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Clipboard Operation Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/clipboard-operations#customizing-copy-paste-behavior-in-winui-datagrid")
            });

            clipboardoperation.Documentation.AddRange(clipboardoperationDocumentations);

            DemoInfo rowdragdrop = new DemoInfo()
            {
                Name          = "Row Drag and Drop",
                Category      = "Interactive Features",
                DemoType      = DemoTypes.New,
                Description   = "The DataGrid control provides support to perform row drag-and-drop operations using the AllowDraggingRows and AllowDrop properties.",
                DemoView      = typeof(DataGrid.RowDragDrop),
                ShowInfoPanel = false
            };

            DemoInfo datavalitations = new DemoInfo()
            {
                Name          = "Data Validation",
                Category      = "Data Validation",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases data validation for cells and displays hints in case the validation does not pass.",
                DemoView      = typeof(DataGrid.DataValidation),
                ShowInfoPanel = true
            };

            List <Documentation> datavalitationsDocumentations = new List <Documentation>();

            datavalitationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - DataValidationMode API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.GridColumnBase.html#Syncfusion_UI_Xaml_Grids_GridColumnBase_DataValidationMode")
            });
            datavalitationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Validation Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation")
            });
            datavalitationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Built-In Data Validation Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation#built-in-validations")
            });
            datavalitationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Validation Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation#cell-validation")
            });
            datavalitationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Validation Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation#data-validation-error-icon-customization")
            });
            datavalitationsDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Data Validation Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation#data-validation-with-master-details-view")
            });

            datavalitations.Documentation.AddRange(datavalitationsDocumentations);

            DemoInfo customvalidations = new DemoInfo()
            {
                Name          = "Custom Validation",
                Category      = "Data Validation",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases custom data validation for cells in a data grid by using the CurrentCellValidating and RowValidating events.",
                DemoView      = typeof(DataGrid.CustomValidation),
                ShowInfoPanel = true
            };

            List <Documentation> customvalidationsDocumentations = new List <Documentation>();

            customvalidationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - DataValidationMode API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Grids.GridColumnBase.html#Syncfusion_UI_Xaml_Grids_GridColumnBase_DataValidationMode")
            });
            customvalidationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Validation Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation")
            });
            customvalidationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Validation Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation#cell-validation")
            });
            customvalidationsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Data Validation Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation#data-validation-error-icon-customization")
            });
            customvalidationsDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Data Validation Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/data-validation#data-validation-with-master-details-view")
            });

            customvalidations.Documentation.AddRange(customvalidationsDocumentations);

            DemoInfo unboundrows = new DemoInfo()
            {
                Name          = "Unbound Rows",
                Category      = "Row",
                DemoType      = DemoTypes.None,
                Description   = "The data grid provides support to add additional rows at the top and bottom of the SfDataGrid, which are not bound with data objects from the underlying data source.",
                DemoView      = typeof(DataGrid.UnboundRows),
                ShowInfoPanel = true
            };

            List <Documentation> unboundrowsDocumentations = new List <Documentation>();

            unboundrowsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Unbound Rows API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GridUnboundRow.html")
            });
            unboundrowsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Unbound Rows Properties API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GridUnboundRow.html#properties")
            });
            unboundrowsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Unbound Rows Events API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.SfDataGrid.html#Syncfusion_UI_Xaml_DataGrid_SfDataGrid_QueryUnboundRow")
            });
            unboundrowsDocumentations.Add(new Documentation()
            {
                Content = "DataGrid - Unbound Rows Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/unbound-rows")
            });

            unboundrows.Documentation.AddRange(unboundrowsDocumentations);

            DemoInfo masterdetailsview = new DemoInfo()
            {
                Name          = "Master Details View",
                Category      = "Master Detail",
                DemoType      = DemoTypes.None,
                Description   = "The data grid displays hierarchical data in the form of nested tables using master-details view configuration.",
                DemoView      = typeof(DataGrid.MasterDetailsView),
                ShowInfoPanel = true
            };

            List <Documentation> masterdetailsviewDocumentations = new List <Documentation>();

            masterdetailsviewDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - API Reference", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.DetailsViewDataGrid.html")
            });
            masterdetailsviewDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/master-details-view")
            });
            masterdetailsviewDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Defining Relations Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/master-details-view#defining-relations-in-datagrid")
            });
            masterdetailsviewDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Selection Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/master-details-view#selection")
            });
            masterdetailsviewDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Column Sizing Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/master-details-view#column-sizing")
            });
            masterdetailsviewDocumentations.Add(new Documentation()
            {
                Content = "Details View DataGrid - Events Documentation", Uri = new Uri("https://help.syncfusion.com/winui/datagrid/master-details-view#handling-events")
            });

            masterdetailsview.Documentation.AddRange(masterdetailsviewDocumentations);
            var demos = new List <DemoInfo>()
            {
                gettingstarted,
                dataBinding,
                sorting,
                grouping,
                summaries,
                filtering,
                advancefilter,
                filterRow,
                masterdetailsview,
                editing,
                stackedheaders,
                unboundrows,
                columnSizer,
                datavalitations,
                customvalidations,
                selection,
                freezepanes,
                contextflyout,
                clipboardoperation,
                rowdragdrop,
                serialization,
                customGrouping
            };

            var controlInfo = new ControlInfo()
            {
                Control         = DemoControl.SfDataGrid,
                ControlCategory = ControlCategory.Grids,
                Description     = "The Data Grid is a high performance grid control that displays tabular and hierarchical data. It supports sorting, grouping, filtering, etc.",
                Glyph           = "\uE707"
            };

            controlInfo.Demos.AddRange(demos);
            DemoHelper.ControlInfos.Add(controlInfo);
        }
コード例 #47
0
        /// <summary>
        /// Updates the positions and settings of the controls in the interface
        /// </summary>
        protected override void RefreshControlPositions()
        {
            if (ManagedControl == null)
            {
                return;
            }
            try
            {
                ManagedControl.SuspendLayout();
                _currentPos = new Point(BorderSize, BorderSize);
                int lastColSpan = 0;
                for (int i = 0; i < _controls.Count; i++)
                {
                    int currentRow       = i / ColumnCount;
                    int currentCol       = i % ColumnCount;
                    IControlHabanero ctl = this._controls[i];

                    if ((i > 0) && (currentCol == 0))
                    {
                        _currentPos.X  = BorderSize;
                        _currentPos.Y += this._controls[i - 1].Height + VerticalGapSize;
                    }
                    int         width   = 0;
                    ControlInfo ctlInfo = (ControlInfo)_controlInfoTable[ctl];
                    for (int columnNumber = currentCol;
                         columnNumber < Math.Min(this.ColumnCount, currentCol + ctlInfo.ColumnSpan);
                         columnNumber++)
                    {
                        if (IsFixedColumn(columnNumber))
                        {
                            width += _columnWidths[columnNumber];
                        }
                        else
                        {
                            width += CalcColumnWidth();
                        }
                    }
                    width += (this.HorizontalGapSize * (ctlInfo.ColumnSpan - 1));

                    int height = 0;

                    for (int rows = currentRow; rows < Math.Min(RowCount, currentRow + ctlInfo.RowSpan); rows++)
                    {
                        if (IsFixedRow(currentRow))
                        {
                            height += _rowHeights[currentRow];
                        }
                        else
                        {
                            height += CalcRowHeight();
                        }
                    }

                    height += (VerticalGapSize * (ctlInfo.RowSpan - 1));
                    //height += GapSize;

                    //ctl.Left = _currentPos.X;
                    //ctl.Top = _currentPos.Y;
                    //ctl.Width = width;
                    //ctl.Height = height;
                    ctl.Location = new Point(_currentPos.X, _currentPos.Y);
                    ctl.Size     = new Size(width, height);

                    int posIncrement = 0;
                    if (lastColSpan > 1)
                    {
                        //if (IsFixedColumn(currentCol)) posIncrement = _columnWidths[currentCol];
                        lastColSpan--;
                    }
                    else
                    {
                        posIncrement = ctl.Width + HorizontalGapSize;
                        lastColSpan  = ctlInfo.ColumnSpan;
                    }
                    _currentPos.X += posIncrement;
                }
            }
            finally
            {
                ManagedControl.ResumeLayout(true);
            }
        }
コード例 #48
0
        /// <summary>
        /// Adds a control as specified by the ControlInfo provided (which can provide some context for the control)
        /// such as number of rows or columns to span.
        /// </summary>
        /// <param name="controlInfo">The information about the control to add to the next position in the grid.</param>
        public IControlHabanero AddControl(ControlInfo controlInfo)
        {
            IControlHabanero control = null;
            int rowSpan    = 1;
            int columnSpan = 1;

            if (controlInfo != null)
            {
                control    = controlInfo.Control;
                rowSpan    = controlInfo.RowSpan;
                columnSpan = controlInfo.ColumnSpan;
            }


            if (control == null)
            {
                control         = _controlFactory.CreateControl();
                control.Visible = false;
            }
            int currentColNum = (this._controls.Count) % ColumnCount;
            int currentRowNum = (this._controls.Count) / ColumnCount;

            if (currentRowNum >= _rowHeights.Length)
            {
                string errorMessage = string.Format("You cannot add a control to the grid layout manager since it exceeds the grids size of '{0}' row and '{1}' column",
                                                    _rowHeights.Length, _columnWidths.Length);
                throw new HabaneroDeveloperException(
                          "There is a serious application error. Please contact your system administrator" + Environment.NewLine + errorMessage, errorMessage);
            }

            if (_positionsOccupied[currentRowNum, currentColNum])
            {
                IControlHabanero nullControl = _controlFactory.CreateControl();
                //FixRow(currentRowNum,0);
                nullControl.Visible = false;
                nullControl.Name    = "Null";
                _controls.Add(nullControl);
                this.ManagedControl.Controls.Add(nullControl);
                this._controlInfoTable.Add(nullControl, new ControlInfo(nullControl, columnSpan, rowSpan));
                return(AddControl(controlInfo));
            }

            if (_fixedColumnsBasedOnContents[currentColNum])
            {
                if (control.Width > _columnWidths[currentColNum])
                {
                    FixColumn(currentColNum, control.Width);
                }
            }
            if (_fixAllRowsBasedOnContents)
            {
                if (control.Height > _rowHeights[currentRowNum])
                {
                    FixRow(currentRowNum, control.Height);
                }
            }
            else if (_fixedRowsBasedOnContents[currentRowNum])
            {
                if (control.Height > _rowHeights[currentRowNum])
                {
                    FixRow(currentRowNum, control.Height);
                }
            }
            this._controls.Add(control);

            this.ManagedControl.Controls.Add(control);
            this._controlInfoTable.Add(control, new ControlInfo(control, columnSpan, rowSpan));

            for (int i = currentRowNum; i < currentRowNum + rowSpan; i++)
            {
                for (int j = currentColNum; j < currentColNum + columnSpan; j++)
                {
                    _positionsOccupied[i, j] = true;
                }
            }


            RefreshControlPositions();
            return(control);
        }
コード例 #49
0
        public RawTreeListView(
            MainForm mainForm,
            IContextRegistry contextRegistry,
            ISettingsService settingsService,
            IControlHostService controlHostService)
        {
            m_mainForm        = mainForm;
            m_contextRegistry = contextRegistry;

            m_host = new UserControl {
                Dock = DockStyle.Fill
            };

            int x = 2, y = 2;
            var buttonHeight = -1;

            // Create and add button
            {
                var btn = CreateButton(AddFolderText, ref x, ref y, ref buttonHeight);
                btn.Click += BtnAddFolderClick;
                m_host.Controls.Add(btn);
            }

            // Create remove item button
            {
                m_btnRemoveItem         = CreateButton(RemoveItemText, ref x, ref y, ref buttonHeight);
                m_btnRemoveItem.Enabled = false;
                m_btnRemoveItem.Click  += BtnRemoveItemClick;
                m_host.Controls.Add(m_btnRemoveItem);
            }

            {
                var btn = CreateButton(InvertSelectionText, ref x, ref y, ref buttonHeight);
                btn.Click += BtnInvertSelectionClick;
                m_host.Controls.Add(btn);
            }

            {
                m_btnExpandOrCollapseSingle         = CreateButton(ExpandOrCollapseNodeText, ref x, ref y, ref buttonHeight);
                m_btnExpandOrCollapseSingle.Enabled = false;
                m_btnExpandOrCollapseSingle.Click  += BtnExpandOrCollapse;
                m_host.Controls.Add(m_btnExpandOrCollapseSingle);
            }

            // Add TreeListView
            {
                m_control = new TreeListView {
                    Name = NameText, AllowDrop = true
                };
                m_control.NodeSorter = new MySorter(m_control);
                m_control.Columns.Add(new TreeListView.Column("Name"));
                m_control.NodeLazyLoad    += ControlNodeLazyLoad;
                m_control.Control.Location = new Point(0, buttonHeight + 2);
                m_control.Control.Width    = m_host.Width;
                m_control.Control.Height   = m_host.Height - buttonHeight - 2;
                m_control.Control.Anchor   =
                    AnchorStyles.Left | AnchorStyles.Top |
                    AnchorStyles.Right | AnchorStyles.Bottom;

                m_control.NodeExpandedChanged += TreeListViewNodeExpandedChanged;
                m_control.NodeSelected        += TreeListViewNodeSelected;

                m_control.DragEnter += ControlDragEnter;
                m_control.DragDrop  += ControlDragDrop;

                m_host.Controls.Add(m_control);
            }

            // Persist column widths
            {
                var owner =
                    string.Format(
                        "{0}-{1}-TreeListView",
                        this,
                        m_control.Name);

                settingsService.RegisterSettings(
                    owner,
                    new BoundPropertyDescriptor(
                        m_control,
                        () => m_control.PersistedSettings,
                        SettingsDisplayName,
                        SettingsCategory,
                        SettingsDescription));
            }

            // Create GUI
            {
                var info =
                    new ControlInfo(
                        m_control.Name,
                        m_control.Name,
                        StandardControlGroup.CenterPermanent);

                controlHostService.RegisterControl(
                    m_host,
                    info,
                    this);
            }

            if (s_dataImageIndex == -1)
            {
                s_dataImageIndex =
                    ResourceUtil.GetImageList16().Images.IndexOfKey(
                        Resources.DataImage);
            }

            if (s_folderImageIndex == -1)
            {
                s_folderImageIndex =
                    ResourceUtil.GetImageList16().Images.IndexOfKey(
                        Resources.FolderImage);
            }
        }
コード例 #50
0
ファイル: Validator.cs プロジェクト: muhammetmustafa/Mustava
        public bool DateValidationItem(ControlInfo firstYear, ControlInfo firstMonth, ControlInfo secondYear, ControlInfo secondMonth)
        {
            var validationItem = new DateValidationItem();

            validationItem.SetControlInfos(firstYear, firstMonth, secondYear, secondMonth);

            _validationItems.Add(validationItem);

            return(true);
        }
コード例 #51
0
ファイル: WindowInfo.cs プロジェクト: odalet/Hawkeye2
 public void DetectDotNetProperties()
 {
     ControlInfo = null;
     if (Clr == Clr.Net2 || Clr == Clr.Net4)
         ControlInfo = new ControlInfo(Handle);
 }
コード例 #52
0
        public SamplesConfiguration()
        {
            DemoInfo gettingStartedDemo = new DemoInfo()
            {
                Name        = "Getting started",
                Description = "This sample explains the steps required for the addition of linear gauge and its elements such as axis, range, and pointer.",
                Category    = "Getting started",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.GettingStarted)
            };

            DemoInfo thermometerDemo = new DemoInfo()
            {
                Name        = "Thermometer",
                Description = "This sample shows how to create thermometer using multiple linear gauge control.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.ThermometerDemo)
            };

            DemoInfo HeightCalculatorDemo = new DemoInfo()
            {
                Name        = "Height calculator",
                Description = "This sample shows the range child support capabilities of linear gauge control.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.HeightCalculatorDemo)
            };

            DemoInfo waterLevelIndicatorDemo = new DemoInfo()
            {
                Name        = "Water level indicator",
                Description = "This sample shows the bar pointer child support capabilities of linear gauge control.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.WaterLevelIndicatorDemo)
            };

            DemoInfo volumeSettingsDemo = new DemoInfo()
            {
                Name        = "Volume settings",
                Description = "This sample showcase the volume settings demo using bar and content pointer support of linear gauge control.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.VolumeSettingsDemo)
            };

            DemoInfo progressBarDemo = new DemoInfo()
            {
                Name        = "Progress bar",
                Description = "This demo demonstrate how to display progress bar using bar pointer and its child support.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.ProgressBarDemo)
            };

            DemoInfo sleepWatchScoreDemo = new DemoInfo()
            {
                Name        = "Sleep watch score",
                Description = "This sample demonstrate how to create sleep calculator using multiple range.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.SleepWatchScore)
            };

            DemoInfo stepsCounterDemo = new DemoInfo()
            {
                Name        = "Steps counter",
                Description = "Steps counter using content pointer in linear gauge control.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.StepsCounter)
            };

            DemoInfo batteryIndicatorDemo = new DemoInfo()
            {
                Name        = "Battery indicator",
                Description = "This sample shows how to create battery using range support in linear gauge control.",
                Category    = "Showcase",
                DemoType    = DemoTypes.Showcase | DemoTypes.None,
                DemoView    = typeof(Views.BatteryDemo)
            };

            DemoInfo bulletGraphDemo = new DemoInfo()
            {
                Name        = "Bullet Chart",
                Description = "This sample shows how to create bullet graph using range and pointers support in linear gauge control.",
                Category    = "Showcase",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.BulletGraphDemo)
            };

            DemoInfo defaultAxisDemo = new DemoInfo()
            {
                Name        = "Default Axis",
                Description = "This sample shows the basic axis view of the linear gauge control.",
                Category    = "Axis",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.DefaultAxis)
            };

            DemoInfo axisCornerDemo = new DemoInfo()
            {
                Name        = "Corner style",
                Description = "This sample shows the corner style customization of the linear axis in linear gauge control.",
                Category    = "Axis",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.AxisCornerStyle)
            };

            DemoInfo tickCustomizationDemo = new DemoInfo()
            {
                Name        = "Tick customization",
                Description = "This sample shows the major and minor tick customization of the linear gauge.",
                Category    = "Axis",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.TickCustomization)
            };

            DemoInfo labelCustomizationDemo = new DemoInfo()
            {
                Name        = "Label customization",
                Description = "This sample shows the customization of the label, such as the inclusion of post fix label capabilities.",
                Category    = "Axis",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.LabelCustomization)
            };

            DemoInfo textLabelDemo = new DemoInfo()
            {
                Name        = "Text label",
                Description = "This sample shows the custom label capabilities of the linear gauge using label template.",
                Category    = "Axis",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.TextLabel)
            };

            DemoInfo inversedAxisDemo = new DemoInfo()
            {
                Name        = "Inversed axis",
                Description = "This sample shows the inversed support in linear gauge control.",
                Category    = "Axis",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.InversedAxis)
            };

            DemoInfo verticalAxisDemo = new DemoInfo()
            {
                Name        = "Vertical axis",
                Description = "This sample shows the vertical support in linear gauge control.",
                Category    = "Axis",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.VerticalAxis)
            };

            DemoInfo linearRangeDemo = new DemoInfo()
            {
                Name        = "Linear range",
                Description = "This sample shows the range support capabilities of linear gauge control.",
                Category    = "Range",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.LinearRange)
            };

            DemoInfo multipleRangesDemo = new DemoInfo()
            {
                Name        = "Multiple ranges",
                Description = "This sample shows multiple range support and its child capabilities of linear gauge control.",
                Category    = "Range",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.MultipleRanges)
            };

            DemoInfo useRangeColorForAxisDemo = new DemoInfo()
            {
                Name        = "Range colors for axis",
                Description = "This sample shows how to use the respective range color to the axis elements such as ticks and labels.",
                Category    = "Range",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.UseRangeColorForAxisDemo)
            };

            DemoInfo verticalRangesDemo = new DemoInfo()
            {
                Name        = "Vertical ranges",
                Description = "This sample shows vertical range support capabilities of linear gauge control.",
                Category    = "Range",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.VerticalRanges)
            };

            DemoInfo barPointerDemo = new DemoInfo()
            {
                Name        = "Bar pointer",
                Description = "This demo demonstrate how to display progress bar using bar pointer and its child support.",
                Category    = "Pointers",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.BarPointer)
            };

            DemoInfo multiplePointersDemo = new DemoInfo()
            {
                Name        = "Multiple pointers",
                Description = "This demo shows how to add multiple pointer in linear gauge control.",
                Category    = "Pointers",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.MultiplePointers)
            };

            DemoInfo contentPointersDemo = new DemoInfo()
            {
                Name        = "Custom pointer",
                Description = "This sample shows the capabilities of custom view pointer in linear gauge control.",
                Category    = "Pointers",
                DemoType    = DemoTypes.None,
                DemoView    = typeof(Views.ContentPointer)
            };

            List <DemoInfo> demos = new List <DemoInfo>()
            {
                gettingStartedDemo,
                thermometerDemo,
                HeightCalculatorDemo,
                waterLevelIndicatorDemo,
                volumeSettingsDemo,
                progressBarDemo,
                sleepWatchScoreDemo,
                stepsCounterDemo,
                batteryIndicatorDemo,
                bulletGraphDemo,
                defaultAxisDemo,
                axisCornerDemo,
                tickCustomizationDemo,
                labelCustomizationDemo,
                textLabelDemo,
                inversedAxisDemo,
                verticalAxisDemo,
                linearRangeDemo,
                multipleRangesDemo,
                useRangeColorForAxisDemo,
                verticalRangesDemo,
                barPointerDemo,
                multiplePointersDemo,
                contentPointersDemo
            };

            ControlInfo controlInfo = new ControlInfo()
            {
                Control         = DemoControl.SfLinearGauge,
                Description     = "The WinUI Linear Gauge is a data visualization control that can be used to display data on a linear scale in either horizontal or vertical orientation.",
                ControlCategory = ControlCategory.DataVisualization,
                ControlBadge    = ControlBadge.None,
                Glyph           = "\ue712"
            };

            controlInfo.Demos.AddRange(demos);
            DemoHelper.ControlInfos.Add(controlInfo);
        }
コード例 #53
0
 public virtual void RegisterControl(DiagramDocument doc, Control control, ControlInfo controlInfo, IControlHostClient client)
 {
     _controls.Add(doc, new Pair <Control, ControlInfo>(control, controlInfo));
     _hostService.RegisterControl(control, controlInfo, client);
 }
コード例 #54
0
ファイル: VJoyControl.cs プロジェクト: cualquiercosa327/JsPie
 public VJoyControl(ControlInfo controlInfo, ControlId controlId)
 {
     ControlInfo = Guard.NotNull(controlInfo, nameof(controlInfo));
     ControlId   = Guard.NotNull(controlId, nameof(controlId));
 }
コード例 #55
0
        /// <summary>
        /// Loads the document at the given URI. Creates a D2dTimelineRenderer and D2dTimelineControl
        /// (through TimelineDocument's Renderer property) to render and display timelines.
        /// If isMasterDocument is true and if the file doesn't exist, a new document is created.</summary>
        /// <param name="uri">URI of document to load</param>
        /// <param name="isMasterDocument">True iff is master document</param>
        /// <returns>TimelineDocument loaded</returns>
        private TimelineDocument LoadOrCreateDocument(Uri uri, bool isMasterDocument)
        {
            // Documents need to have a absolute Uri, so that the relative references to sub-documents
            //  are not ambiguous, and so that the FileWatcherService can be used.
            string filePath;

            if (uri.IsAbsoluteUri)
            {
                filePath = uri.LocalPath;
            }
            else if (!isMasterDocument)
            {
                filePath = PathUtil.GetAbsolutePath(uri.OriginalString,
                                                    Path.GetDirectoryName(s_repository.ActiveDocument.Uri.LocalPath));
                uri = new Uri(filePath, UriKind.Absolute);
            }
            else
            {
                filePath = PathUtil.GetAbsolutePath(uri.OriginalString, Directory.GetCurrentDirectory());
                uri      = new Uri(filePath, UriKind.Absolute);
            }

            // Check if the repository contains this Uri. Remember that document Uris have to be absolute.
            bool             isNewToThisEditor = true;
            DomNode          node     = null;
            TimelineDocument document = (TimelineDocument)s_repository.GetDocument(uri);

            if (document != null)
            {
                node = document.DomNode;
                isNewToThisEditor = false;
            }
            else if (File.Exists(filePath))
            {
                // read existing document using standard XML reader
                using (FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
                {
                    DomXmlReader reader = new DomXmlReader(s_schemaLoader);
                    node = reader.Read(stream, uri);
                }
            }
            else if (isMasterDocument)
            {
                // create new document by creating a Dom node of the root type defined by the schema
                node = new DomNode(Schema.timelineType.Type, Schema.timelineRootElement);
            }

            if (node != null)
            {
                if (document == null)
                {
                    document = node.Cast <TimelineDocument>();

                    D2dTimelineRenderer renderer = CreateTimelineRenderer();
                    document.Renderer = renderer;
                    renderer.Init(document.TimelineControl.D2dGraphics);

                    string      fileName    = Path.GetFileName(filePath);
                    ControlInfo controlInfo = new ControlInfo(fileName, filePath, StandardControlGroup.Center);

                    //Set IsDocument to true to prevent exception in command service if two files with the
                    //  same name, but in different directories, are opened.
                    controlInfo.IsDocument = true;

                    TimelineContext timelineContext = document.Cast <TimelineContext>();
                    timelineContext.ControlInfo = controlInfo;

                    document.Uri = uri;

                    if (isMasterDocument)
                    {
                        s_repository.ActiveDocument = document;//adds 'document'
                    }
                    else
                    {
                        // For sub-documents, we want ActiveDocument to remain the main document so that
                        //  TimelineValidator can identify if a sub-document or master document is being
                        //  modified.
                        IDocument previous = s_repository.ActiveDocument;
                        s_repository.ActiveDocument = document; //adds 'document'
                        s_repository.ActiveDocument = previous; //restores master document
                    }
                }

                IHierarchicalTimeline hierarchical = document.Timeline as IHierarchicalTimeline;
                if (hierarchical != null)
                {
                    ResolveAll(hierarchical, new HashSet <IHierarchicalTimeline>());
                }

                // Listen to events if this is the first time we've seen this.
                if (isNewToThisEditor)
                {
                    // The master document/context needs to listen to events on any sub-document
                    //  so that transactions can be cancelled correctly.
                    if (isMasterDocument)
                    {
                        node.AttributeChanging += DomNode_AttributeChanging;
                    }
                    else
                    {
                        DomNode masterNode = s_repository.ActiveDocument.As <DomNode>();
                        node.SubscribeToEvents(masterNode);
                    }
                }

                // Initialize Dom extensions now that the data is complete
                node.InitializeExtensions();
            }

            return(document);
        }
コード例 #56
0
ファイル: DefaultTabCommands.cs プロジェクト: vincenthamm/ATF
 // Gets the document's full path name, trimmed of invalid characters, like the '*' if the document
 //  was modified. Assumes that 'info' represents a document.
 private string GetDocumentPath(ControlInfo info)
 {
     string path = info.Description;
     path = path.Trim(s_invalidFileNameChars);
     return path;
 }
コード例 #57
0
        public PropertyBasedEffectConfigDialog(PropertyCollection propertyCollection, ControlInfo configUI, PropertyCollection windowProperties)
            : base(propertyCollection)
        {
            this.windowProperties = windowProperties.Clone();
            this.configUI         = (ControlInfo)configUI.Clone();

            // Make sure that the properties in props and configUI are not the same objects
            foreach (Property property in propertyCollection)
            {
                PropertyControlInfo pci = this.configUI.FindControlForPropertyName(property.Name);

                if (pci != null && object.ReferenceEquals(property, pci.Property))
                {
                    throw new ArgumentException("Property references in propertyCollection must not be the same as those in configUI");
                }
            }

            SuspendLayout();

            this.okButton                 = new Button();
            this.cancelButton             = new Button();
            this.cancelButton.Name        = "cancelButton";
            this.configUIPanel            = new Panel();
            this.configUIControl          = (Control)this.configUI.CreateConcreteControl(this);
            this.configUIControl.Location = new Point(0, 0);

            this.configUIPanel.SuspendLayout();
            this.configUIControl.SuspendLayout();

            this.okButton.Name      = "okButton";
            this.okButton.AutoSize  = true;
            this.okButton.Click    += OkButton_Click;
            this.okButton.Text      = PdnResources.GetString("Form.OkButton.Text");
            this.okButton.FlatStyle = FlatStyle.System;

            this.cancelButton.AutoSize  = true;
            this.cancelButton.Click    += CancelButton_Click;
            this.cancelButton.Text      = PdnResources.GetString("Form.CancelButton.Text");
            this.cancelButton.FlatStyle = FlatStyle.System;

            this.configUIPanel.Name    = "configUIPanel";
            this.configUIPanel.TabStop = false;
            this.configUIPanel.Controls.Add(this.configUIControl);

            this.configUIControl.Name = "configUIControl";

            this.etchedLine      = new EtchedLine();
            this.etchedLine.Name = "etchedLine";

            Controls.AddRange(
                new Control[]
            {
                this.okButton,
                this.cancelButton,
                this.etchedLine,
                this.configUIPanel
            });

            int tabIndex = 0;

            this.configUIControl.TabIndex = tabIndex;
            ++tabIndex;

            // Set up data binding
            foreach (Property property in this.properties)
            {
                PropertyControlInfo pci = this.configUI.FindControlForPropertyName(property.Name);

                if (pci == null)
                {
                    throw new InvalidOperationException("Every property must have a control associated with it");
                }
                else
                {
                    Property controlsProperty = pci.Property;

                    // ASSUMPTION: We assume that the concrete WinForms Control holds a reference to
                    //             the same Property instance as the ControlInfo it was created from.

                    controlsProperty.ValueChanged += ControlsProperty_ValueChanged;
                }
            }

            this.okButton.TabIndex = tabIndex;
            ++tabIndex;

            this.cancelButton.TabIndex = tabIndex;
            ++tabIndex;

            AcceptButton = this.okButton;
            CancelButton = this.cancelButton;

            bool isSizable = (bool)this.windowProperties[ControlInfoPropertyNames.WindowIsSizable].Value;

            FormBorderStyle = isSizable ? FormBorderStyle.Sizable : FormBorderStyle.FixedDialog;

            Text = (string)this.windowProperties[ControlInfoPropertyNames.WindowTitle].Value;

            ClientSize = new Size(UI.ScaleWidth(defaultClientWidth96Dpi), UI.ScaleHeight(defaultClientHeight96Dpi));

            this.configUIControl.ResumeLayout(false);
            this.configUIPanel.ResumeLayout(false);

            ResumeLayout(false);
            PerformLayout();
        }
コード例 #58
0
        public SamplesConfiguration()
        {
            DemoInfo gettingstarted = new DemoInfo()
            {
                Name          = "Getting Started",
                Category      = "Getting Started",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the scheduler views such as day, week, workweek and month views with scheduler appointments added. It also showcases the date navigation restriction within minimum and maximum scheduler date range and context menu to add, edit, and delete appointments.",
                DemoView      = typeof(GettingStarted),
                ShowInfoPanel = true
            };

            List <Documentation> gettingstartedDocumentations = new List <Documentation>();

            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            gettingstartedDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Getting Started Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/getting-started")
            });

            gettingstarted.Documentation.AddRange(gettingstartedDocumentations);

            DemoInfo dataBinding = new DemoInfo()
            {
                Name          = "Data Binding",
                Category      = "Getting Started",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases to binding any business event object to the scheduler items source using the property mapping concept.",
                DemoView      = typeof(DataBinding),
                ShowInfoPanel = true
            };

            List <Documentation> dataBindingDocumentations = new List <Documentation>();

            dataBindingDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            dataBindingDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Data Binding Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/appointments#creating-business-objects")
            });

            dataBinding.Documentation.AddRange(dataBindingDocumentations);

            DemoInfo timelineViews = new DemoInfo()
            {
                Name          = "Timeline views",
                Category      = "Getting Started",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the scheduler timeline day , timeline week , timeline workweek and timeline month views. It also showcases the capabilities of creating recurring appointments on daily, weekly, monthly, and yearly intervals in timeline day, timeline week, timeline workweek and timeline month views, creating the recurrence appointment with exception date and changed occurrence of recurring series appointments and the capabilities of highlighting specific regions in timeslot cells and restricting user interactions such as selection, appointment creations.",
                DemoView      = typeof(TimelineViews),
                ShowInfoPanel = true
            };

            List <Documentation> timelineViewsDocumentations = new List <Documentation>();

            timelineViewsDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            timelineViewsDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Timeline Views Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/timeline-views")
            });

            timelineViews.Documentation.AddRange(timelineViewsDocumentations);

            DemoInfo recursiveAppointment = new DemoInfo()
            {
                Name          = "Recurring Appointments",
                Category      = "Appointments",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the capabilities of creating recurring appointments on daily, weekly, monthly, and yearly intervals in day, week, workweek and month views.",
                DemoView      = typeof(RecurringAppointment),
                ShowInfoPanel = true
            };

            List <Documentation> recursiveAppointmentDocumentations = new List <Documentation>();

            recursiveAppointmentDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            recursiveAppointmentDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Recurring Appointments Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/appointments#recurrence-appointment")
            });

            recursiveAppointment.Documentation.AddRange(recursiveAppointmentDocumentations);

            DemoInfo recursiveAppointmentWithException = new DemoInfo()
            {
                Name          = "Recurrence Exception",
                Category      = "Appointments",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the capabilities of creating the recurrence appointment with exception date and changed occurrence of recurring series appointments.",
                DemoView      = typeof(RecursiveExceptionAppointment),
                ShowInfoPanel = true
            };

            List <Documentation> recursiveAppointmentExceptionDocumentations = new List <Documentation>();

            recursiveAppointmentExceptionDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            recursiveAppointmentExceptionDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Recurring Appointment with Exception Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/appointments#creating-the-recurrence-exceptions-for-schedule-appointment")
            });

            recursiveAppointmentWithException.Documentation.AddRange(recursiveAppointmentExceptionDocumentations);

            DemoInfo loadOnDemandCommand = new DemoInfo()
            {
                Name          = "Load on demand",
                Category      = "Load On Demand",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the appointment on demand loading capability of the scheduler with business event object binding.",
                DemoView      = typeof(LoadOnDemand),
                ShowInfoPanel = true
            };

            List <Documentation> loadOnDemandDocumentations = new List <Documentation>();

            loadOnDemandDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            loadOnDemandDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Load On Demand Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/load-on-demand")
            });

            loadOnDemandCommand.Documentation.AddRange(loadOnDemandDocumentations);

            DemoInfo horizondatalGrouping = new DemoInfo()
            {
                Name          = "Horizontal Grouping",
                Category      = "Resources",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the capabilities to display or group appointments based on the resources in day, week and workweek views.",
                DemoView      = typeof(HorizontalResourceGrouping),
                ShowInfoPanel = true
            };

            List <Documentation> resourceDocumentations = new List <Documentation>();

            resourceDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            resourceDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Resource Grouping Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/resource-grouping")
            });
            horizondatalGrouping.Documentation.AddRange(resourceDocumentations);

            DemoInfo dateWiseGrouping = new DemoInfo()
            {
                Name          = "Date-wise Grouping",
                Category      = "Resources",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the capabilities to display or group appointments based on the dates in day, week and workweek views.",
                DemoView      = typeof(DateWiseResourceGrouping),
                ShowInfoPanel = true
            };

            dateWiseGrouping.Documentation.AddRange(resourceDocumentations);

            DemoInfo timelineGrouping = new DemoInfo()
            {
                Name          = "Timeline Grouping",
                Category      = "Resources",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the capabilities to display or group appointments based on the resources in timeline day, timeline week, timeline workweek and timeline month views.",
                DemoView      = typeof(TimelineResourceGrouping),
                ShowInfoPanel = true,
            };

            timelineGrouping.Documentation.AddRange(resourceDocumentations);

            DemoInfo appointmentCustomization = new DemoInfo()
            {
                Name          = "Appointment",
                Category      = "Customization",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the customization capabilities of the scheduler appointment control.",
                DemoView      = typeof(AppointmentCustomaization),
                ShowInfoPanel = true
            };

            List <Documentation> appointmentCustomizationDocumentations = new List <Documentation>();

            appointmentCustomizationDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            appointmentCustomizationDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Appointment Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/appointments#appearance-customization")
            });

            appointmentCustomization.Documentation.AddRange(appointmentCustomizationDocumentations);

            DemoInfo timeslotCustomization = new DemoInfo()
            {
                Name          = "Time Slot",
                Category      = "Customization",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the capabilities to navigate to specific dates in scheduler views, show or hide time ruler label and header view in the scheduler.",
                DemoView      = typeof(TimeslotCustomization),
                ShowInfoPanel = true
            };

            List <Documentation> timeslotCustomizationDocumentations = new List <Documentation>();

            timeslotCustomizationDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            timeslotCustomizationDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Time Slot Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/day-week-views")
            });

            timeslotCustomization.Documentation.AddRange(timeslotCustomizationDocumentations);

            DemoInfo specialTimeRegionCustomization = new DemoInfo()
            {
                Name          = "Speical Time Region",
                Category      = "Customization",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the capabilities of highlighting specific regions in timeslot cells and restricting user interactions such as selection, appointment creation and customize the appearance of highlighted timeslot cells.",
                DemoView      = typeof(SpecialTimeRegionCustomization),
                ShowInfoPanel = true
            };

            List <Documentation> specialTimeRegionCustomizationDocumentations = new List <Documentation>();

            specialTimeRegionCustomizationDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            specialTimeRegionCustomizationDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - Speical Time Region Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/day-week-views#special-time-region-customization")
            });

            specialTimeRegionCustomization.Documentation.AddRange(specialTimeRegionCustomizationDocumentations);

            DemoInfo fareCalendar = new DemoInfo()
            {
                Name          = "Fare calendar",
                Category      = "Customization",
                DemoType      = DemoTypes.None,
                Description   = "This sample showcases the customization capabilities of a scheduler month cell.",
                DemoView      = typeof(MonthCellCustomization),
                ShowInfoPanel = true
            };

            List <Documentation> fareCalendarDocumentations = new List <Documentation>();

            fareCalendarDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - API Reference Documentation", Uri = new Uri("https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.Scheduler.html")
            });
            fareCalendarDocumentations.Add(new Documentation()
            {
                Content = "Scheduler - MonthCell Customization Documentation", Uri = new Uri("https://help.syncfusion.com/winui/scheduler/month-view#customize-month-cell-appearance")
            });

            fareCalendar.Documentation.AddRange(fareCalendarDocumentations);

            DemoInfo calendarType = new DemoInfo()
            {
                Name          = "Calendar Identifier",
                Category      = "Calendar Types",
                DemoType      = DemoTypes.None,
                Description   = "This example shows how to use the scheduler to set several calendar types such as Gregorian, Korean, Hebrew, and so on.",
                DemoView      = typeof(CalendarIdentifierDemo),
                ShowInfoPanel = false,
            };

            var demos = new List <DemoInfo>()
            {
                gettingstarted,
                dataBinding,
                timelineViews,
                recursiveAppointment,
                recursiveAppointmentWithException,
                calendarType,
                loadOnDemandCommand,
                horizondatalGrouping,
                dateWiseGrouping,
                timelineGrouping,
                appointmentCustomization,
                specialTimeRegionCustomization,
                fareCalendar,
                timeslotCustomization,
            };

            var controlInfo = new ControlInfo()
            {
                Control         = DemoControl.SfScheduler,
                ControlBadge    = ControlBadge.None,
                ControlCategory = ControlCategory.Calendars,
                Description     = "The Scheduler control is used to schedule and manage appointments through an intuitive user interface, similar to the Windows calendar",
                Glyph           = "\uE71a"
            };

            controlInfo.Demos.AddRange(demos);
            DemoHelper.ControlInfos.Add(controlInfo);
        }
コード例 #59
0
ファイル: Program.cs プロジェクト: puremourning/netcoredbg
 public Context(ControlInfo controlInfo, NetcoreDbgTestCore.DebuggerClient debuggerClient)
 {
     ControlInfo    = controlInfo;
     VSCodeDebugger = new VSCodeDebugger(debuggerClient);
 }
コード例 #60
0
ファイル: TimelineEditor.cs プロジェクト: GeertVL/ATF
        /// <summary>
        /// Loads the document at the given URI. Creates a D2dTimelineRenderer and D2dTimelineControl 
        /// (through TimelineDocument's Renderer property) to render and display timelines. 
        /// If isMasterDocument is true and if the file doesn't exist, a new document is created.</summary>
        /// <param name="uri">URI of document to load</param>
        /// <param name="isMasterDocument">True iff is master document</param>
        /// <returns>TimelineDocument loaded</returns>
        private TimelineDocument LoadOrCreateDocument(Uri uri, bool isMasterDocument)
        {
            // Documents need to have a absolute Uri, so that the relative references to sub-documents
            //  are not ambiguous, and so that the FileWatcherService can be used.
            string filePath;
            if (uri.IsAbsoluteUri)
            {
                filePath = uri.LocalPath;
            }
            else if (!isMasterDocument)
            {
                filePath = PathUtil.GetAbsolutePath(uri.OriginalString,
                                                    Path.GetDirectoryName(s_repository.ActiveDocument.Uri.LocalPath));
                uri = new Uri(filePath, UriKind.Absolute);
            }
            else
            {
                filePath = PathUtil.GetAbsolutePath(uri.OriginalString, Directory.GetCurrentDirectory());
                uri = new Uri(filePath, UriKind.Absolute);
            }

            // Check if the repository contains this Uri. Remember that document Uris have to be absolute.
            bool isNewToThisEditor = true;
            DomNode node = null;
            TimelineDocument document = (TimelineDocument)s_repository.GetDocument(uri);

            if (document != null)
            {
                node = document.DomNode;
                isNewToThisEditor = false;
            }
            else if (File.Exists(filePath))
            {
                // read existing document using standard XML reader
                using (FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read))
                {
                    DomXmlReader reader = new DomXmlReader(s_schemaLoader);
                    node = reader.Read(stream, uri);
                }
            }
            else if (isMasterDocument)
            {
                // create new document by creating a Dom node of the root type defined by the schema
                node = new DomNode(Schema.timelineType.Type, Schema.timelineRootElement);
            }

            if (node != null)
            {
                if (document == null)
                {
                    document = node.Cast<TimelineDocument>();

                    D2dTimelineRenderer renderer = CreateTimelineRenderer();
                    document.Renderer = renderer;
                    renderer.Init(document.TimelineControl.D2dGraphics);

                    string fileName = Path.GetFileName(filePath);
                    ControlInfo controlInfo = new ControlInfo(fileName, filePath, StandardControlGroup.Center);

                    //Set IsDocument to true to prevent exception in command service if two files with the
                    //  same name, but in different directories, are opened.
                    controlInfo.IsDocument = true;

                    TimelineContext timelineContext = document.Cast<TimelineContext>();
                    timelineContext.ControlInfo = controlInfo;

                    document.Uri = uri;

                    if (isMasterDocument)
                        s_repository.ActiveDocument = document;//adds 'document'
                    else
                    {
                        // For sub-documents, we want ActiveDocument to remain the main document so that
                        //  TimelineValidator can identify if a sub-document or master document is being
                        //  modified.
                        IDocument previous = s_repository.ActiveDocument;
                        s_repository.ActiveDocument = document;//adds 'document'
                        s_repository.ActiveDocument = previous;//restores master document
                    }
                }

                IHierarchicalTimeline hierarchical = document.Timeline as IHierarchicalTimeline;
                if (hierarchical != null)
                {
                    ResolveAll(hierarchical, new HashSet<IHierarchicalTimeline>());
                }

                // Listen to events if this is the first time we've seen this.
                if (isNewToThisEditor)
                {
                    // The master document/context needs to listen to events on any sub-document
                    //  so that transactions can be cancelled correctly.
                    if (isMasterDocument)
                    {
                        node.AttributeChanging += DomNode_AttributeChanging;
                    }
                    else
                    {
                        DomNode masterNode = s_repository.ActiveDocument.As<DomNode>();
                        node.SubscribeToEvents(masterNode);
                    }
                }

                // Initialize Dom extensions now that the data is complete
                node.InitializeExtensions();
            }

            return document;
        }