예제 #1
0
        protected override emBusiCallbackResult_t InnerOnUIEvtHandle(IUIService iUI, UIEventArg argUIEvent)
        {
            Debug.Assert(null != iUI && null != argUIEvent);

            emBusiCallbackResult_t result = base.InnerOnUIEvtHandle(iUI, argUIEvent);

            if (emBusiCallbackResult_t.Swallowd == result)
            {
                return(result);
            }

            try
            {
                if (argUIEvent.EventName == UIEventNames.s_ClickEvent)
                {
                    if (null != argUIEvent.Key)
                    {
                        Log.Action.LogInfoFormat("UI event: the key {0}({1}) pressed", argUIEvent.ElementName, argUIEvent.Key);
                    }
                    return(emBusiCallbackResult_t.Swallowd);
                }
            }
            catch (System.Exception ex)
            {
                Log.Action.LogError(ex.Message, ex);
            }

            return(emBusiCallbackResult_t.Bypass);
        }
        public RenameRuleObjectDialog(IServiceProvider serviceProvider, string oldName, NameValidatorDelegate nameValidator, BasicBrowserDialog parent)
        {
            if (oldName == null)
            {
                throw (new ArgumentNullException("oldName"));
            }
            if (serviceProvider == null)
            {
                throw (new ArgumentNullException("serviceProvider"));
            }
            if (nameValidator == null)
            {
                throw (new ArgumentNullException("nameValidator"));
            }

            this.serviceProvider = serviceProvider;
            this.name            = oldName;
            this.nameValidator   = nameValidator;
            this.parent          = parent;
            InitializeComponent();

            this.ruleNameTextBox.Text = oldName;
            this.Text = parent.RenameTitleText;
            this.newNamelabel.Text = parent.NewNameLabelText;

            this.Icon = null;

            //Set dialog fonts
            IUIService uisvc = (IUIService)this.serviceProvider.GetService(typeof(IUIService));

            if (uisvc != null)
            {
                this.Font = (Font)uisvc.Styles["DialogFont"];
            }
        }
        /// <summary>
        /// Called when the frame is created
        /// </summary>
        /// <param name="e"></param>
        protected override void OnFrameCreated(EventArgs e)
        {
            base.OnFrameCreated(e);

            ToolWindowHost.CommandContext  = AnkhId.SccExplorerContextGuid;
            ToolWindowHost.KeyboardContext = AnkhId.SccExplorerContextGuid;

            folderTree.Context = Context;
            fileList.Context   = Context;

            VSCommandHandler.Install(Context, this, AnkhCommand.ExplorerUp, OnUp, OnUpdateUp);
            VSCommandHandler.Install(Context, this, AnkhCommand.Refresh, OnRefresh, OnUpdateRefresh);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Open), OnOpen, OnUpdateOpen);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Delete), OnDelete, OnUpdateDelete);
            VSCommandHandler.Install(Context, this, new CommandID(VSConstants.GUID_VSStandardCommandSet97, (int)VSConstants.VSStd97CmdID.Rename), OnRename, OnUpdateRename);

            AnkhServiceEvents environment = Context.GetService <AnkhServiceEvents>();

            // The Workingcopy explorer is a singleton toolwindow (Will never be destroyed unless VS closes)
            environment.SolutionClosed += OnSolutionClosed;
            environment.SolutionOpened += OnSolutionOpened;

            IUIService ui = Context.GetService <IUIService>();

            if (ui != null)
            {
                ToolStripRenderer renderer = ui.Styles["VsToolWindowRenderer"] as ToolStripRenderer;

                if (renderer != null)
                {
                    foldersStrip.Renderer = renderer;
                }
            }
        }
예제 #4
0
        protected BasicBrowserDialog(Activity activity, string name)
        {
            if (activity == null)
            {
                throw (new ArgumentNullException("activity"));
            }

            this.activity = activity;

            InitializeComponent();

            // set captions
            this.descriptionLabel.Text = DescriptionText;
            this.Text = TitleText;
            this.previewLabel.Text = PreviewLabelText;

            this.newRuleToolStripButton.Enabled = true;
            this.name = name;

            serviceProvider = activity.Site;

            //Set dialog fonts
            IUIService uisvc = (IUIService)activity.Site.GetService(typeof(IUIService));

            if (uisvc != null)
            {
                this.Font = (Font)uisvc.Styles["DialogFont"];
            }

            HelpRequested     += new HelpEventHandler(OnHelpRequested);
            HelpButtonClicked += new CancelEventHandler(OnHelpClicked);

            this.rulesListView.Select();
        }
예제 #5
0
        public VersioningService(IUIService uiService, IHashService hashService, IFileService fileService)
        {
            this.uiService   = uiService;
            this.hashService = hashService;

            InitVersionStoreFile();
        }
예제 #6
0
        public CancellationToken Start(IServiceContainer services, JsonRpc vscode)
        {
            _ui        = services.GetService <IUIService>();
            _telemetry = services.GetService <ITelemetryService>();
            _vscode    = vscode;

            _server.OnLogMessage           += OnLogMessage;
            _server.OnShowMessage          += OnShowMessage;
            _server.OnTelemetry            += OnTelemetry;
            _server.OnPublishDiagnostics   += OnPublishDiagnostics;
            _server.OnApplyWorkspaceEdit   += OnApplyWorkspaceEdit;
            _server.OnRegisterCapability   += OnRegisterCapability;
            _server.OnUnregisterCapability += OnUnregisterCapability;

            _disposables
            .Add(() => _server.OnLogMessage           -= OnLogMessage)
            .Add(() => _server.OnShowMessage          -= OnShowMessage)
            .Add(() => _server.OnTelemetry            -= OnTelemetry)
            .Add(() => _server.OnPublishDiagnostics   -= OnPublishDiagnostics)
            .Add(() => _server.OnApplyWorkspaceEdit   -= OnApplyWorkspaceEdit)
            .Add(() => _server.OnRegisterCapability   -= OnRegisterCapability)
            .Add(() => _server.OnUnregisterCapability -= OnUnregisterCapability);

            return(_sessionTokenSource.Token);
        }
예제 #7
0
        protected Sample(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            // Get services from the global service container.
              var services = (ServiceContainer)ServiceLocator.Current;
              SampleFramework = services.GetInstance<SampleFramework>();
              ContentManager = services.GetInstance<ContentManager>();
              UIContentManager = services.GetInstance<ContentManager>("UIContent");
              InputService = services.GetInstance<IInputService>();
              AnimationService = services.GetInstance<IAnimationService>();
              Simulation = services.GetInstance<Simulation>();
              ParticleSystemService = services.GetInstance<IParticleSystemService>();
              GraphicsService = services.GetInstance<IGraphicsService>();
              GameObjectService = services.GetInstance<IGameObjectService>();
              UIService = services.GetInstance<IUIService>();

              // Create a local service container which can be modified in samples:
              // The local service container is a child container, i.e. it inherits the
              // services of the global service container. Samples can add new services
              // or override existing entries without affecting the global services container
              // or other samples.
              Services = services.CreateChildContainer();

              // Store a copy of the original graphics screens.
              _originalGraphicsScreens = GraphicsService.Screens.ToArray();

              // Mouse is visible by default.
              SampleFramework.IsMouseVisible = true;
        }
예제 #8
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            IntPtr focus = UnsafeNativeMethods.GetFocus();

            try
            {
                ICom2PropertyPageDisplayService service = (ICom2PropertyPageDisplayService)provider.GetService(typeof(ICom2PropertyPageDisplayService));
                if (service == null)
                {
                    service = this;
                }
                object instance = context.Instance;
                if (!instance.GetType().IsArray)
                {
                    instance = this.propDesc.TargetObject;
                    if (instance is ICustomTypeDescriptor)
                    {
                        instance = ((ICustomTypeDescriptor)instance).GetPropertyOwner(this.propDesc);
                    }
                }
                service.ShowPropertyPage(this.propDesc.Name, instance, this.propDesc.DISPID, this.guid, focus);
            }
            catch (Exception exception)
            {
                if (provider != null)
                {
                    IUIService service2 = (IUIService)provider.GetService(typeof(IUIService));
                    if (service2 != null)
                    {
                        service2.ShowError(exception, System.Windows.Forms.SR.GetString("ErrorTypeConverterFailed"));
                    }
                }
            }
            return(value);
        }
예제 #9
0
            public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
            {
                if (value is Exception except)
                {
                    IUIService uis = null;

                    if (context != null)
                    {
                        uis = (IUIService)context.GetService(typeof(IUIService));
                    }

                    if (uis != null)
                    {
                        uis.ShowError(except);
                    }
                    else
                    {
                        string message = except.Message;
                        if (message == null || message.Length == 0)
                        {
                            message = except.ToString();
                        }

                        RTLAwareMessageBox.Show(null, message, SR.PropertyGridExceptionInfo,
                                                MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0);
                    }
                }
                return(value);
            }
