/// <summary>
        /// OnAddPropertyPages virtual method is called to add property pages to a property sheet.
        /// </summary>
        /// <param name="propertyPageCollection">The property page collection.</param>
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            if (SelectedNodes.Count == 0)
            {
                throw new Exception("there should be one selection");
            }
            else
            {
                GeneralPropertyPage generalPropertyPage = new GeneralPropertyPage();
                generalPropertyPage.Title = "General";

                GeneralPropertiesControl generalPropertiesControl = new GeneralPropertiesControl(generalPropertyPage);
                generalPropertyPage.Control = generalPropertiesControl;

                propertyPageCollection.Add(generalPropertyPage);

                StartupPropertyPage startupPropertyPage = new StartupPropertyPage();
                startupPropertyPage.Title = "Startup";

                StartupPropertiesControl startupPropertiesControl = new StartupPropertiesControl(startupPropertyPage);
                startupPropertyPage.Control = startupPropertiesControl;

                propertyPageCollection.Add(startupPropertyPage);
            }
        }
Example #2
0
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            var attrPage = new AttributeEditorPropertyPage(_name, ServerDTO);

            attrPage.Title = "Attribute Editor";
            propertyPageCollection.Add(attrPage.Page);
        }
Example #3
0
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            var auth = SnapInContext.Instance.AuthTokenManager.GetAuthToken(_serverDto, _tenantName);

            if (auth != null)
            {
                ActionHelper.Execute(delegate
                {
                    var service         = ScopeNodeExtensions.GetServiceGateway(_serverDto.ServerName);
                    var dto             = Tag as UserDto;
                    var generalManager  = new UserGeneralPropertyManager(service, dto, _serverDto, _tenantName);
                    var userGeneralPage = new UserGeneralProperty(generalManager, _isSystemDomain)
                    {
                        Title = "General"
                    };
                    propertyPageCollection.Add(userGeneralPage.Page);

                    var groupsManager  = new UserGroupsPropertyManager(service, dto, _serverDto, _tenantName, _domainName);
                    var userGroupsPage = new UserGroupsProperty(groupsManager, _isSystemDomain)
                    {
                        Title = "Member Of"
                    };
                    propertyPageCollection.Add(userGroupsPage.Page);

                    var rolesManager  = new UserRolesPropertyManager(service, dto, _serverDto, _tenantName, _domainName);
                    var userRolesPage = new UserRolesProperty(rolesManager, _isSystemDomain)
                    {
                        Title = "Roles"
                    };
                    propertyPageCollection.Add(userRolesPage.Page);
                }, auth);
            }
        }
Example #4
0
        /// <summary>
        /// Virtual method that is called to get the extension pages.
        /// </summary>
        /// <param name="propertyPageCollection">Page collection.</param>
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            // add extension page.
            MachinePropertyPage machinePropertyPage = new MachinePropertyPage(sharedDataItem);

            propertyPageCollection.Add(machinePropertyPage);
        }
Example #5
0
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            base.OnAddPropertyPages(propertyPageCollection);
            var auth = SnapInContext.Instance.AuthTokenManager.GetAuthToken(ServerDto, _tenantName);

            if (auth != null)
            {
                ActionHelper.Execute(delegate
                {
                    var service     = this.GetServiceGateway();
                    var dto         = Tag as SolutionUserDto;
                    var propManager = new SolutionUserPropertyManager(service, dto, ServerDto, _tenantName);

                    var generalPage = new SolutionUserGeneralProperty(propManager)
                    {
                        Title = "General"
                    };
                    propertyPageCollection.Add(generalPage.Page);

                    var certPage = new SolutionUserCertProperty(propManager)
                    {
                        Title = "Certificate"
                    };
                    propertyPageCollection.Add(certPage.Page);
                }, auth);
            }
            ;
        }
