当前位置: 首页>>代码示例>>C#>>正文


C# IEnvironmentModel类代码示例

本文整理汇总了C#中IEnvironmentModel的典型用法代码示例。如果您正苦于以下问题:C# IEnvironmentModel类的具体用法?C# IEnvironmentModel怎么用?C# IEnvironmentModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IEnvironmentModel类属于命名空间,在下文中一共展示了IEnvironmentModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SecurityViewModel

        public SecurityViewModel(SecuritySettingsTO securitySettings, IResourcePickerDialog resourcePicker, DirectoryObjectPickerDialog directoryObjectPicker, IWin32Window parentWindow, IEnvironmentModel environment)
        {
            VerifyArgument.IsNotNull("resourcePicker", resourcePicker);
            VerifyArgument.IsNotNull("directoryObjectPicker", directoryObjectPicker);
            VerifyArgument.IsNotNull("parentWindow", parentWindow);
            VerifyArgument.IsNotNull("environment", environment);

            _resourcePicker = resourcePicker;
            _directoryObjectPicker = directoryObjectPicker;
            _parentWindow = parentWindow;
            _environment = environment;
            _directoryObjectPicker.AllowedObjectTypes = ObjectTypes.BuiltInGroups | ObjectTypes.Groups;
            _directoryObjectPicker.DefaultObjectTypes = ObjectTypes.Groups;
            _directoryObjectPicker.AllowedLocations = Locations.All;
            _directoryObjectPicker.DefaultLocations = Locations.JoinedDomain;
            _directoryObjectPicker.MultiSelect = false;
            _directoryObjectPicker.TargetComputer = string.Empty;
            _directoryObjectPicker.ShowAdvancedView = false;

            PickWindowsGroupCommand = new DelegateCommand(PickWindowsGroup);
            PickResourceCommand = new DelegateCommand(PickResource);

            InitializeHelp();

            InitializePermissions(securitySettings == null ? null : securitySettings.WindowsGroupPermissions);
        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:26,代码来源:SecurityViewModel.cs

示例2: SharepointServerSourceViewModel

        public SharepointServerSourceViewModel(SharepointServerSource serverSource, IEnvironmentModel environment)
        {
            IsLoading = false;
            TestComplete = false;
            _environment = environment;
            ServerName = "";
            AuthenticationType = AuthenticationType.Windows;
            IsWindows = true;
            SaveCommand = new RelayCommand(o =>
            {
                serverSource.DialogResult = true;
                serverSource.Close();
            }, o => TestComplete);

            CancelCommand = new RelayCommand(o =>
            {
                serverSource.DialogResult = false;
                serverSource.Close();
            });
            TestCommand = new RelayCommand(o =>
            {
                IsLoading = true;
                Dev2JsonSerializer serializer = new Dev2JsonSerializer();
                var source = CreateSharepointServerSource();
                var comsController = new CommunicationController { ServiceName = "TestSharepointServerService" };
                comsController.AddPayloadArgument("SharepointServer", serializer.SerializeToBuilder(source));
                TestResult = comsController.ExecuteCommand<string>(environment.Connection, GlobalConstants.ServerWorkspaceID);
                IsLoading = false;
            }, o => !TestComplete);
        }
开发者ID:ndubul,项目名称:Chillas,代码行数:30,代码来源:SharepointServerSourceViewModel.cs

示例3: Save

        /// <summary>
        /// Saves the specified connection - method provided for testing.
        /// </summary>
        /// <param name="jsonObj"></param>
        /// <param name="defaultEnvironment">The environment where the connection will be saved - must ALWAYS be .</param>
        /// <exception cref="System.ArgumentNullException">connectionID</exception>
        public void Save(dynamic jsonObj, IEnvironmentModel defaultEnvironment)
        {
            if(jsonObj == null)
            {
                throw new ArgumentNullException();
            }
            Connection newConnection = JsonConvert.DeserializeObject<Connection>(jsonObj.ToString());

            var resourceId = newConnection.ResourceID;
            ServerProxy connection;
            if(newConnection.AuthenticationType == AuthenticationType.Windows || newConnection.AuthenticationType == AuthenticationType.Anonymous)
            {
                connection = new ServerProxy(new Uri(newConnection.WebAddress));
            }
            else
            {
                //
                // NOTE: Public needs to drop through to User for the rest of the framework to pick up properly behind the scenes ;)
                //
                connection = new ServerProxy(newConnection.WebAddress, newConnection.UserName, newConnection.Password);
            }
            var environmentModel = CurrentEnvironmentRepository.Get(resourceId);
            if(environmentModel == null)
            {
                var newEnvironment = new EnvironmentModel(resourceId, connection) { Name = newConnection.ResourceName, Category = newConnection.ResourcePath };
                CurrentEnvironmentRepository.Save(newEnvironment);
            }
            else
            {
                environmentModel.Connection = connection;
                environmentModel.Name = newConnection.ResourceName;
                environmentModel.Category = newConnection.ResourcePath;
            }
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:40,代码来源:ConnectCallbackHandler.cs

示例4: CreateModels

        protected static StudioResourceRepository CreateModels(bool isChecked, out IEnvironmentModel environmentModel, out IExplorerItemModel resourceVm)
        {
            Mock<IContextualResourceModel> resourceModel = Dev2MockFactory.SetupResourceModelMock(ResourceType.WorkflowService, Guid.NewGuid());

            var connection = new Mock<IEnvironmentConnection>();

            var mockEnvironmentModel = new Mock<IEnvironmentModel>();
            mockEnvironmentModel.Setup(e => e.Connection).Returns(connection.Object);
            var env = Dev2MockFactory.SetupEnvironmentModel(resourceModel, new List<IResourceModel>());
            env.Setup(a => a.AuthorizationService).Returns(new Mock<IAuthorizationService>().Object);
            environmentModel = env.Object;
            var serverItemModel = new ExplorerItemModel { DisplayName = "localhost", ResourceType = Common.Interfaces.Data.ResourceType.Server, EnvironmentId = environmentModel.ID, ResourceId = Guid.NewGuid(), ResourcePath = "" };

            ExplorerItemModel workflowsFolder = new ExplorerItemModel { DisplayName = "WORKFLOWS", ResourceType = Common.Interfaces.Data.ResourceType.Folder, ResourcePath = "WORKFLOWS", ResourceId = Guid.NewGuid(), EnvironmentId = mockEnvironmentModel.Object.ID };

            serverItemModel.Children.Add(workflowsFolder);

            var studioResourceRepository = new StudioResourceRepository(serverItemModel, Invoke);
            resourceModel.Setup(model => model.Category).Returns("WORKFLOWS\\" + resourceModel.Object.DisplayName);
            TestEnvironmentRespository testEnvironmentRespository = new TestEnvironmentRespository(environmentModel);
            // ReSharper disable ObjectCreationAsStatement
            new EnvironmentRepository(testEnvironmentRespository);
            // ReSharper restore ObjectCreationAsStatement
            IEnvironmentModel internalEnvironmentModel = environmentModel;
            studioResourceRepository.GetCurrentEnvironment = () => internalEnvironmentModel.ID;
            studioResourceRepository.AddResouceItem(resourceModel.Object);
            resourceVm = workflowsFolder.Children[0];
            resourceVm.IsChecked = isChecked;
            return studioResourceRepository;
        }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:30,代码来源:DeployViewModelTestBase.cs

示例5: CreateResourceModel

 public static IContextualResourceModel CreateResourceModel(IEnvironmentModel environment)
 {
     return new ResourceModel(environment)
     {
         UserPermissions = Permissions.Contribute
     };
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:7,代码来源:ResourceModelFactory.cs

示例6: NavigationItemViewModel

        public NavigationItemViewModel(string name,
                                       string iconPath,
                                       NavigationItemViewModelBase parent,
                                       object dataContext,
                                       bool isExpanded = false,
                                       bool isSelected = false,
                                       string activityFullName = null,
                                       bool isServerLevel = false,
                                       bool isCategory = false,
                                       IEnvironmentModel environment = null,
                                       Func<NavigationItemViewModelBase, bool> childCountPredicate = null,
                                       bool isChecked = false)
            : base(name, iconPath, parent, dataContext, isExpanded, isSelected, childCountPredicate, isChecked)
        {
            ActivityFullName = activityFullName;
            IsServerLevel = isServerLevel;
            IsCategory = isCategory;
            EnvironmentModel = environment;
            DisplayName = name;

            _environmentConnectedMediatorKey = Mediator.RegisterToReceiveMessage(MediatorMessages.EnvironmentConnected,
                                                                                 a => RaisePropertyChangedForCommands());
            _environmentDisconnectedMediatorKey =
                Mediator.RegisterToReceiveMessage(MediatorMessages.EnvironmentDisconnected,
                                                  a => RaisePropertyChangedForCommands());
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:26,代码来源:NavigationItemViewModel.cs

示例7: Save

 protected override void Save(IEnvironmentModel environmentModel, dynamic jsonObj)
 {
     // ReSharper disable once MaximumChainedReferences
     string resName = jsonObj.resourceName;
     string resCat = HelperUtils.SanitizePath((string)jsonObj.resourcePath, resName);
     var dropBoxSource = new OauthSource { Key = Token, Secret = Secret, ResourceName = resName, ResourcePath = resCat, IsNewResource = true, ResourceID = Guid.NewGuid() }.ToStringBuilder();
     environmentModel.ResourceRepository.SaveResource(environmentModel,dropBoxSource , GlobalConstants.ServerWorkspaceID);
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:8,代码来源:DropBoxSourceSourceCallbackHandler.cs

示例8: ClientScheduledResourceModel

 public ClientScheduledResourceModel([Annotations.NotNull] IEnvironmentModel model)
 {
     if(model == null)
     {
         throw new ArgumentNullException("model");
     }
     _model = model;
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:8,代码来源:ClientScheduledResourceModel.cs

示例9: DropBoxUploadFileViewModel

 public DropBoxUploadFileViewModel(ModelItem modelItem, IEnvironmentModel environmentModel, IEventAggregator eventPublisher)
     : base(modelItem)
 {
     _environmentModel = environmentModel;
     _eventPublisher = eventPublisher;
     EditDropboxSourceCommand = new RelayCommand(o => EditDropBoxSource(), o => IsDropboxSourceSelected);
     Sources = LoadOAuthSources();
     SetSelectedOAuthSource(SelectedSource);
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:9,代码来源:DropBoxUploadFileViewModel.cs

示例10: TestResourceModel

 public TestResourceModel(IEnvironmentModel environmentModel, Guid serverID)
 {
     WorkflowActivity = null;
     TagList = new List<string>();
     Error = "";
     HasErrors = false;
     Environment = environmentModel;
     _serverID = serverID;
 }
开发者ID:Robin--,项目名称:Warewolf,代码行数:9,代码来源:TestResourceModel.cs

示例11: DropBoxHelper

        // ReSharper disable once TooManyDependencies
        public DropBoxHelper(DropBoxViewWindow dropBoxViewWindow, IEnvironmentModel activeEnvironment, string resourceType, string resourcePath)
        {
            VerifyArgument.AreNotNull(new Dictionary<string, object>{{"dropBoxViewWindow",dropBoxViewWindow},{"activeEnvironment",activeEnvironment},{"resourceType",resourceType},{"resourcePath",resourcePath}});
            ActiveEnvironment = activeEnvironment;
            ResourceType = resourceType;
            ResourcePath = resourcePath;
            DropBoxViewWindow = dropBoxViewWindow;

        }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:10,代码来源:DropBoxHelper.cs

示例12: UpdateSelectedServer

 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public UpdateSelectedServer(IEnvironmentModel environmentModel,bool isSourceServer)
 {
     if(environmentModel == null)
     {
         throw new ArgumentNullException("environmentModel");
     }
     EnvironmentModel = environmentModel;
     IsSourceServer = isSourceServer;
 }
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:12,代码来源:UpdateSelectedServer.cs

示例13: GetDependanciesOnList

        /// <summary>
        /// Gets a list of dependencies for the given ResourceModel's.
        /// </summary>
        /// <param name="resourceModels">The resource models to get dependancies for.</param>
        /// <param name="environmentModel"></param>
        /// <param name="getDependsOnMe"></param>
        /// <returns>
        /// A list of resource name string's.
        /// </returns>
        public List<string> GetDependanciesOnList(List<IContextualResourceModel> resourceModels,IEnvironmentModel environmentModel,bool getDependsOnMe = false)
        {
            if(!resourceModels.Any() || environmentModel == null)
            {
                return new List<string>();
            }

            var result =  environmentModel.ResourceRepository.GetDependanciesOnList(resourceModels, environmentModel, getDependsOnMe);

            return result;
        }
开发者ID:Robin--,项目名称:Warewolf,代码行数:20,代码来源:ResourceDependencyService.cs

示例14: TestLoadEnvironmentRespository

 public TestLoadEnvironmentRespository(IEnvironmentModel source, params IEnvironmentModel[] environments)
     : base(source)
 {
     if(environments != null)
     {
         foreach(var environment in environments)
         {
             Environments.Add(environment);
         }
     }
 }
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:11,代码来源:TestLoadEnvironmentRespository.cs

示例15: Save

        protected override void Save(IEnvironmentModel environmentModel, dynamic jsonObj)
        {
            // ReSharper disable once MaximumChainedReferences
            string resName = jsonObj.resourceName;
            string resCat = HelperUtils.SanitizePath((string)jsonObj.resourcePath, resName);
            var sharepointSource = new SharepointSource { Server = Server,UserName = _userName,Password = _password,AuthenticationType = _authenticationType, ResourceName = resName, ResourcePath = resCat, IsNewResource = true, ResourceID = Guid.NewGuid() };
            var source = sharepointSource.ToStringBuilder();

            environmentModel.ResourceRepository.SaveResource(environmentModel, source, GlobalConstants.ServerWorkspaceID);
            environmentModel.ResourceRepository.ReloadResource(sharepointSource.ResourceID, ResourceType.Source, ResourceModelEqualityComparer.Current, true);
            
        }
开发者ID:ndubul,项目名称:Chillas,代码行数:12,代码来源:SharepointServerSourceCallbackHandler.cs


注:本文中的IEnvironmentModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。