예제 #10
0
    /// <summary>
    /// Initializes a new instance of the <see cref="GuiGraphicsScreen"/> class.
    /// </summary>
    /// <param name="services">The service locator.</param>
    public GuiGraphicsScreen(IServiceLocator services)
      : base(services.GetInstance<IGraphicsService>())
    {
      Name = "GUI"; // Just for debugging.

      // Get required services.
      _inputService = services.GetInstance<IInputService>();
      _uiService = services.GetInstance<IUIService>();
      var contentManager = services.GetInstance<ContentManager>("UIContent");

      // Load a UI theme and create the UI renderer and the UI screen. See the
      // DigitalRune Game UI documentation and samples for more details.
      var theme = contentManager.Load<Theme>("UI Themes/BlendBlue/Theme");
      var renderer = new UIRenderer(GraphicsService.GraphicsDevice, theme);
      UIScreen = new UIScreen("Default", renderer)
      {
        Background = Color.Transparent,
        ZIndex = int.MaxValue,
      };
      _uiService.Screens.Add(UIScreen);

      // When the background is hidden, the UIScreen should block all input.
      UIScreen.InputProcessed += (s, e) =>
                                 {
                                   if (HideBackground)
                                   {
                                     // Set all input devices to 'handled'.
                                     _inputService.IsGamePadHandled(LogicalPlayerIndex.Any);
                                     _inputService.IsKeyboardHandled = true;
                                     _inputService.IsMouseOrTouchHandled = true;
                                   }
                                 };
    }
예제 #11
0
 /// <include file='doc\QueuePathDialog.uex' path='docs/doc[@for="QueuePathDialog.QueuePathDialog"]/*' />
 /// <devdoc>
 ///     Creates a path editor control.
 ///     This will create also a tree view control, and an ImageList with
 ///     the icons.
 /// </devdoc>                     
 public QueuePathDialog(IServiceProvider provider)
     : base()
 {
     this.uiService = (IUIService)provider.GetService(typeof(IUIService));
     this.provider = provider;
     this.InitializeComponent();
 }
예제 #12
0
        /// <summary>
        /// Gets the mask property value from the MaskDesignerDialog.
        /// The IUIService is used to show the mask designer dialog within VS so it doesn't get blocked if focus
        /// is moved to another app.
        /// </summary>
        internal static string EditMask(ITypeDiscoveryService discoverySvc, IUIService uiSvc, MaskedTextBox instance, IHelpService helpService)
        {
            Debug.Assert(instance != null, "Null masked text box.");
            string mask = null;

            // Launching modal dialog in System aware mode.
            MaskDesignerDialog dlg = DpiHelper.CreateInstanceInSystemAwareContext(() => new MaskDesignerDialog(instance, helpService));

            try
            {
                dlg.DiscoverMaskDescriptors(discoverySvc);  // fine if service is null.

                // Show dialog from VS.
                DialogResult dlgResult = uiSvc != null?uiSvc.ShowDialog(dlg) : dlg.ShowDialog();

                if (dlgResult == DialogResult.OK)
                {
                    mask = dlg.Mask;

                    // ValidatingType is not browsable so we don't need to set the property through the designer.
                    if (dlg.ValidatingType != instance.ValidatingType)
                    {
                        instance.ValidatingType = dlg.ValidatingType;
                    }
                }
            }
            finally
            {
                dlg.Dispose();
            }

            // Will return null if dlgResult != OK.
            return(mask);
        }
예제 #13
0
            /// <devdoc>
            ///     Override to GetService so we can route requests
            ///     to the package's service provider.
            /// </devdoc>
            protected override object GetService(Type serviceType) {
                if (serviceType == null) {
                    throw new ArgumentNullException("serviceType");
                }
                if (_provider != null) {
                    if (serviceType.IsEquivalentTo(typeof(AmbientProperties))) {
                        if (_uis == null) {
                            _uis = (IUIService)_provider.GetService(typeof(IUIService));
                        }
                        if (_ambientProperties == null) {
                            _ambientProperties = new AmbientProperties();
                        }
                        if (_uis != null) {
                            // update the _ambientProperties in case the styles have changed
                            // since last time.
                            _ambientProperties.Font = (Font)_uis.Styles["DialogFont"];
                        }
                        return _ambientProperties;
                    }
                    object service = _provider.GetService(serviceType);

                    if (service != null) {
                        return service;
                    }
                }
                return base.GetService(serviceType);
            }
예제 #14
0
        internal Type ResolveType()
        {
            if (type != null)
            {
                return(type);
            }

            string typeString = typeName;

            if (!String.IsNullOrEmpty(assemblyName))
            {
                typeString = string.Concat(typeString, ", ", assemblyName);
            }
            type = Type.GetType(typeString, false);
            if (type == null)
            {
                IUIService   uiService    = ServiceHelper.GetUIService(Site);
                DialogResult dialogResult = uiService.ShowMessage(string.Format(Resources.ResolveTypeManuallyMessage, typeName), Resources.ResolveTypeManuallyCaption, System.Windows.Forms.MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    using (TypeSelectorUI typeSelector = new TypeSelectorUI(typeof(object), typeof(object), TypeSelectorIncludes.AbstractTypes))
                    {
                        if (DialogResult.OK == typeSelector.ShowDialog())
                        {
                            type = typeSelector.SelectedType;
                        }
                    }
                }
            }

            return(type);
        }
예제 #15
0
 private void ShowHelp()
 {
     if (serviceProvider != null)
     {
         IHelpService helpService = serviceProvider.GetService(typeof(IHelpService)) as IHelpService;
         if (helpService != null)
         {
             helpService.ShowHelpFromKeyword(this.GetType().FullName + ".UI");
         }
         else
         {
             IUIService uisvc = serviceProvider.GetService(typeof(IUIService)) as IUIService;
             if (uisvc != null)
             {
                 uisvc.ShowError(Messages.NoHelp);
             }
         }
     }
     else
     {
         IUIService uisvc = (IUIService)GetService(typeof(IUIService));
         if (uisvc != null)
         {
             uisvc.ShowError(Messages.NoHelp);
         }
     }
 }
예제 #16
0
 public ShowResultsViewModel(ExperimentStatusViewModel st, string sharedDirectory, ExperimentManager manager,
                             AzureExperimentManagerViewModel managerVm, ExperimentListViewModel experimentsVm, RecentValuesStorage recentValues, IUIService uiService)
 {
     if (manager == null)
     {
         throw new ArgumentNullException("manager");
     }
     if (managerVm == null)
     {
         throw new ArgumentNullException(nameof(managerVm));
     }
     if (uiService == null)
     {
         throw new ArgumentNullException("uiService");
     }
     if (experimentsVm == null)
     {
         throw new ArgumentNullException(nameof(experimentsVm));
     }
     this.manager               = manager;
     this.managerVm             = managerVm;
     this.experimentsVm         = experimentsVm;
     this.uiService             = uiService;
     this.statusVm              = st;
     this.id                    = st.ID;
     this.sharedDirectory       = sharedDirectory;
     this.benchmarkTimeout      = st.Definition.BenchmarkTimeout;
     this.jobStatus             = ExperimentExecutionStateVM.Loading;
     this.benchmarkContainerUri = st.Definition.BenchmarkContainerUri;
     this.recentValues          = recentValues;
     RefreshResultsAsync();
 }
예제 #17
0
        private bool EditMenuItemsChangeCallback(object context)
        {
            bool                    changed       = false;
            DeluxeTree              oControl      = (DeluxeTree)Component;
            IServiceProvider        site          = oControl.Site;
            IComponentChangeService changeService = null;

            try
            {
                DeluxeTreeItemsEditorForm oEditorForm = new DeluxeTreeItemsEditorForm(oControl);
                if (site != null)
                {
                    IUIService service = (IUIService)site.GetService(typeof(IUIService));
                    if (service != null)
                    {
                        if (service.ShowDialog(oEditorForm) == DialogResult.OK)
                        {
                            changed = true;
                        }
                    }
                }
            }
            finally
            {
                if (changed && changeService != null)
                {
                    changeService.OnComponentChanged(oControl, null, null, null);
                }
            }
            return(changed);
        }
예제 #18
0
        public EditorBase(Microsoft.Xna.Framework.Game game)
            : base(game)
        {
            // Get services from the global service container.
            var services = (ServiceContainer)ServiceLocator.Current;
            UIContentManager = services.GetInstance<ContentManager>("UIContent");
            InputService = services.GetInstance<IInputService>();
            AnimationService = services.GetInstance<IAnimationService>();
            GraphicsService = services.GetInstance<IGraphicsService>();
            GameObjectService = services.GetInstance<IGameObjectService>();
            UIService = services.GetInstance<IUIService>();

            // Create a local service container which can be modified in samples:
            // The local service container is a child container, i.e. it inherits the
            // services of the global service container. Samples can add new services
            // or override existing entries without affecting the global services container
            // or other samples.
            Services = services.CreateChildContainer();

            // Load a UI theme, which defines the appearance and default values of UI controls.
            Theme theme = UIContentManager.Load<Theme>("BlendBlue/Theme");

            FigureRenderer = new FigureRenderer(GraphicsService, 2000);
            DebugRenderer = new DebugRenderer(GraphicsService, UIContentManager.Load<SpriteFont>("BlendBlue/Default"));
            UIRenderer = new UIRenderer(GraphicsService.GraphicsDevice, theme);

            UIScreen = new UIScreen("Main Screen", UIRenderer)
            {
                Background = Color.TransparentBlack,
            };

            UIService.Screens.Add(UIScreen);

            Scene = new Scene();
        }