Example #6
0
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     if (base.SelectedNodes.Count == 0)
     {
         throw new Exception("There should be at least one node selection");
     }
     propertyPageCollection.Add(new ModifyPropertyPage(base.ScopeNode.LanguageIndependentName));
 }
        /// <summary>
        /// Get the property pages to show.
        /// </summary>
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            Random rand = new Random();
            int    i    = rand.Next();

            propertyPageCollection.Add(new UserPropertyPage(this.usersFormView, typeof(UserPropertiesControl), i, true));
            propertyPageCollection.Add(new UserPropertyPage(this.usersFormView, typeof(UserPropertiesKeysControl), i, true));
        }
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     if (string.IsNullOrEmpty(this.CurrentPropertySheetTitle) == true)
     {
         AppPropertyPageManager propPageManager = new AppPropertyPageManager(this.DisplayName);
         propPageManager.AddPropertyPages(propertyPageCollection);
     }
     base.OnAddPropertyPages(propertyPageCollection);
 }
Example #9
0
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     if (_hasKeyValuePropertyPage)
     {
         Add_KeyValue_PropertyPage add_KeyValue_PropertyPage = new Add_KeyValue_PropertyPage(base.DisplayName);
         add_KeyValue_PropertyPage.KeyValueAdded += new EventHandler(propertyPage_KeyValueAdded);
         propertyPageCollection.Add(add_KeyValue_PropertyPage);
     }
 }
Example #10
0
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     base.OnAddPropertyPages(propertyPageCollection);
     if (this.AddPropertyPages != null)
     {
         this.AddPropertyPages(this, new EventArgs <PropertyPageCollection>(propertyPageCollection));
     }
     this.CurrentPropertySheetTitle = null;
 }
Example #11
0
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     if (this.SelectedNodes.Count == 0)
     {
         throw new Exception("there should be at least one selection");
     }
     else
     {
         // add at least one property page relevant to the selection
         propertyPageCollection.Add(new UserPropertyPage());
     }
 }
Example #12
0
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     if (this.SelectedNodes.Count == 0)
     {
         // Nothing
     }
     else
     {
         propertyPageCollection.Add(new PropertyPages.GeneralRecordPropertyPage());
         propertyPageCollection.Add(new PropertyPages.ARecordPropertyPage());
         propertyPageCollection.Add(new PropertyPages.SrvRecordPropertyPage());
         propertyPageCollection.Add(new PropertyPages.TxtRecordPropertyPage());
     }
 }
Example #13
0
 /// <summary>
 /// OnAddPropertyPages is used to get the property pages to show.
 /// (triggered by SelectionData.ShowPropertySheet)
 /// </summary>
 /// <param name="propertyPageCollection">property pages</param>
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     try
     {
         if (_settingsControl.ListView.SelectedItems.Count < 1)
         {
             throw new Exception("there should be at least one selection");
         }
         propertyPageCollection.Add(new EditSettingPage(this.SelectionData.SelectionObject));
     }
     catch (Exception ex)
     {
         ExceptionHandlerWindows.HandleException(ex);
     }
 }
Example #14
0
        /// <summary>
        /// OnAddPropertyPages method implementation
        /// </summary>
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            Random rand = new Random();
            int    i    = rand.Next();
            MMCRegistrationList registrations = (MMCRegistrationList)SelectionData.SelectionObject;

            if (registrations.Count > 1)
            {
                propertyPageCollection.Add(new UserPropertyPage(this, typeof(UserCommonPropertiesControl), i));
            }
            else
            {
                propertyPageCollection.Add(new UserPropertyPage(this, typeof(UserPropertiesControl), i));
                propertyPageCollection.Add(new UserPropertyPage(this, typeof(UserPropertiesKeysControl), i));
            }
        }
