本文整理汇总了C#中IEnvironmentModel类的典型用法代码示例。如果您正苦于以下问题:C# IEnvironmentModel类的具体用法?C# IEnvironmentModel怎么用?C# IEnvironmentModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEnvironmentModel类属于命名空间,在下文中一共展示了IEnvironmentModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: CheckIfRemoteWorkflowAndSetProperties
public static void CheckIfRemoteWorkflowAndSetProperties(DsfActivity dsfActivity, IContextualResourceModel resource, IEnvironmentModel contextEnv)
{
if(resource != null && resource.ResourceType == ResourceType.WorkflowService && contextEnv != null)
{
if(contextEnv.ID != resource.Environment.ID)
{
dsfActivity.ServiceUri = resource.Environment.Connection.WebServerUri.AbsoluteUri;
dsfActivity.ServiceServer = resource.Environment.ID;
}
dsfActivity.FriendlySourceName = new InArgument<string>(resource.Environment.Connection.WebServerUri.Host);
}
}
开发者ID:Robin--,项目名称:Warewolf,代码行数:13,代码来源:WorkflowDesignerUtils.cs
示例17: ResourceModel
public ResourceModel(IEnvironmentModel environment, IEventAggregator eventPublisher)
{
VerifyArgument.IsNotNull("eventPublisher", eventPublisher);
_tagList = new List<string>();
Environment = environment;
if (environment != null && environment.Connection != null)
{
ServerID = environment.Connection.ServerID;
}
IsWorkflowSaved = true;
}
开发者ID:ndubul,项目名称:Chillas,代码行数:13,代码来源:ResourceModel.cs
示例18: SetCorrectEnvironmentId
static void SetCorrectEnvironmentId(IContextualResourceModel resource, DsfActivity activity, bool isDesignerLocalhost, IEnvironmentModel activeEnvironment)
{
if(resource.Environment != null)
{
var idToUse = resource.Environment.ID;
//// when we have an active remote environment that we are designing against, set it as local to that environment ;)
if(activeEnvironment.ID == resource.Environment.ID && idToUse != Guid.Empty && !isDesignerLocalhost)
{
idToUse = Guid.Empty;
}
activity.EnvironmentID = idToUse;
}
}
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:15,代码来源:DsfActivityFactory.cs
示例19: GetSources
public override List<UnlimitedObject> GetSources(IEnvironmentModel environmentModel)
{
List<UnlimitedObject> list = new List<UnlimitedObject>();
UnlimitedObject unlimitedObject1 = new UnlimitedObject(@"<Source ID=""6f6fda2f-4060-4c06-bfbb-7a38a1088604"" Version=""1.0"" Name=""MoEmailTest1"" ResourceType=""EmailSource"" ConnectionString=""Host=smtp.mail.yahoo.com;[email protected];Password=Q38qrDmsi36ei1R;Port=25;EnableSsl=False;Timeout=100000"" Type=""EmailSource"" ServerID=""51a58300-7e9d-4927-a57b-e5d700b11b55"">
<DisplayName>MoEmailTest1</DisplayName>
<Category>MoEmailTestSources</Category>
<AuthorRoles></AuthorRoles>
<TypeOf>EmailSource</TypeOf>
<Signature xmlns=""http://www.w3.org/2000/09/xmldsig#"">
<SignedInfo>
<CanonicalizationMethod Algorithm=""http://www.w3.org/TR/2001/REC-xml-c14n-20010315"" />
<SignatureMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#rsa-sha1"" />
<Reference URI="""">
<Transforms>
<Transform Algorithm=""http://www.w3.org/2000/09/xmldsig#enveloped-signature"" />
</Transforms>
<DigestMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#sha1"" />
<DigestValue>mnY5GQkRM6RQpvYYx6p40rmDrWw=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>pMuNyT8uHzb3C++wGl058QdOdRNSxKcTKm7MeqwtRkuiLM9we0EItMyzAEJ/8ZyxZCDUi3GoosCTsND8X+HJh1EmHj6AZJ59PIX+ypZK4d+IGlqSrS29oeVZ1tIKOxIrVxc1HaGfRRibh33mxW/OWFxl7JeQQnLVlQ17SGsTl2s=</SignatureValue>
</Signature>
</Source>");
UnlimitedObject unlimitedObject2 = new UnlimitedObject(@"<Source ID=""8f803242-a0cf-45d1-8449-d4dab2662718"" Version=""1.0"" Name=""MoEmailTest2"" ResourceType=""EmailSource"" ConnectionString=""Host=smtp.mail.yahoo.com;[email protected];Password=Q38qrDmsi36ei1R;Port=25;EnableSsl=False;Timeout=100000"" Type=""EmailSource"" ServerID=""51a58300-7e9d-4927-a57b-e5d700b11b55"">
<DisplayName>MoEmailTest2</DisplayName>
<Category>MoEmailTestSources</Category>
<AuthorRoles></AuthorRoles>
<TypeOf>EmailSource</TypeOf>
<Signature xmlns=""http://www.w3.org/2000/09/xmldsig#"">
<SignedInfo>
<CanonicalizationMethod Algorithm=""http://www.w3.org/TR/2001/REC-xml-c14n-20010315"" />
<SignatureMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#rsa-sha1"" />
<Reference URI="""">
<Transforms>
<Transform Algorithm=""http://www.w3.org/2000/09/xmldsig#enveloped-signature"" />
</Transforms>
<DigestMethod Algorithm=""http://www.w3.org/2000/09/xmldsig#sha1"" />
<DigestValue>epBzm31clckPtICoVs0f5PL36qs=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>Vn6taCw3fFFL/NyuERfgHw0X9+JgeRAkmVWbtDmrhB6LsLB07o/rQXtf/FUJrKa9jDiiyS6G6WVhVYJ/zo3cBXZq6sBzOdYxPQHVtjf322p22rvCRaY3zw2hhZArvyc26YxpX8vjdIYmxPCJ6tbn5Hpg4ftB+ciHTo+MYS7zHN0=</SignatureValue>
</Signature>
</Source>");
list.Add(unlimitedObject1);
list.Add(unlimitedObject2);
return list;
}
开发者ID:FerdinandOlivier,项目名称:Warewolf-ESB,代码行数:47,代码来源:MockDsfSendEmailActivityViewModel.cs
示例20: ShowDecisionDialog
public static Dev2DecisionCallbackHandler ShowDecisionDialog(IEnvironmentModel environment, string webModel)
{
const int DialogWidth = 824;
const int DialogHeight = 510;
var callBackHandler = new Dev2DecisionCallbackHandler { ModelData = webModel };
const string RelativeUriString = "decisions/wizard";
if(!IsTestMode)
{
environment.ShowWebPageDialog(SiteName, RelativeUriString, callBackHandler, DialogWidth, DialogHeight, "Switch Flow");
}
else
{
TestModeRelativeUri = RelativeUriString;
}
return callBackHandler;
}
开发者ID:NatashaSchutte,项目名称:Warewolf-ESB,代码行数:17,代码来源:RootWebSite.cs
注:本文中的IEnvironmentModel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论