예제 #19
0
 internal DataGridAutoFormatDialog(DataGrid dgrid)
 {
     this.dgrid         = dgrid;
     base.ShowInTaskbar = false;
     dataSet.Locale     = CultureInfo.InvariantCulture;
     dataSet.ReadXmlSchema(new XmlTextReader(new StringReader("<xsd:schema id=\"pulica\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\"><xsd:element name=\"Scheme\"><xsd:complexType><xsd:all><xsd:element name=\"SchemeName\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"SchemePicture\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"BorderStyle\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"FlatMode\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"Font\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"CaptionFont\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"HeaderFont\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"AlternatingBackColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"BackColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"BackgroundColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"CaptionForeColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"CaptionBackColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"ForeColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"GridLineColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"GridLineStyle\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"HeaderBackColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"HeaderForeColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"LinkColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"LinkHoverColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"ParentRowsBackColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"ParentRowsForeColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"SelectionForeColor\" minOccurs=\"0\" type=\"xsd:string\"/><xsd:element name=\"SelectionBackColor\" minOccurs=\"0\" type=\"xsd:string\"/></xsd:all></xsd:complexType></xsd:element></xsd:schema>")));
     dataSet.ReadXml(new StringReader("<pulica><Scheme><SchemeName>Default</SchemeName><SchemePicture>default.bmp</SchemePicture><BorderStyle></BorderStyle><FlatMode></FlatMode><CaptionFont></CaptionFont><Font></Font><HeaderFont></HeaderFont><AlternatingBackColor></AlternatingBackColor><BackColor></BackColor><CaptionForeColor></CaptionForeColor><CaptionBackColor></CaptionBackColor><ForeColor></ForeColor><GridLineColor></GridLineColor><GridLineStyle></GridLineStyle><HeaderBackColor></HeaderBackColor><HeaderForeColor></HeaderForeColor><LinkColor></LinkColor><LinkHoverColor></LinkHoverColor><ParentRowsBackColor></ParentRowsBackColor><ParentRowsForeColor></ParentRowsForeColor><SelectionForeColor></SelectionForeColor><SelectionBackColor></SelectionBackColor></Scheme><Scheme><SchemeName>Professional 1</SchemeName><SchemePicture>professional1.bmp</SchemePicture><CaptionFont>Verdana, 10pt</CaptionFont><AlternatingBackColor>LightGray</AlternatingBackColor><CaptionForeColor>Navy</CaptionForeColor><CaptionBackColor>White</CaptionBackColor><ForeColor>Black</ForeColor><BackColor>DarkGray</BackColor><GridLineColor>Black</GridLineColor><GridLineStyle>None</GridLineStyle><HeaderBackColor>Silver</HeaderBackColor><HeaderForeColor>Black</HeaderForeColor><LinkColor>Navy</LinkColor><LinkHoverColor>Blue</LinkHoverColor><ParentRowsBackColor>White</ParentRowsBackColor><ParentRowsForeColor>Black</ParentRowsForeColor><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>Navy</SelectionBackColor></Scheme><Scheme><SchemeName>Professional 2</SchemeName><SchemePicture>professional2.bmp</SchemePicture><BorderStyle>FixedSingle</BorderStyle><FlatMode>True</FlatMode><CaptionFont>Tahoma, 8pt</CaptionFont><AlternatingBackColor>Gainsboro</AlternatingBackColor><BackColor>Silver</BackColor><CaptionForeColor>White</CaptionForeColor><CaptionBackColor>DarkSlateBlue</CaptionBackColor><ForeColor>Black</ForeColor><GridLineColor>White</GridLineColor><HeaderBackColor>DarkGray</HeaderBackColor><HeaderForeColor>Black</HeaderForeColor><LinkColor>DarkSlateBlue</LinkColor><LinkHoverColor>RoyalBlue</LinkHoverColor><ParentRowsBackColor>Black</ParentRowsBackColor><ParentRowsForeColor>White</ParentRowsForeColor><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>DarkSlateBlue</SelectionBackColor></Scheme><Scheme><SchemeName>Professional 3</SchemeName><SchemePicture>professional3.bmp</SchemePicture><BorderStyle>None</BorderStyle><FlatMode>True</FlatMode><CaptionFont>Tahoma, 8pt, style=1</CaptionFont><HeaderFont>Tahoma, 8pt, style=1</HeaderFont><Font>Tahoma, 8pt</Font><AlternatingBackColor>LightGray</AlternatingBackColor><BackColor>Gainsboro</BackColor><BackgroundColor>Silver</BackgroundColor><CaptionForeColor>MidnightBlue</CaptionForeColor><CaptionBackColor>LightSteelBlue</CaptionBackColor><ForeColor>Black</ForeColor><GridLineColor>DimGray</GridLineColor><GridLineStyle>None</GridLineStyle><HeaderBackColor>MidnightBlue</HeaderBackColor><HeaderForeColor>White</HeaderForeColor><LinkColor>MidnightBlue</LinkColor><LinkHoverColor>RoyalBlue</LinkHoverColor><ParentRowsBackColor>DarkGray</ParentRowsBackColor><ParentRowsForeColor>Black</ParentRowsForeColor><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>CadetBlue</SelectionBackColor></Scheme><Scheme><SchemeName>Professional 4</SchemeName><SchemePicture>professional4.bmp</SchemePicture><BorderStyle>None</BorderStyle><FlatMode>True</FlatMode><CaptionFont>Tahoma, 8pt, style=1</CaptionFont><HeaderFont>Tahoma, 8pt, style=1</HeaderFont><Font>Tahoma, 8pt</Font><AlternatingBackColor>Lavender</AlternatingBackColor><BackColor>WhiteSmoke</BackColor><BackgroundColor>LightGray</BackgroundColor><CaptionForeColor>MidnightBlue</CaptionForeColor><CaptionBackColor>LightSteelBlue</CaptionBackColor><ForeColor>MidnightBlue</ForeColor><GridLineColor>Gainsboro</GridLineColor><GridLineStyle>None</GridLineStyle><HeaderBackColor>MidnightBlue</HeaderBackColor><HeaderForeColor>WhiteSmoke</HeaderForeColor><LinkColor>Teal</LinkColor><LinkHoverColor>DarkMagenta</LinkHoverColor><ParentRowsBackColor>Gainsboro</ParentRowsBackColor><ParentRowsForeColor>MidnightBlue</ParentRowsForeColor><SelectionForeColor>WhiteSmoke</SelectionForeColor><SelectionBackColor>CadetBlue</SelectionBackColor></Scheme><Scheme><SchemeName>Classic</SchemeName><SchemePicture>classic.bmp</SchemePicture><BorderStyle>FixedSingle</BorderStyle><FlatMode>True</FlatMode><Font>Times New Roman, 9pt</Font><HeaderFont>Tahoma, 8pt, style=1</HeaderFont><CaptionFont>Tahoma, 8pt, style=1</CaptionFont><AlternatingBackColor>WhiteSmoke</AlternatingBackColor><BackColor>Gainsboro</BackColor><BackgroundColor>DarkGray</BackgroundColor><CaptionForeColor>Black</CaptionForeColor><CaptionBackColor>DarkKhaki</CaptionBackColor><ForeColor>Black</ForeColor><GridLineColor>Silver</GridLineColor><HeaderBackColor>Black</HeaderBackColor><HeaderForeColor>White</HeaderForeColor><LinkColor>DarkSlateBlue</LinkColor><LinkHoverColor>Firebrick</LinkHoverColor><ParentRowsForeColor>Black</ParentRowsForeColor><ParentRowsBackColor>LightGray</ParentRowsBackColor><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>Firebrick</SelectionBackColor></Scheme><Scheme><SchemeName>Simple</SchemeName><SchemePicture>Simple.bmp</SchemePicture><BorderStyle>FixedSingle</BorderStyle><FlatMode>True</FlatMode><Font>Courier New, 9pt</Font><HeaderFont>Courier New, 10pt, style=1</HeaderFont><CaptionFont>Courier New, 10pt, style=1</CaptionFont><AlternatingBackColor>White</AlternatingBackColor><BackColor>White</BackColor><BackgroundColor>Gainsboro</BackgroundColor><CaptionForeColor>Black</CaptionForeColor><CaptionBackColor>Silver</CaptionBackColor><ForeColor>DarkSlateGray</ForeColor><GridLineColor>DarkGray</GridLineColor><HeaderBackColor>DarkGreen</HeaderBackColor><HeaderForeColor>White</HeaderForeColor><LinkColor>DarkGreen</LinkColor><LinkHoverColor>Blue</LinkHoverColor><ParentRowsForeColor>Black</ParentRowsForeColor><ParentRowsBackColor>Gainsboro</ParentRowsBackColor><SelectionForeColor>Black</SelectionForeColor><SelectionBackColor>DarkSeaGreen</SelectionBackColor></Scheme><Scheme><SchemeName>Colorful 1</SchemeName><SchemePicture>colorful1.bmp</SchemePicture><BorderStyle>FixedSingle</BorderStyle><FlatMode>True</FlatMode><Font>Tahoma, 8pt</Font><CaptionFont>Tahoma, 9pt, style=1</CaptionFont><HeaderFont>Tahoma, 9pt, style=1</HeaderFont><AlternatingBackColor>LightGoldenrodYellow</AlternatingBackColor><BackColor>White</BackColor><BackgroundColor>LightGoldenrodYellow</BackgroundColor><CaptionForeColor>DarkSlateBlue</CaptionForeColor><CaptionBackColor>LightGoldenrodYellow</CaptionBackColor><ForeColor>DarkSlateBlue</ForeColor><GridLineColor>Peru</GridLineColor><GridLineStyle>None</GridLineStyle><HeaderBackColor>Maroon</HeaderBackColor><HeaderForeColor>LightGoldenrodYellow</HeaderForeColor><LinkColor>Maroon</LinkColor><LinkHoverColor>SlateBlue</LinkHoverColor><ParentRowsBackColor>BurlyWood</ParentRowsBackColor><ParentRowsForeColor>DarkSlateBlue</ParentRowsForeColor><SelectionForeColor>GhostWhite</SelectionForeColor><SelectionBackColor>DarkSlateBlue</SelectionBackColor></Scheme><Scheme><SchemeName>Colorful 2</SchemeName><SchemePicture>colorful2.bmp</SchemePicture><BorderStyle>None</BorderStyle><FlatMode>True</FlatMode><Font>Tahoma, 8pt</Font><CaptionFont>Tahoma, 8pt, style=1</CaptionFont><HeaderFont>Tahoma, 8pt, style=1</HeaderFont><AlternatingBackColor>GhostWhite</AlternatingBackColor><BackColor>GhostWhite</BackColor><BackgroundColor>Lavender</BackgroundColor><CaptionForeColor>White</CaptionForeColor><CaptionBackColor>RoyalBlue</CaptionBackColor><ForeColor>MidnightBlue</ForeColor><GridLineColor>RoyalBlue</GridLineColor><HeaderBackColor>MidnightBlue</HeaderBackColor><HeaderForeColor>Lavender</HeaderForeColor><LinkColor>Teal</LinkColor><LinkHoverColor>DodgerBlue</LinkHoverColor><ParentRowsBackColor>Lavender</ParentRowsBackColor><ParentRowsForeColor>MidnightBlue</ParentRowsForeColor><SelectionForeColor>PaleGreen</SelectionForeColor><SelectionBackColor>Teal</SelectionBackColor></Scheme><Scheme><SchemeName>Colorful 3</SchemeName><SchemePicture>colorful3.bmp</SchemePicture><BorderStyle>None</BorderStyle><FlatMode>True</FlatMode><Font>Tahoma, 8pt</Font><CaptionFont>Tahoma, 8pt, style=1</CaptionFont><HeaderFont>Tahoma, 8pt, style=1</HeaderFont><AlternatingBackColor>OldLace</AlternatingBackColor><BackColor>OldLace</BackColor><BackgroundColor>Tan</BackgroundColor><CaptionForeColor>OldLace</CaptionForeColor><CaptionBackColor>SaddleBrown</CaptionBackColor><ForeColor>DarkSlateGray</ForeColor><GridLineColor>Tan</GridLineColor><GridLineStyle>Solid</GridLineStyle><HeaderBackColor>Wheat</HeaderBackColor><HeaderForeColor>SaddleBrown</HeaderForeColor><LinkColor>DarkSlateBlue</LinkColor><LinkHoverColor>Teal</LinkHoverColor><ParentRowsBackColor>OldLace</ParentRowsBackColor><ParentRowsForeColor>DarkSlateGray</ParentRowsForeColor><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>SlateGray</SelectionBackColor></Scheme><Scheme><SchemeName>Colorful 4</SchemeName><SchemePicture>colorful4.bmp</SchemePicture><BorderStyle>FixedSingle</BorderStyle><FlatMode>True</FlatMode><Font>Tahoma, 8pt</Font><CaptionFont>Tahoma, 8pt, style=1</CaptionFont><HeaderFont>Tahoma, 8pt, style=1</HeaderFont><AlternatingBackColor>White</AlternatingBackColor><BackColor>White</BackColor><BackgroundColor>Ivory</BackgroundColor><CaptionForeColor>Lavender</CaptionForeColor><CaptionBackColor>DarkSlateBlue</CaptionBackColor><ForeColor>Black</ForeColor><GridLineColor>Wheat</GridLineColor><HeaderBackColor>CadetBlue</HeaderBackColor><HeaderForeColor>Black</HeaderForeColor><LinkColor>DarkSlateBlue</LinkColor><LinkHoverColor>LightSeaGreen</LinkHoverColor><ParentRowsBackColor>Ivory</ParentRowsBackColor><ParentRowsForeColor>Black</ParentRowsForeColor><SelectionForeColor>DarkSlateBlue</SelectionForeColor><SelectionBackColor>Wheat</SelectionBackColor></Scheme><Scheme><SchemeName>256 Color 1</SchemeName><SchemePicture>256_1.bmp</SchemePicture><Font>Tahoma, 8pt</Font><CaptionFont>Tahoma, 8 pt</CaptionFont><HeaderFont>Tahoma, 8pt</HeaderFont><AlternatingBackColor>Silver</AlternatingBackColor><BackColor>White</BackColor><CaptionForeColor>White</CaptionForeColor><CaptionBackColor>Maroon</CaptionBackColor><ForeColor>Black</ForeColor><GridLineColor>Silver</GridLineColor><HeaderBackColor>Silver</HeaderBackColor><HeaderForeColor>Black</HeaderForeColor><LinkColor>Maroon</LinkColor><LinkHoverColor>Red</LinkHoverColor><ParentRowsBackColor>Silver</ParentRowsBackColor><ParentRowsForeColor>Black</ParentRowsForeColor><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>Maroon</SelectionBackColor></Scheme><Scheme><SchemeName>256 Color 2</SchemeName><SchemePicture>256_2.bmp</SchemePicture><BorderStyle>FixedSingle</BorderStyle><FlatMode>True</FlatMode><CaptionFont>Microsoft Sans Serif, 10 pt, style=1</CaptionFont><Font>Tahoma, 8pt</Font><HeaderFont>Tahoma, 8pt</HeaderFont><AlternatingBackColor>White</AlternatingBackColor><BackColor>White</BackColor><CaptionForeColor>White</CaptionForeColor><CaptionBackColor>Teal</CaptionBackColor><ForeColor>Black</ForeColor><GridLineColor>Silver</GridLineColor><HeaderBackColor>Black</HeaderBackColor><HeaderForeColor>White</HeaderForeColor><LinkColor>Purple</LinkColor><LinkHoverColor>Fuchsia</LinkHoverColor><ParentRowsBackColor>Gray</ParentRowsBackColor><ParentRowsForeColor>White</ParentRowsForeColor><SelectionForeColor>White</SelectionForeColor><SelectionBackColor>Maroon</SelectionBackColor></Scheme></pulica>"), XmlReadMode.IgnoreSchema);
     schemeTable = dataSet.Tables["Scheme"];
     IMBusy      = true;
     InitializeComponent();
     schemeName.DataSource = schemeTable;
     AddDataToDataGrid();
     AddStyleSheetInformationToDataGrid();
     if (dgrid.Site != null)
     {
         IUIService iUIService = (IUIService)dgrid.Site.GetService(typeof(IUIService));
         if (iUIService != null)
         {
             Font font = (Font)iUIService.Styles["DialogFont"];
             if (font != null)
             {
                 Font = font;
             }
         }
     }
     IMBusy = false;
 }
        public CancellationToken Start(IServiceContainer services, JsonRpc rpc)
        {
            _services  = services;
            _ui        = services.GetService <IUIService>();
            _telemetry = services.GetService <ITelemetryService>();
            _rpc       = rpc;

            var progress = services.GetService <IProgressService>();

            _server.OnLogMessage           += OnLogMessage;
            _server.OnShowMessage          += OnShowMessage;
            _server.OnTelemetry            += OnTelemetry;
            _server.OnPublishDiagnostics   += OnPublishDiagnostics;
            _server.OnApplyWorkspaceEdit   += OnApplyWorkspaceEdit;
            _server.OnRegisterCapability   += OnRegisterCapability;
            _server.OnUnregisterCapability += OnUnregisterCapability;

            _disposables
            .Add(() => _server.OnLogMessage           -= OnLogMessage)
            .Add(() => _server.OnShowMessage          -= OnShowMessage)
            .Add(() => _server.OnTelemetry            -= OnTelemetry)
            .Add(() => _server.OnPublishDiagnostics   -= OnPublishDiagnostics)
            .Add(() => _server.OnApplyWorkspaceEdit   -= OnApplyWorkspaceEdit)
            .Add(() => _server.OnRegisterCapability   -= OnRegisterCapability)
            .Add(() => _server.OnUnregisterCapability -= OnUnregisterCapability)
            .Add(() => _shutdownCts.Cancel())
            .Add(_prioritizer)
            .Add(() => _pathsWatcher?.Dispose());

            return(_sessionTokenSource.Token);
        }