Example #15
0
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            base.OnAddPropertyPages(propertyPageCollection);
            var authTokenDto = SnapInContext.Instance.AuthTokenManager.GetAuthToken(ServerDto, TenantName);

            ActionHelper.Execute(delegate
            {
                var service     = ScopeNodeExtensions.GetServiceGateway(ServerDto.ServerName);
                var groupDto    = Tag as GroupDto;
                var presenter   = new GroupPropertyDataManager(groupDto, service, ServerDto, TenantName, _domainName);
                var generalPage = new GroupGeneralProperty(presenter, groupDto, IsSystemDomain)
                {
                    Title = "General"
                };
                propertyPageCollection.Add(generalPage.Page);
            }, authTokenDto);
        }
Example #16
0
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            if (this.SelectedNodes.Count == 0)
            {
                throw new Exception("There should be at least one field selected.");
            }

            // get selected node information
            string appName    = this.ScopeNode.DisplayName;
            string fieldName  = this.SelectedNodes[0].DisplayName;
            string fieldValue = this.SelectedNodes[0].SubItemDisplayNames[0];
            string identifier = this.SelectedNodes[0].SubItemDisplayNames[1];

            // create property page and attach event handlers
            AppFieldPropertyPage propPage = new AppFieldPropertyPage(appName, fieldName, fieldValue, identifier);

            propPage.Saved += PropPage_Saved;

            // add the page to the collection
            propertyPageCollection.Add(propPage);
        }
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            base.OnAddPropertyPages(propertyPageCollection);
            ActionHelper.Execute(delegate()
            {
                var serverDto = GetServerDTO();
                var service   = this.GetServiceGateway();
                var auth      = SnapInContext.Instance.AuthTokenManager.GetAuthToken(serverDto.ServerName);
                var dto       = service.IdentityProvider.Get(serverDto, _tenantName, _provider.Name, auth.Token);

                if (dto != null)
                {
                    var mgr           = new ExternalDomainPropertyManager(_tenantName, service, serverDto, auth.Token, dto);
                    var generalPage   = new ExternalDomainGeneralProperty(dto);
                    generalPage.Title = "General";
                    propertyPageCollection.Add(generalPage.Page);

                    var authPage   = new ExternalDomainAuthProperty(dto);
                    authPage.Title = "Auth details";
                    propertyPageCollection.Add(authPage.Page);
                }
            });
        }
Example #18
0
        protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
        {
            // get application name from selected node
            string appName = this.SelectedNodes[0].DisplayName;

            switch (this.currentPropertyPageTitle)
            {
            case "Add Field":
                // create property page and attach event handlers
                AppFieldPropertyPage propPage = new AppFieldPropertyPage(appName);
                propPage.Saved += PropPage_Saved;
                // add the page to the collection
                propertyPageCollection.Add(new AppFieldPropertyPage(appName));
                break;

            default:
                // create instance of the AppPropertyPageManager
                AppPropertyPageManager propPageManager = new AppPropertyPageManager(appName);
                propPageManager.Saved += PropPageManager_Saved;
                // add property pages
                propPageManager.AddPropertyPages(propertyPageCollection);
                break;
            }
        }
Example #19
0
 /// <summary>
 /// OnAddPropertyPages is used to get the property pages to show.
 /// (triggered by Properties verbs)
 /// </summary>
 /// <param name="propertyPageCollection">property pages</param>
 protected override void OnAddPropertyPages(PropertyPageCollection propertyPageCollection)
 {
     propertyPageCollection.Add(new CAPropertyPage(this));
 }