예제 #21
0
        private void InitUI()
        {
            IUIService uiService = GetService <IUIService>();

            if (uiService != null)
            {
                object color = uiService.Styles["VsColorPanelHyperLink"];

                if (color is Color)
                {
                    addNewLinkLabel.LinkColor = (Color)color;
                }

                color = uiService.Styles["VsColorPanelHyperLinkPressed"];

                if (color is Color)
                {
                    addNewLinkLabel.ActiveLinkColor = (Color)color;
                }
            }

            // Add None node.
            //
            TreeNode node = new TypeNode("None");

            treeView.Nodes.Add(node);
            treeView.SelectedNode = node;
        }
예제 #22
0
        /// <include file='doc\Localizer.uex' path='docs/doc[@for="LocalizationExtenderProvider.SetLanguage"]/*' />
        /// <devdoc>
        ///    <para>Sets the language to use.</para>
        /// </devdoc>
        public void SetLanguage(object o, CultureInfo language)
        {
            if (language == null)
            {
                language = CultureInfo.InvariantCulture;
            }

            if (this.language.Equals(language))
            {
                return;
            }

            bool        isInvariantCulture = (language.Equals(CultureInfo.InvariantCulture));
            CultureInfo defaultUICulture   = this.ThreadDefaultLanguage;

            this.language = language;

            if (!isInvariantCulture)
            {
                SetLocalizable(null, true);
            }


            if (serviceProvider != null)
            {
                IDesignerLoaderService ls   = (IDesignerLoaderService)serviceProvider.GetService(typeof(IDesignerLoaderService));
                IDesignerHost          host = (IDesignerHost)serviceProvider.GetService(typeof(IDesignerHost));



                // Only reload if we're not in the process of loading!
                //
                if (host != null)
                {
                    // If we're loading, adopt the load language for later use.
                    //
                    if (host.Loading)
                    {
                        loadLanguage = language;
                    }
                    else
                    {
                        bool reloadSuccessful = false;
                        if (ls != null)
                        {
                            reloadSuccessful = ls.Reload();
                        }
                        if (!reloadSuccessful)
                        {
                            IUIService uis = (IUIService)serviceProvider.GetService(typeof(IUIService));
                            if (uis != null)
                            {
                                uis.ShowMessage(SR.GetString(SR.LocalizerManualReload));
                            }
                        }
                    }
                }
            }
        }