Example #20
0
		/// <summary> 
		///  Create a new filter graph and add filters (devices, compressors, 
		///  misc), but leave the filters unconnected. Call renderGraph()
		///  to connect the filters.
		/// </summary>
		private void createGraph()
		{
			DsGuid cat;
			DsGuid med;

			// Ensure required properties are set
			if (VideoDevice == null && AudioDevice == null)
				throw new ArgumentException("The video and/or audio device have not been set. Please set one or both to valid capture devices.\n");

			// Skip if we are already created
			if ((int)_graphState < (int)GraphState.Created)
			{
				// Garbage collect, ensure that previous filters are released
				GC.Collect();

				// Make a new filter graph
				//_graphBuilder = (IGraphBuilder)Activator.CreateInstance(Type.GetTypeFromCLSID(Clsid.FilterGraph, true));
				_graphBuilder = (IGraphBuilder)new FilterGraph();

				// Get the Capture Graph Builder
				//Guid clsid = Clsid.CaptureGraphBuilder2;
				//Guid riid = typeof(ICaptureGraphBuilder2).GUID;
				//_captureGraphBuilder = (ICaptureGraphBuilder2)DsBugWO.CreateDsInstance(ref clsid, ref riid);
				_captureGraphBuilder = (ICaptureGraphBuilder2)new CaptureGraphBuilder2();

				// Link the CaptureGraphBuilder to the filter graph
				Marshal.ThrowExceptionForHR(_captureGraphBuilder.SetFiltergraph(_graphBuilder));

				// Add the graph to the Running Object Table so it can be
				// viewed with GraphEdit
#if DEBUG
				//DsROT.AddGraphToRot(_graphBuilder, out _rotCookie);
#endif

				// Get the video device and add it to the filter graph
				if (VideoDevice != null)
				{
					_videoDeviceFilter = (IBaseFilter)Marshal.BindToMoniker(VideoDevice.MonikerString);
					Marshal.ThrowExceptionForHR(_graphBuilder.AddFilter(_videoDeviceFilter, "Video Capture Device"));
				}

				// Get the audio device and add it to the filter graph
				if (AudioDevice != null)
				{
					_audioDeviceFilter = (IBaseFilter)Marshal.BindToMoniker(AudioDevice.MonikerString);
					Marshal.ThrowExceptionForHR(_graphBuilder.AddFilter(_audioDeviceFilter, "Audio Capture Device"));
				}

				// Get the video compressor and add it to the filter graph
				if (VideoCompressor != null)
				{
					_videoCompressorFilter = (IBaseFilter)Marshal.BindToMoniker(VideoCompressor.MonikerString);
					Marshal.ThrowExceptionForHR(_graphBuilder.AddFilter(_videoCompressorFilter, "Video Compressor"));
				}

				// Get the audio compressor and add it to the filter graph
				if (AudioCompressor != null)
				{
					_audioCompressorFilter = (IBaseFilter)Marshal.BindToMoniker(AudioCompressor.MonikerString);
					Marshal.ThrowExceptionForHR(_graphBuilder.AddFilter(_audioCompressorFilter, "Audio Compressor"));
				}

				// Retrieve the stream control interface for the video device
				// FindInterface will also add any required filters
				// (WDM devices in particular may need additional
				// upstream filters to function).

				// Try looking for an interleaved media type
				object o;
				cat = DsGuid.FromGuid(PinCategory.Capture);
				med = DsGuid.FromGuid(MediaType.Interleaved);
				Guid iid = typeof(IAMStreamConfig).GUID;
				int hr = _captureGraphBuilder.FindInterface(cat, med, _videoDeviceFilter, iid, out o);
				//int hr = _captureGraphBuilder.FindInterface(ref cat, ref med, _videoDeviceFilter, ref iid, out o);

				if (hr != 0)
				{
					// If not found, try looking for a video media type
					med = MediaType.Video;
					hr = _captureGraphBuilder.FindInterface(cat, med, _videoDeviceFilter, iid, out o);
					//hr = _captureGraphBuilder.FindInterface(ref cat, ref med, _videoDeviceFilter, ref iid, out o);

					if (hr != 0)
						o = null;
				}
				_videoStreamConfig = o as IAMStreamConfig;

				// Retrieve the stream control interface for the audio device
				o = null;
				cat = DsGuid.FromGuid(PinCategory.Capture);
				med = DsGuid.FromGuid(MediaType.Audio);
				iid = typeof(IAMStreamConfig).GUID;
				hr = _captureGraphBuilder.FindInterface(cat, med, _audioDeviceFilter, iid, out o);
//				hr = _captureGraphBuilder.FindInterface(ref cat, ref med, _audioDeviceFilter, ref iid, out o);
				if (hr != 0)
					o = null;

				_audioStreamConfig = o as IAMStreamConfig;

				// Retreive the media control interface (for starting/stopping graph)
				_mediaControl = (IMediaControl)_graphBuilder;

				// Reload any video crossbars
				if (_videoSources != null) 
					_videoSources.Dispose(); 
				_videoSources = null;

				// Reload any audio crossbars
				if (_audioSources != null) 
					_audioSources.Dispose(); 
				_audioSources = null;

				// Reload any property pages exposed by filters
				if (_propertyPages != null) 
					_propertyPages.Dispose(); 
				_propertyPages = null;

				// Reload capabilities of video device
				_videoCaps = null;

				// Reload capabilities of video device
				_audioCaps = null;

				// Retrieve TV Tuner if available
				o = null;
				cat = DsGuid.FromGuid(PinCategory.Capture);
				med = DsGuid.FromGuid(MediaType.Interleaved);
				iid = typeof(IAMTVTuner).GUID;
				hr = _captureGraphBuilder.FindInterface(cat, med, _videoDeviceFilter, iid, out o);
				//hr = _captureGraphBuilder.FindInterface(ref cat, ref med, _videoDeviceFilter, ref iid, out o);
				if (hr != 0)
				{
					med = DsGuid.FromGuid(MediaType.Video);
					hr = _captureGraphBuilder.FindInterface(cat, med, _videoDeviceFilter, iid, out o);
					//hr = _captureGraphBuilder.FindInterface(ref cat, ref med, _videoDeviceFilter, ref iid, out o);
					if (hr != 0)
						o = null;
				}
				
				IAMTVTuner t = o as IAMTVTuner;
				if (t != null)
					Tuner = new Tuner(t);


				/*
							// ----------- VMR 9 -------------------
							//## check out samples\inc\vmrutil.h :: RenderFileToVMR9

							IBaseFilter vmr = null;
							if ( ( VideoDevice != null ) && ( previewWindow != null ) )
							{
								vmr = (IBaseFilter) Activator.CreateInstance( Type.GetTypeFromCLSID( Clsid.VideoMixingRenderer9, true ) ); 
								hr = graphBuilder.AddFilter( vmr, "VMR" );
								if( hr < 0 ) Marshal.ThrowExceptionForHR( hr );

								IVMRFilterConfig9 vmrFilterConfig = (IVMRFilterConfig9) vmr;
								hr = vmrFilterConfig.SetRenderingMode( VMRMode9.Windowless );
								if( hr < 0 ) Marshal.ThrowExceptionForHR( hr );

								IVMRWindowlessControl9 vmrWindowsless = (IVMRWindowlessControl9) vmr;	
								hr = vmrWindowsless.SetVideoClippingWindow( previewWindow.Handle );
								if( hr < 0 ) Marshal.ThrowExceptionForHR( hr );
							}
							//------------------------------------------- 

							// ---------- SmartTee ---------------------

							IBaseFilter smartTeeFilter = (IBaseFilter) Activator.CreateInstance( Type.GetTypeFromCLSID( Clsid.SmartTee, true ) ); 
							hr = graphBuilder.AddFilter( smartTeeFilter, "Video Smart Tee" );
							if( hr < 0 ) Marshal.ThrowExceptionForHR( hr );

							// Video -> SmartTee
							cat = PinCategory.Capture;
							med = MediaType.Video;
							hr = captureGraphBuilder.RenderStream( ref cat, ref med, videoDeviceFilter, null, smartTeeFilter ); 
							if( hr < 0 ) Marshal.ThrowExceptionForHR( hr );

							// smarttee -> mux
							cat = PinCategory.Capture;
							med = MediaType.Video;
							hr = captureGraphBuilder.RenderStream( ref cat, ref med, smartTeeFilter, null, muxFilter ); 
							if( hr < 0 ) Marshal.ThrowExceptionForHR( hr );

							// smarttee -> vmr
							cat = PinCategory.Preview;
							med = MediaType.Video;
							hr = captureGraphBuilder.RenderStream( ref cat, ref med, smartTeeFilter, null, vmr ); 
							if( hr < 0 ) Marshal.ThrowExceptionForHR( hr );

							// -------------------------------------
				*/
				// Update the state now that we are done
				_graphState = GraphState.Created;
			}
		}