예제 #23
0
 public WindowsScanningService(SettingsService settings,
                               IOSService os,
                               IUIService ui)
     : base(settings,
            os,
            ui)
 {
 }
예제 #24
0
 public MainMenuComponent(Microsoft.Xna.Framework.Game game, IServiceLocator services)
     : base(game)
 {
     _services        = services;
     _inputService    = services.GetInstance <IInputService>();
     _graphicsService = services.GetInstance <IGraphicsService>();
     _uiService       = services.GetInstance <IUIService>();
 }
예제 #25
0
 public MainMenuComponent(Microsoft.Xna.Framework.Game game, IServiceLocator services)
   : base(game)
 {
   _services = services;
   _inputService = services.GetInstance<IInputService>();
   _graphicsService = services.GetInstance<IGraphicsService>();
   _uiService = services.GetInstance<IUIService>();
 }
예제 #26
0
 public MenuScreen(Microsoft.Xna.Framework.Game game)
     : base()
 {
     _game = (GameManager)game;
     _contentService = (ContentManager)game.Services.GetService(typeof(ContentManager));
     _inputService = (IInputService)game.Services.GetService(typeof(IInputService));
     _uiService = (IUIService)game.Services.GetService(typeof(IUIService));
 }
예제 #27
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="task"></param>
        public void NavigateTask(Task task)
        {
            IUIService uiService = ServiceHelper.GetUIService(serviceProvider);

            ConfigurationNodeTask nodeTask = task as ConfigurationNodeTask;

            uiService.ActivateNode(nodeTask.ConfigurationNode);
        }
예제 #28
0
 public WinFormsCommandInteractionHandler(IUIService uiService)
 {
     if (uiService == null)
     {
         throw new ArgumentNullException("uiService");
     }
     this.uiService = uiService;
 }
예제 #29
0
 public SaveHistoryCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow)
     : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSaveHistory, false)
 {
     _ui = interactiveWorkflow.Shell.UI();
     _interactiveWorkflow = interactiveWorkflow;
     _settings            = _interactiveWorkflow.Shell.GetService <IRSettings>();
     _history             = historyProvider.GetAssociatedRHistory(textView);
 }
예제 #30
0
파일: GameScreen.cs 프로젝트: zunath/Ceriyo
 public GameScreen(IUIService uiService,
                   IUIViewModelFactory vmFactory,
                   GraphicsDevice graphics)
 {
     _uiService = uiService;
     _vmFactory = vmFactory;
     _graphics  = graphics;
 }
예제 #31
0
 public HomeController(ICategoryService categoryService, IUIService uiService, IForumUserService forumUserService, IForumService forumService, ITopicService topicService)
 {
     this.categoryService  = categoryService;
     this.uiService        = uiService;
     this.forumUserService = forumUserService;
     this.forumService     = forumService;
     this.topicService     = topicService;
 }
예제 #32
0
 public QueuePathDialog(IUIService uiService)
 {
     this.path          = string.Empty;
     this.queuePath     = string.Empty;
     this.machinesTable = new Hashtable();
     this.uiService     = uiService;
     this.InitializeComponent();
 }
 /// <summary>Constructrs the <see cref="DriveSelectViewModel"/>.</summary>
 public ConfigureViewModel(SettingsService settings,
                           IUIService ui,
                           IWindowDialogService dialog)
 {
     Settings = settings;
     UI       = ui;
     Dialogs  = dialog;
 }
 public QueuePathDialog(IUIService uiService)
 {
     this.path = string.Empty;
     this.queuePath = string.Empty;
     this.machinesTable = new Hashtable();
     this.uiService = uiService;
     this.InitializeComponent();
 }
예제 #35
0
 public MainWindowVM(IUIService uIService)
 {
     MediaEnded     = new RoutedCommand(ProcessMediaEnded);
     _playProcessor = new PlayProcessor();
     _playProcessor.CurrentVideoSourceChanged += PlayProcessorCurrentVideoSourceChanged;
     _uiService   = uIService;
     LoadSchedule = new SelectFileCommand(uIService, ProcessLoadScheduleFile);
 }
예제 #36
0
        public ExperimentPropertiesViewModel(ExperimentDefinition def, ExperimentStatus status, Domain domain, ExperimentManager manager, IUIService ui)
        {
            if (def == null)
            {
                throw new ArgumentNullException("def");
            }
            if (status == null)
            {
                throw new ArgumentNullException("status");
            }
            if (domain == null)
            {
                throw new ArgumentNullException("domain");
            }
            if (manager == null)
            {
                throw new ArgumentNullException("manager");
            }
            if (ui == null)
            {
                throw new ArgumentNullException("ui");
            }

            this.id         = status.ID;
            this.definition = def;
            this.status     = status;
            this.domain     = domain;
            this.manager    = manager;
            this.ui         = ui;

            currentNote = status.Note;

            isSyncing = true;
            Sync      = new DelegateCommand(async _ =>
            {
                isSyncing = true;
                Sync.RaiseCanExecuteChanged();
                try
                {
                    if (NoteChanged)
                    {
                        await SubmitNote();
                    }
                    await Refresh();
                }
                catch (Exception ex)
                {
                    ui.ShowError(ex, "Failed to synchronize experiment properties");
                }
                finally
                {
                    isSyncing = false;
                    Sync.RaiseCanExecuteChanged();
                }
            },
                                            _ => !isSyncing);
            Initialize();
        }
예제 #37
0
        ExecutionResult IValueGatheringService.Execute(XmlElement data, bool allowSuspend)
        {
            WizardData wizardData = GetWizardConfiguration(data);

            if (wizardData == null)
            {
                throw new System.Configuration.ConfigurationException(
                          Properties.Resources.WizardGatheringService_CannotLoadConfig);
            }
            WizardForm             form    = null;
            AliasResolutionService aliases = null;

            try
            {
                // Setup alias resolution for the current wizard
                aliases = new AliasResolutionService(wizardData.TypeAliases,
                                                     GetService <ITypeResolutionService>(true));
                AddService(typeof(ITypeResolutionService), aliases);

                form = new WizardForm(this, wizardData.WizardConfig);
                // Site the form in our own container.
                Add(form);

                IUIService   uiService = GetService <IUIService>();
                IWin32Window parentWnd = null;
                if (uiService != null)
                {
                    parentWnd = uiService.GetDialogOwnerWindow();
                }
                form.Start(parentWnd);
                return(form.ExecutionResult);
            }
            catch (Exception e)
            {
                string wizardName = "";
                if (wizardData != null && wizardData.WizardConfig != null)
                {
                    wizardName = wizardData.WizardConfig.Name;
                }
                throw new WizardExecutionException(wizardName, e);
            }
            finally
            {
                // Cleanup the service we added temporarily.
                if (aliases != null && aliases == GetService(typeof(ITypeResolutionService)))
                {
                    RemoveService(typeof(ITypeResolutionService));
                }

                // Remove from parent container always.
                if (form != null)
                {
                    Remove(form);
                    form.Dispose();
                    form = null;
                }
            }
        }
 public QueuePathDialog(IServiceProvider provider)
 {
     this.path = string.Empty;
     this.queuePath = string.Empty;
     this.machinesTable = new Hashtable();
     this.uiService = (IUIService) provider.GetService(typeof(IUIService));
     this.provider = provider;
     this.InitializeComponent();
 }
 public MaskedTextBoxDesignerActionList(MaskedTextBoxDesigner designer) : base(designer.Component)
 {
     this.maskedTextBox = (MaskedTextBox) designer.Component;
     this.discoverySvc = base.GetService(typeof(ITypeDiscoveryService)) as ITypeDiscoveryService;
     this.uiSvc = base.GetService(typeof(IUIService)) as IUIService;
     this.helpService = base.GetService(typeof(IHelpService)) as IHelpService;
     if (this.discoverySvc != null)
     {
         IUIService uiSvc = this.uiSvc;
     }
 }
예제 #40
0
    public MyGameComponent(Microsoft.Xna.Framework.Game game, IServiceLocator services)
      : base(game)
    {
      // Get the services that this component needs regularly.
      _services = services;
      _inputService = services.GetInstance<IInputService>();
      _simulation = services.GetInstance<Simulation>();
      _graphicsService = services.GetInstance<IGraphicsService>();
      _gameObjectService = services.GetInstance<IGameObjectService>();
      _uiService = services.GetInstance<IUIService>();

      // Add gravity and damping to the physics simulation.
      _simulation.ForceEffects.Add(new Gravity());
      _simulation.ForceEffects.Add(new Damping());

      // Create the DeferredGraphicsScreen and some 3D objects.
      _deferredGraphicsScreen = new DeferredGraphicsScreen(services);
      _deferredGraphicsScreen.DrawReticle = true;
      _graphicsService.Screens.Insert(0, _deferredGraphicsScreen);

      // The GameObjects below expect try to retrieve DebugRenderer and Scene via
      // service container.
      var serviceContainer = (ServiceContainer)services;
      serviceContainer.Register(typeof(DebugRenderer), null, _deferredGraphicsScreen.DebugRenderer);
      serviceContainer.Register(typeof(IScene), null, _deferredGraphicsScreen.Scene);

      _cameraGameObject = new CameraObject(services);
      _gameObjectService.Objects.Add(_cameraGameObject);
      _deferredGraphicsScreen.ActiveCameraNode = _cameraGameObject.CameraNode;
      _gameObjectService.Objects.Add(new GrabObject(services));
      _gameObjectService.Objects.Add(new StaticSkyObject(services));
      _gameObjectService.Objects.Add(new GroundObject(services));
      for (int i = 0; i < 10; i++)
        _gameObjectService.Objects.Add(new DynamicObject(services, 1));

      // Get the "SampleUI" screen that was created by the StartScreenComponent.
      _uiScreen = _uiService.Screens["SampleUI"];

      // Add a second GraphicsScreen. This time it is a DelegateGraphicsScreen that
      // draws the UI over DeferredGraphicsScreen.
      _delegateGraphicsScreen = new DelegateGraphicsScreen(_graphicsService)
      {
        RenderCallback = context => _uiScreen.Draw(context.DeltaTime)
      };
      _graphicsService.Screens.Insert(1, _delegateGraphicsScreen);

      // Create the game menu window. But do not display it yet.
      _gameMenuWindow = new GameMenuWindow
      {
        // If the menu is opened and closed a lot, it is more efficient when _gameMenuWindow.Close()
        // makes the window invisible but does not remove it from the screen.
        HideOnClose = true,
      };
    }
예제 #41
0
 public CentauriGame(Game game)
     : base(game)
 {
     _inputService = (IInputService)game.Services.GetService(typeof(IInputService));
     _uiService = (IUIService)game.Services.GetService(typeof(IUIService));
     _animationService = (IAnimationService)game.Services.GetService(typeof(IAnimationService));
     _spritebatch = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch));
     _consoleManager = (ConsoleManager)game.Services.GetService(typeof(ConsoleManager));
     _content = (ContentController)game.Services.GetService(typeof(ContentController));
     _eventManager = (EventManager) game.Services.GetService(typeof (EventManager));
 }
        public FavoritesViewModel(INavigationService navigationService, IDataService ds, IUIService uisvc)
        {
            _dataService = ds;
            this._navigationService = navigationService;
            _uiService = uisvc;

            DisplayName = AppResources.Favorites_PageTitle;

            OnStationPicked = (stationId, stationName) => this._navigationService.UriFor<StationInfoPivotPageViewModel>()
                    .WithParam(vm => vm.NavigationStationId, stationId)
                    .Navigate();
        }
        public TypeMemberChooserUI(Type type, IUIService uiService)
		{
			InitializeComponent();

			typeTreeNode = new TypeTreeNode(type);
			ContainerTreeNode propertiesTreeNode = new ContainerTreeNode(MemberChooserResources.PropertiesNode);

			//add properties to the treeview
			foreach (PropertyInfo propertyInfo in type.GetProperties())
			{
                if (propertyInfo.CanRead && propertyInfo.GetIndexParameters().Length == 0)
                {
                    if (!propertiesTreeNode.Nodes.ContainsKey(propertyInfo.Name))
                    {
                        propertiesTreeNode.Nodes.Add(new PropertyTreeNode(propertyInfo));
                    }
                }
			}

			//add methods to the treeview
			ContainerTreeNode methodsTreeNode = new ContainerTreeNode(MemberChooserResources.MethodsNode);
			foreach (MethodInfo methodInfo in type.GetMethods())
			{
				if (!methodInfo.IsSpecialName &&
					methodInfo.GetParameters().Length == 0 &&
					methodInfo.ReturnType != typeof(void))
				{
					if (!methodsTreeNode.Nodes.ContainsKey(methodInfo.Name))
					{
						methodsTreeNode.Nodes.Add(new MethodTreeNode(methodInfo));
					}
				}
			}

			//add methods to the treeview
			ContainerTreeNode fieldsTreeNode = new ContainerTreeNode(MemberChooserResources.FieldsNode);
			foreach (FieldInfo fieldInfo in type.GetFields())
			{
				if (!fieldsTreeNode.Nodes.ContainsKey(fieldInfo.Name))
				{
					fieldsTreeNode.Nodes.Add(new FieldTreeNode(fieldInfo));
				}
			}

			typeTreeNode.Nodes.AddRange(new TreeNode[] { 
                propertiesTreeNode, 
                methodsTreeNode, 
                fieldsTreeNode });

			typeTreeNode.ExpandAll();
			memberTreeView.Nodes.Add(typeTreeNode);
		}
 public DesignerFrame(ISite site)
 {
     this.Text = "DesignerFrame";
     this.designerSite = site;
     this.designerRegion = new OverlayControl(site);
     this.uiService = this.designerSite.GetService(typeof(IUIService)) as IUIService;
     if ((this.uiService != null) && (this.uiService.Styles["ArtboardBackground"] is System.Drawing.Color))
     {
         this.BackColor = (System.Drawing.Color) this.uiService.Styles["ArtboardBackground"];
     }
     base.Controls.Add(this.designerRegion);
     this.designerRegion.AutoScroll = true;
     this.designerRegion.Dock = DockStyle.Fill;
     SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(this.OnUserPreferenceChanged);
 }
예제 #45
0
    public StartScreenComponent(Microsoft.Xna.Framework.Game game, IServiceLocator services)
      : base(game)
    {
      _services = services;
      _inputService = services.GetInstance<IInputService>();
      _graphicsService = services.GetInstance<IGraphicsService>();
      _uiService = _services.GetInstance<IUIService>();

      // Add a GraphicsScreen to draw some text. In a real game we would draw
      // a spectacular start screen image instead.
      _graphicsScreen = new SampleGraphicsScreen(services);
      _graphicsScreen.ClearBackground = true;
      _graphicsService.Screens.Insert(0, _graphicsScreen);

      // Load stuff in a parallel task.
      _loadStuffTask = Parallel.Start(LoadStuff);
    }
 internal static string EditMask(ITypeDiscoveryService discoverySvc, IUIService uiSvc, MaskedTextBox instance, IHelpService helpService)
 {
     string mask = null;
     using (MaskDesignerDialog dialog = new MaskDesignerDialog(instance, helpService))
     {
         dialog.DiscoverMaskDescriptors(discoverySvc);
         DialogResult result = (uiSvc != null) ? uiSvc.ShowDialog(dialog) : dialog.ShowDialog();
         if (result == DialogResult.OK)
         {
             mask = dialog.Mask;
             if (dialog.ValidatingType != instance.ValidatingType)
             {
                 instance.ValidatingType = dialog.ValidatingType;
             }
         }
     }
     return mask;
 }
 public DesignerActionUI(IServiceProvider serviceProvider, Adorner containerAdorner)
 {
     this.serviceProvider = serviceProvider;
     this.designerActionAdorner = containerAdorner;
     this.behaviorService = (BehaviorService) serviceProvider.GetService(typeof(BehaviorService));
     this.menuCommandService = (IMenuCommandService) serviceProvider.GetService(typeof(IMenuCommandService));
     this.selSvc = (ISelectionService) serviceProvider.GetService(typeof(ISelectionService));
     if ((this.behaviorService != null) && (this.selSvc != null))
     {
         this.designerActionService = (DesignerActionService) serviceProvider.GetService(typeof(DesignerActionService));
         if (this.designerActionService == null)
         {
             this.designerActionService = new DesignerActionService(serviceProvider);
             this.disposeActionService = true;
         }
         this.designerActionUIService = (DesignerActionUIService) serviceProvider.GetService(typeof(DesignerActionUIService));
         if (this.designerActionUIService == null)
         {
             this.designerActionUIService = new DesignerActionUIService(serviceProvider);
             this.disposeActionUIService = true;
         }
         this.designerActionUIService.DesignerActionUIStateChange += new DesignerActionUIStateChangeEventHandler(this.OnDesignerActionUIStateChange);
         this.designerActionService.DesignerActionListsChanged += new DesignerActionListsChangedEventHandler(this.OnDesignerActionsChanged);
         this.lastPanelComponent = null;
         IComponentChangeService service = (IComponentChangeService) serviceProvider.GetService(typeof(IComponentChangeService));
         if (service != null)
         {
             service.ComponentChanged += new ComponentChangedEventHandler(this.OnComponentChanged);
         }
         if (this.menuCommandService != null)
         {
             this.cmdShowDesignerActions = new MenuCommand(new EventHandler(this.OnKeyShowDesignerActions), MenuCommands.KeyInvokeSmartTag);
             this.menuCommandService.AddCommand(this.cmdShowDesignerActions);
         }
         this.uiService = (IUIService) serviceProvider.GetService(typeof(IUIService));
         if (this.uiService != null)
         {
             this.mainParentWindow = this.uiService.GetDialogOwnerWindow();
         }
         this.componentToGlyph = new Hashtable();
         this.marshalingControl = new Control();
         this.marshalingControl.CreateControl();
     }
 }