Example #21
0
		/// <summary>
		///  Completely tear down a filter graph and 
		///  release all associated resources.
		/// </summary>
		private void destroyGraph()
		{
			// Derender the graph (This will stop the graph
			// and release preview window. It also destroys
			// half of the graph which is unnecessary but
			// harmless here.) (ignore errors)
			try 
			{ 
				derenderGraph(); 
			}
			catch { }

			// Update the state after derender because it
			// depends on correct status. But we also want to
			// update the state as early as possible in case
			// of error.
			_graphState = GraphState.Null;
			_isCaptureRendered = false;
			_isPreviewRendered = false;

			// Remove graph from the ROT
			//if (_rotCookie != 0)
			//{
			//    DsROT.RemoveGraphFromRot(ref _rotCookie);
			//    _rotCookie = 0;
			//}

			// Remove filters from the graph
			// This should be unnecessary but the Nvidia WDM
			// video driver cannot be used by this application 
			// again unless we remove it. Ideally, we should
			// simply enumerate all the filters in the graph
			// and remove them. (ignore errors)
			if (_muxFilter != null)
				_graphBuilder.RemoveFilter(_muxFilter);
			if (_videoCompressorFilter != null)
				_graphBuilder.RemoveFilter(_videoCompressorFilter);
			if (_audioCompressorFilter != null)
				_graphBuilder.RemoveFilter(_audioCompressorFilter);
			if (_videoDeviceFilter != null)
				_graphBuilder.RemoveFilter(_videoDeviceFilter);
			if (_audioDeviceFilter != null)
				_graphBuilder.RemoveFilter(_audioDeviceFilter);

			// Clean up properties
			if (_videoSources != null)
				_videoSources.Dispose(); 
			_videoSources = null;
			if (_audioSources != null)
				_audioSources.Dispose(); 
			_audioSources = null;
			if (_propertyPages != null)
				_propertyPages.Dispose(); 
			_propertyPages = null;
			if (Tuner != null)
				Tuner.Dispose(); 
			Tuner = null;

			// Cleanup
			if (_graphBuilder != null)
				Marshal.ReleaseComObject(_graphBuilder); 
			_graphBuilder = null;
			if (_captureGraphBuilder != null)
				Marshal.ReleaseComObject(_captureGraphBuilder); 
			_captureGraphBuilder = null;
			if (_muxFilter != null)
				Marshal.ReleaseComObject(_muxFilter); 
			_muxFilter = null;
			if (_fileWriterFilter != null)
				Marshal.ReleaseComObject(_fileWriterFilter); 
			_fileWriterFilter = null;
			if (_videoDeviceFilter != null)
				Marshal.ReleaseComObject(_videoDeviceFilter); 
			_videoDeviceFilter = null;
			if (_audioDeviceFilter != null)
				Marshal.ReleaseComObject(_audioDeviceFilter); 
			_audioDeviceFilter = null;
			if (_videoCompressorFilter != null)
				Marshal.ReleaseComObject(_videoCompressorFilter); 
			_videoCompressorFilter = null;
			if (_audioCompressorFilter != null)
				Marshal.ReleaseComObject(_audioCompressorFilter); 
			_audioCompressorFilter = null;

			// These are copies of graphBuilder
			_mediaControl = null;
			_videoWindow = null;

			// For unmanaged objects we haven't released explicitly
			GC.Collect();
		}
 public void AddPropertyPages(PropertyPageCollection propPageCollection)
 {
     propPageCollection.Add(this.generalPropPage);
     propPageCollection.Add(this.accountsPropPage);
 }