예제 #48
0
        internal static IShapeDescriptor EditShape(IUIService uiService, object instance, IHelpService helpService, object currentValue)
        {
#if FRAMEWORK20
            ShapeEditorForm editor = new ShapeEditorForm();
            editor.Value = currentValue as IShapeDescriptor;
            if (uiService != null)
                uiService.ShowDialog(editor);
            else
                editor.ShowDialog();

            if (editor.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                currentValue = editor.Value;
            }

            editor.Dispose();

#endif
			return currentValue as IShapeDescriptor;
        }
예제 #49
0
			public static TransformNode GetTransformOptions(IUIService uiService, LinkedList<TransformNode> nodes)
			{
				ImportStepOptions form = myForm;
				if (form == null)
				{
					myForm = form = new ImportStepOptions();
					form.TransformsCombo.SelectedValueChanged += new EventHandler(
						delegate(object sender, EventArgs e)
						{
							ComboBox senderCombo = (ComboBox)sender;
							PropertyGrid gridControl = ((ImportStepOptions)senderCombo.Parent).TransformOptionsPropertyGrid;
							TransformNode selectedNode = (TransformNode)senderCombo.SelectedItem;
							gridControl.SelectedObject = (selectedNode != null) ? selectedNode.CreateDynamicParametersTypeDescriptor() : null;
						});
				}
				ComboBox combo = form.TransformsCombo;
				PropertyGrid grid = form.TransformOptionsPropertyGrid;
				ComboBox.ObjectCollection items = combo.Items;
				foreach (TransformNode node in nodes)
				{
					items.Add(node);
				}
				combo.SelectedIndex = 0;
				if (nodes.Count == 1)
				{
					grid.Select();
				}
				TransformNode retVal = null;
				if (DialogResult.OK == uiService.ShowDialog(form))
				{
					TransformNode node = (TransformNode)combo.SelectedItem;
					if (node != null)
					{
						node.SynchronizeArguments();
						retVal = node;
					}
				}
				items.Clear();
				grid.SelectedObject = null;
				return retVal;
			}
        /// <summary>
		/// Initializes a new instance of the <see cref="TypeMemberChooser"/> class.
        /// </summary>
		/// <param name="uiService">The <see cref="IUIService"/> to perform UI operations.</param>
        public TypeMemberChooser(IUIService uiService)
        {
            this.uiService = uiService;
        }
예제 #51
0
 /// <include file='doc\QueuePathDialog.uex' path='docs/doc[@for="QueuePathDialog.QueuePathDialog2"]/*' />
 /// <devdoc>
 ///     Creates a path editor control.
 ///     This will create also a tree view control, and an ImageList with
 ///     the icons.
 /// </devdoc>
 public QueuePathDialog(IUIService uiService)
     : base()
 {
     this.uiService = uiService;
     this.InitializeComponent();
 }
예제 #52
0
            /// <devdoc>
            ///     Override to GetService so we can route requests
            ///     to the package's service provider.
            /// </devdoc>
            protected override object GetService(Type serviceType) {
                if (serviceType == null) {
                    throw new ArgumentNullException("serviceType");
                }
                if (_provider != null) {
                    if (serviceType.IsEquivalentTo(typeof(AmbientProperties))) {
                        if (_uis == null) {
                            _uis = (IUIService)_provider.GetService(typeof(IUIService));
                        }
                        if (_ambientProperties == null) {
                            _ambientProperties = new AmbientProperties();
                        }
                        if (_uis != null) {
                            // update the _ambientProperties in case the styles have changed
                            // since last time.
                            _ambientProperties.Font = (Font)_uis.Styles["DialogFont"];
                        }
                        return _ambientProperties;
                    }
                    object service = _provider.GetService(serviceType);

                    if (service != null) {
                        return service;
                    }
                }
                return base.GetService(serviceType);
            }
예제 #53
0
    public DebuggingComponent(Microsoft.Xna.Framework.Game game, IServiceLocator services)
      : base(game)
    {
      _inputService = services.GetInstance<IInputService>();
      _graphicsService = services.GetInstance<IGraphicsService>();
      _uiService = services.GetInstance<IUIService>();

      // Get graphics service and add a DelegateGraphicsScreen as the first 
      // graphics screen. This lets us do the rendering in the Render method of
      // this class.
      
      _graphicsScreen = new DelegateGraphicsScreen(_graphicsService)
      {
        RenderCallback = Render,
      };
      _graphicsService.Screens.Insert(0, _graphicsScreen);

      // Load a UI theme and create a renderer. 
      // We could use the same renderer as the "Default" screen (see StartScreenComponent.cs).
      // But usually, the debug screen will use a more efficient theme (smaller fonts, no
      // fancy graphics). Here, we simply use the BlendBlue theme again.
      var contentManager = services.GetInstance<ContentManager>();
      var theme = contentManager.Load<Theme>("UI Themes/BlendBlue/Theme");
      UIRenderer renderer = new UIRenderer(Game, theme);

      // Create a UIScreen and add it to the UI service. 
      _uiScreen = new UIScreen("Debug", renderer)
      {
        // A transparent background.
        Background = new Color(0, 0, 0, 0),

        // The z-index is equal to the draw order. The z-index defines in which order the 
        // screens are updated. This screen with the debug console should be updated before
        // the actual game under this screen.
        ZIndex = 10,

        // Hide the screen. The user has to press a button to make the debug screen visible.
        IsVisible = false,
      };

      // Optional: 
      // The debug screen handles gamepad input first, then the other screens and game components
      // can handle input. We do not want that the game is controllable when the debug screen is
      // visible, therefore we set the IsHandled flags when the screen is finished with the input.
      _uiScreen.InputProcessed += (s, e) => _inputService.SetGamePadHandled(LogicalPlayerIndex.Any, true);

      // Add a console control on the left.
      _console = new Console
      {
        HorizontalAlignment = HorizontalAlignment.Left,
        VerticalAlignment = VerticalAlignment.Stretch,
        Width = 500,
        Margin = new Vector4F(20),
      };
      _uiScreen.Children.Add(_console);

      // Print a few info messages in the console.
      _console.WriteLine("Press TAB or ChatPadGreen to display/hide console.");
      _console.WriteLine("Enter 'help' to view console commands.");

      // Add a custom command:
      _console.Interpreter.Commands.Add(new ConsoleCommand("greet", "greet [<name>] ... Prints a greeting message.", Greet));

      // Add the screen to the UI service. 
      _uiService.Screens.Add(_uiScreen);
    }
 internal static void ShowErrorDialog(IUIService uiService, Exception ex, Control dataGridView)
 {
     if (uiService != null)
     {
         uiService.ShowError(ex);
     }
     else
     {
         string message = ex.Message;
         if ((message == null) || (message.Length == 0))
         {
             message = ex.ToString();
         }
         System.Windows.Forms.Design.RTLAwareMessageBox.Show(dataGridView, message, null, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, 0);
     }
 }
예제 #55
0
 /// <summary>
 /// Initializes a new instance of the SpashScreenViewModel 
 /// </summary>
 /// <param name="navSrv">Navigation service</param>
 /// <param name="myEventsrSrv">myEvents service</param>
 /// <param name="uiSrv"></param>       
 public SplashScreenViewModel(INavigationService navSrv, IMyEventsClient myEventsrSrv, IUIService uiSrv)
 {
     _navService = navSrv;
     _myEventsService = myEventsrSrv;
     _uiService = uiSrv;
 }
 public ImmediateCommandSetItem(CommandSet commandSet, EventHandler statusHandler, EventHandler invokeHandler, CommandID id, IUIService uiService)
     : base(commandSet, statusHandler, invokeHandler, id, uiService)
 {
 }
예제 #57
0
		/// <summary>
		/// Called by the framework when the designer is being initialized with the designed control
		/// </summary>
		/// <param name="component"></param>
		public override void Initialize(IComponent component)
		{
			base.Initialize(component);

			if (Control is TreeView)
			{
				try
				{
					m_oSelectionService = (ISelectionService) GetService(typeof (ISelectionService));
				}
				catch
				{
				}
				try
				{
					m_oSelectionService.SelectionChanged += new EventHandler(this.OnSelectionServiceChanged);
				}
				catch
				{
				}
				try
				{
					m_oDesignerHost = (IDesignerHost) GetService(typeof (IDesignerHost));
				}
				catch
				{
				}
				try
				{
					m_oMenuService = (IMenuCommandService) GetService(typeof (IMenuCommandService));
				}
				catch
				{
				}
				try
				{
					m_oDesignerSerializationService = (IDesignerSerializationService) GetService(typeof (IDesignerSerializationService));
				}
				catch
				{
				}
				try
				{
					m_oToolboxService = (IToolboxService) GetService(typeof (IToolboxService));
				}
				catch
				{
				}
				try
				{
					m_oUIService = (IUIService) GetService(typeof (IUIService));
				}
				catch
				{
				}
				try
				{
					m_oComponentChangeService = (IComponentChangeService) GetService(typeof (IComponentChangeService));
				}
				catch
				{
				}

				m_oTreeView = (TreeView) Control;
				m_oTreeView.m_bFocus = true;
				m_oTreeView.ClearAllSelection();
				m_oTreeView.DesignerHost = m_oDesignerHost;
				m_oTreeView.IsDesignMode = true;

				if (m_bFirstTime == true)
				{
					OnComponentCreated(m_oTreeView);
					m_bFirstTime = false;
				}

				try
				{
					m_oComponentAddedHandler = new ComponentEventHandler(this.OnComponentAdded);
				}
				catch
				{
				}
				try
				{
					m_oComponentRemovingHandler = new ComponentEventHandler(this.OnComponentRemoving);
				}
				catch
				{
				}
				try
				{
					m_oComponentChangeService.ComponentAdded += m_oComponentAddedHandler;
				}
				catch
				{
				}
				try
				{
					m_oComponentChangeService.ComponentRemoving += m_oComponentRemovingHandler;
				}
				catch
				{
				}
				try
				{
					m_oNodeParentChanged = new EventHandler(this.OnNodeParentChanged);
				}
				catch
				{
				}

				try
				{
					m_oOldCmdCopy = m_oMenuService.FindCommand(StandardCommands.Copy);
				}
				catch
				{
				}
				try
				{
					m_oOldCmdPaste = m_oMenuService.FindCommand(StandardCommands.Paste);
				}
				catch
				{
				}
				try
				{
					m_oOldCmdCut = m_oMenuService.FindCommand(StandardCommands.Cut);
				}
				catch
				{
				}
				try
				{
					m_oOldBringFront = m_oMenuService.FindCommand(StandardCommands.BringToFront);
				}
				catch
				{
				}
				try
				{
					m_oOldSendBack = m_oMenuService.FindCommand(StandardCommands.SendToBack);
				}
				catch
				{
				}
				try
				{
					m_oOldAlignGrid = m_oMenuService.FindCommand(StandardCommands.AlignToGrid);
				}
				catch
				{
				}
				try
				{
					m_oOldLockControls = m_oMenuService.FindCommand(StandardCommands.LockControls);
				}
				catch
				{
				}
				try
				{
					m_oOldDelete = m_oMenuService.FindCommand(StandardCommands.Delete);
				}
				catch
				{
				}

				try
				{
					m_oNewCmdCopy = new MenuCommand(new EventHandler(this.OnMenuCopy), StandardCommands.Copy);
				}
				catch
				{
				}
				try
				{
					m_oNewCmdPaste = new MenuCommand(new EventHandler(this.OnMenuPaste), StandardCommands.Paste);
				}
				catch
				{
				}

				if (TreeViewDesigner.MenuAdded == false)
				{
					try
					{
						m_oMenuService.RemoveCommand(m_oOldCmdCopy);
					}
					catch
					{
					}
					try
					{
						m_oMenuService.RemoveCommand(m_oOldCmdPaste);
					}
					catch
					{
					}
					try
					{
						m_oMenuService.AddCommand(m_oNewCmdCopy);
					}
					catch
					{
					}
					try
					{
						m_oMenuService.AddCommand(m_oNewCmdPaste);
					}
					catch
					{
					}

					TreeViewDesigner.MenuAdded = true;
				}

				m_oTreeView.Invalidate();

				#region action menus

				#region node menu

				m_oActionMenuNode = new ActionMenuNative();
				m_oActionMenuNode.Width = 170;
				m_oActionMenuNode.Title = "Node Action Menu";

				ActionMenuGroup oMenuGroup = m_oActionMenuNode.AddMenuGroup("Editing");
				oMenuGroup.Expanded = true;
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Add Node");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Delete Node");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Add Panel");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "-");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Clear Content");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Delete TreeView");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "-");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Copy");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Paste");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "-");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Properties");
				oMenuGroup = m_oActionMenuNode.AddMenuGroup("Arranging");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Expand");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Collapse");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Move Top");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Move Bottom");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Move Up");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Move Down");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Move Left");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Move Right");
				oMenuGroup = m_oActionMenuNode.AddMenuGroup("Color Schemes");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Default");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Forest");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Gold");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Ocean");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Rose");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Silver");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Sky");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Sunset");
				m_oActionMenuNode.AddMenuItem(oMenuGroup, "Wood");

				m_oActionMenuNode.ItemClick += new ActionMenuNative.ItemClickEventHandler(this.OnActionMenuNodeItemClicked);

				#endregion			

				#region TreeView menu

				m_oActionMenuTreeView = new ActionMenuNative();
				m_oActionMenuTreeView.Width = 170;
				m_oActionMenuTreeView.Title = "TreeView Action Menu";

				oMenuGroup = m_oActionMenuTreeView.AddMenuGroup("Editing");
				oMenuGroup.Expanded = true;
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Add Node");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Color Scheme Picker...");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "-");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Clear Content");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Delete TreeView");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "-");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Copy");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Paste");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "-");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Properties");
				oMenuGroup = m_oActionMenuTreeView.AddMenuGroup("Arranging");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Expand All");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Collapse All");
				oMenuGroup = m_oActionMenuTreeView.AddMenuGroup("Layout");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Bring to Front");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Send to Back");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Align to Grid");
				m_oActionMenuTreeView.AddMenuItem(oMenuGroup, "Lock Controls");

				m_oActionMenuTreeView.ItemClick += new ActionMenuNative.ItemClickEventHandler(this.OnActionMenuTreeViewItemClicked);

				#endregion

				#endregion

				// enable the drag drop operations
				m_oTreeView.AllowDrop = true;
				this.EnableDragDrop(true);

				m_oTreeView.CollapseAll();
				m_oSelector.SelectionService = m_oSelectionService;
				m_oSelector.TreeView = m_oTreeView;
			}
		}
 internal static void ShowErrorDialog(IUIService uiService, string errorString, Control dataGridView)
 {
     if (uiService != null)
     {
         uiService.ShowError(errorString);
     }
     else
     {
         System.Windows.Forms.Design.RTLAwareMessageBox.Show(dataGridView, errorString, null, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, 0);
     }
 }
 internal static void ShowErrorDialog(IUIService uiService, string errorString, Control filter)
 {
     if (uiService != null)
     {
         uiService.ShowError(errorString);
     }
     else
     {
         MessageBox.Show(filter, errorString, null, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, 0);
     }
 }
 // Methods
 internal static string EditMask(ITypeDiscoveryService discoverySvc, IUIService uiSvc, MaskedTextBoxAdv instance, IHelpService helpService)
 {
     string mask = null;
     Type formType = Type.GetType("System.Windows.Forms.Design.MaskDesignerDialog, System.Design, Version= 2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a");
     ConstructorInfo ci = formType.GetConstructor(new Type[] { typeof(MaskedTextBox), typeof(IHelpService) });
     Form form = ci.Invoke(new object[]{instance.MaskedTextBox, helpService}) as Form;
     
     try
     {
         MethodInfo mi = formType.GetMethod("DiscoverMaskDescriptors");
         mi.Invoke(form, new object[]{discoverySvc});
         //form.DiscoverMaskDescriptors(discoverySvc);
         DialogResult result = (uiSvc != null) ? uiSvc.ShowDialog(form) : form.ShowDialog();
         if (result == DialogResult.OK)
         {
             PropertyInfo pi = formType.GetProperty("Mask");
             mask = (string)pi.GetValue(form, null);
             pi = formType.GetProperty("ValidatingType");
             Type validatingType = pi.GetValue(form, null) as Type;
             //mask = form.Mask;
             if (validatingType == instance.ValidatingType)
             {
                 return mask;
             }
             instance.ValidatingType = validatingType;
         }
     }
     finally
     {
         form.Dispose();
     }
     return mask;
 }