private ArtifactBase AddArtifact(ArtifactType type, string name, bool selected = false, ArtifactBase parent = null) { ArtifactBase artifact; switch (type) { case ArtifactType.Root: artifact = new RootArtifact(); break; case ArtifactType.Process: artifact = new ProcessArtifact(); break; default: return(null); } artifact.Name = name; artifact.Parent = parent; artifact.IsExpanded = false; artifact.IsSelected = selected; lock (AccessLock) { _artifacts.Add(artifact); } NotifyPropertyChange("TreeItems"); // this forces the set property / INotifyPropertyCHange NotifyPropertyChange("Processes"); return(artifact); }
public bool ArtifactCodeRuleEditing_PreTransitionCRUD(string transition) { try { switch (transition) { case "Save": Guid artifactTypeId = Guid.Parse(cbbArtifactType.SelectedItem.Value.ToString()); string name = txtArtifactCodeRuleName.Text; string description = txtArtifactCodeRuleDescription.Text; ArtifactType artifactType = session.GetObjectByKey <ArtifactType>(artifactTypeId); Guid artifactCodeRuleId = ArtifactCodeRuleId; ArtifactCodeRule artifactCodeRule = session.GetObjectByKey <ArtifactCodeRule>(artifactCodeRuleId); artifactCodeRule.ArtifactTypeId = artifactType; artifactCodeRule.Description = description; artifactCodeRule.LastUpdateDate = DateTime.Now; artifactCodeRule.Name = name; artifactCodeRule.Save(); break; default: break; } return(true); } catch (Exception ex) { return(false); } }
public string GetArtifactCodeOfArtifactType(ArtifactTypeEnum artifactTypeEnum) { Session session = null; string artifactTypeCode = null; try { session = XpoHelper.GetNewSession(); artifactTypeCode = Enum.GetName(typeof(ArtifactTypeEnum), artifactTypeEnum); ArtifactType artifactType = Util.getXPCollection <ArtifactType>(session, "Code", artifactTypeCode).FirstOrDefault(); return(GetArtifactCodeOfArtifactType(artifactType.ArtifactTypeId)); } catch (Exception) { throw; } finally { if (session != null) { session.Dispose(); } } }
private bool TryGetArtifactType(string artifactTypeReferenceName, out ArtifactType artifactType) { artifactType = null; if (string.IsNullOrEmpty(artifactTypeReferenceName)) { return(false); } bool succeeded = false; foreach (var supportedLinkType in m_supportedLinkTypes) { if (CQStringComparer.LinkArtifactType.Equals(supportedLinkType.Value.SourceArtifactType.ReferenceName, artifactTypeReferenceName)) { succeeded = true; artifactType = supportedLinkType.Value.SourceArtifactType; break; } if (CQStringComparer.LinkArtifactType.Equals(supportedLinkType.Value.TargetArtifactType.ReferenceName, artifactTypeReferenceName)) { succeeded = true; artifactType = supportedLinkType.Value.TargetArtifactType; break; } } return(succeeded); }
public async Task <string> CreateProofTicket(ArtifactType artifact) { var tkt = await TicketSvc.LoadJobTicketAsync( Config.UproduceUsername, Config.UproduceUserPassword, Document.ProofSettingsJobId.ToString()); return(tkt); }
static NuGetClient() { NuGetType = ArtifactType.Register("NuGet", true, ';'); // Workaround for dev/NuGet.Client\src\NuGet.Core\NuGet.Protocol\Plugins\PluginFactory.cs line 161: // FileName = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH"), // This line should be: // FileName = Environment.GetEnvironmentVariable("DOTNET_HOST_PATH") ?? "dotnet", // // Issue: https://github.com/NuGet/Home/issues/7438 // Environment.SetEnvironmentVariable("DOTNET_HOST_PATH", "dotnet"); StaticProviders = new List <Lazy <INuGetResourceProvider> >(); StaticProviders.AddRange(Repository.Provider.GetCoreV3()); _secretKeysLock = new object(); _secretAzureKeys = new Dictionary <string, string>(); HttpHandlerResourceV3.CredentialService = new Lazy <ICredentialService>( () => new CredentialService( providers: new AsyncLazy <IEnumerable <ICredentialProvider> >( () => Task.FromResult <IEnumerable <ICredentialProvider> >( new List <Creds> { new Creds() }) ), nonInteractive: true, handlesDefaultCredentials: true) ); }
/// <summary> /// Adds the reference. /// </summary> /// <param name="fileName">Name of the file.</param> /// <param name="content">The content.</param> /// <param name="scope">The scope.</param> /// <param name="mode">The mode.</param> /// <returns></returns> public Artifact AddReference(string fileName, ArtifactType content, ReferenceScope scope, string mode) { Artifact artifact = FindReference(fileName, content); if (artifact != null) { return(artifact); } using (Transaction transaction = this.Store.TransactionManager.BeginTransaction("Add artifact")) { artifact = new Artifact(this.Store); if (System.IO.Path.IsPathRooted(fileName)) { artifact.Type = content; artifact.FileName = System.IO.Path.GetFileName(fileName); artifact.InitialFileName = fileName; } else { artifact.Type = content; artifact.FileName = fileName; } artifact.Scope = scope; artifact.ConfigurationMode = mode; this.Artifacts.Add(artifact); transaction.Commit(); return(artifact); } }
public ArtifactData() { Type = ArtifactType.None; Size = ArtifactSize.None; Pixels = new List <PixelData>(); Rotation = 0f; }
internal ArtifactMarkedContentElement(int markedContentIdentifier, NameToken tag, DictionaryToken properties, string language, string actualText, string alternateDescription, string expandedForm, ArtifactType artifactType, string subType, string attributeOwners, PdfRectangle?boundingBox, IReadOnlyList <NameToken> attached, IReadOnlyList <MarkedContentElement> children, IReadOnlyList <Letter> letters, IReadOnlyList <PdfPath> paths, IReadOnlyList <IPdfImage> images, int index) : base(markedContentIdentifier, tag, properties, language, actualText, alternateDescription, expandedForm, true, children, letters, paths, images, index) { Type = artifactType; SubType = subType; AttributeOwners = attributeOwners; BoundingBox = boundingBox; Attached = attached ?? EmptyArray <NameToken> .Instance; }
private void CreateArtifact(IWorkspace workspace, Options options, ArtifactType artifactType) { Log.Information("Creating artifact: {Artifact}", artifactType); switch (artifactType) { case ArtifactType.XmlDatafiles: PublishXml(workspace, options); break; case ArtifactType.ZippedXmlDatafiles: PublishXmlZipped(workspace, options); break; case ArtifactType.Index: PublishIndex(workspace, options); break; case ArtifactType.ZippedIndex: PublishIndexZipped(workspace, options); break; case ArtifactType.RepoDistribution: PublishArtifactRepoDistribution(workspace, options); break; default: break; } }
public void CreateMonitoringEntry(ArtifactType artifactType, string artifactName) { if (artifactName != string.Empty) { using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["authStore"].ConnectionString)) { SqlCommand command = new SqlCommand("[dbo].[bcc_MonitoringList_CreateEntry]", connection); command.CommandType = CommandType.StoredProcedure; SqlParameter param = new SqlParameter("@artifactType", Enum.GetName(typeof(ArtifactType), artifactType)); command.Parameters.Add(param); param = new SqlParameter("@artifactName", artifactName); command.Parameters.Add(param); param = new SqlParameter("@artifactDesc", "Notify after 10 seconds."); command.Parameters.Add(param); param = new SqlParameter("@pollingInterval", 10); command.Parameters.Add(param); connection.Open(); command.ExecuteNonQuery(); } } }
private static string GenerateName(ArtifactType artifactType) { string typeSynonim = ""; switch (artifactType) { case ArtifactType.Poison: typeSynonim = poisonSynonims[Random.Range(0, poisonSynonims.Length)]; break; case ArtifactType.Slow: typeSynonim = slowSynonims[Random.Range(0, slowSynonims.Length)]; break; case ArtifactType.Flying: typeSynonim = flyingSynonims[Random.Range(0, flyingSynonims.Length)]; break; case ArtifactType.Null: typeSynonim = nullSynonims[Random.Range(0, nullSynonims.Length)]; break; } if (Random.Range(0, 2) == 0) { return(peopleNames[Random.Range(0, peopleNames.Length)] + "'s " + typeSynonim + " " + artifactSynonims[Random.Range(0, artifactSynonims.Length)]); } else { return(typeSynonim + " " + artifactSynonims[Random.Range(0, artifactSynonims.Length)] + " of " + peopleNames[Random.Range(0, peopleNames.Length)]); } }
public override void PlayerFinishParsing() { PlayerResolveArtifact(); ContainerType = Prep != null ? Prep.ContainerType : (ContainerType)(-1); if (gDobjArtifact != null) { gCommandParser.ObjData = gCommandParser.IobjData; gCommandParser.ObjData.QueryDescFunc = () => string.Format("{0}Put {1} {2} what? ", Environment.NewLine, gDobjArtifact.EvalPlural("it", "them"), Enum.IsDefined(typeof(ContainerType), ContainerType) ? gEngine.EvalContainerType(ContainerType, "inside", "on", "under", "behind") : "in"); PlayerResolveArtifact(); if (gIobjArtifact != null) { if (!Enum.IsDefined(typeof(ContainerType), ContainerType)) { var artTypes = new ArtifactType[] { ArtifactType.InContainer, ArtifactType.OnContainer }; var defaultAc = gIobjArtifact.GetArtifactCategory(artTypes); ContainerType = defaultAc != null?gEngine.GetContainerType(defaultAc.Type) : ContainerType.In; } } } }
static PackageDBTests() { T0 = ArtifactType.Register("T0", true); T1 = ArtifactType.Register("T1", true, ';'); T2 = ArtifactType.Register("T2", true, ','); PLevel0V1 = Create(SVersion.Parse("1.0.0")); PLevel0V2 = Create(SVersion.Parse("2.0.0")); PLevel0V3 = Create(SVersion.Parse("3.0.0")); PLevel0V4 = Create(SVersion.Parse("4.0.0")); PLevel0 = new PackageInfo[][] { PLevel0V1, PLevel0V2, PLevel0V3, PLevel0V4 }; PackageInfo[] Create(SVersion v) { var result = new PackageInfo[60]; for (int i = 0; i < result.Length; ++i) { var type = i < (result.Length / 3) ? T0 : i < (2 * result.Length / 3) ? T1 : T2; var p = new PackageInfo(); p.Key = new ArtifactInstance(type, $"P{i}", v); p.FeedNames.Add($"F{i / (result.Length / 10)}"); result[i] = p; } return(result); } }
public virtual bool IsAttackable01(ref IArtifactCategory ac) { var artTypes = new ArtifactType[] { ArtifactType.DeadBody, ArtifactType.DisguisedMonster, ArtifactType.InContainer, ArtifactType.DoorGate }; ac = GetArtifactCategory(artTypes, false); return(!Globals.IsRulesetVersion(5) && ac != null); }
/// <summary> /// Initializes a new instance of the <see cref="ParseException"/> class. /// </summary> /// <param name="innerException">The inner exception.</param> /// <param name="action">The action.</param> /// <param name="isQuery">if set to <c>true</c> [is query].</param> /// <param name="artifact">The artifact.</param> /// <param name="args">The arguments.</param> public ParseException( Exception innerException, DatasetActionEnumType action, bool isQuery, ArtifactType artifact, params object[] args) : base(innerException, null, null, args) { this._action = action; this._isQuery = isQuery; this._artifact = artifact; }
public virtual bool IsAttackable() { var artTypes = new ArtifactType[] { ArtifactType.DeadBody, ArtifactType.DisguisedMonster, ArtifactType.InContainer, ArtifactType.DoorGate }; var ac = GetArtifactCategory(artTypes); return(ac != null && (ac.Type == ArtifactType.DeadBody || ac.Type == ArtifactType.DisguisedMonster || ac.GetBreakageStrength() >= 1000)); }
public ArtifactInfo(IDataRecord record) { type = record.GetValue <ArtifactType>("id"); goalRange = record.GetValue <int>("goalrange"); npcPresenceId = record.GetValue <int?>("npcpresenceid"); isPersistent = record.GetValue <bool>("persistent"); minimumLoot = record.GetValue <int>("minimumloot"); }
public Artifact(ArtifactType artifactType) { ArtifactType = artifactType; Name = GenerateName(artifactType); Value = GenerateValue(artifactType); Color = new Color(Random.Range(0.5f, 1f), Random.Range(0.5f, 1f), Random.Range(0.5f, 1f)); Sprite = GetSpriteByArtifactType(ArtifactType); }
protected TfsArtifactHandlerBase(ArtifactType handledArtifactType) { if (null == handledArtifactType) { throw new ArgumentNullException("handledArtifactType"); } m_handledArtifactType = handledArtifactType; }
protected bool CanHandleArtifactType(ArtifactType artifactType) { if (null == artifactType) { return(false); } return(CQStringComparer.LinkArtifactType.Equals(artifactType.ReferenceName, m_handledArtifactType.ReferenceName)); }
protected override Artifact Create(ArtifactType type) { if (type == ArtifactType.Actions_Storage) { return(new ActionsStorageArtifact()); } return(null); }
protected override CreateArtifactParameters Create(ArtifactType type) { if (type == ArtifactType.Actions_Storage) { return(new CreateActionsStorageArtifactParameters()); } return(null); }
public Artifact(ArtifactType type, ArtifactRarity rarity, string name, string desc, float amount, Sprite sprite) { this.type = type; this.name = name; this.artifactRarity = rarity; this.description = desc; this.amount = amount; this.sprite = sprite; }
public Artifact(Vector2 position, float layer, float size, ArtifactType type, bool found) { this.position = position; this.layer = layer; this.size = size; this.type = type; this.found = found; //Init(); }
public ArtifactMonitoringEventArgs(ArtifactType artifactType, string artifactName, string receiveLocationName, string artifactURL, string serverName, string hostName, string artifactStatus) { this.artifactName = artifactName; this.receiveLocationName = receiveLocationName; this.artifactURL = artifactURL; this.serverName = serverName; this.hostName = hostName; this.artifactStatus = artifactStatus; this.artifactType = artifactType; }
public override bool TryCreateArtifactFromId(ArtifactType artifactType, string id, out IArtifact artifact) { if (!base.TryCreateArtifactFromId(artifactType, id, out artifact)) { return(false); } artifact = new Toolkit.Linking.Artifact(id, m_handledArtifactType); return(true); }
public override bool TryCreateArtifactFromId(ArtifactType artifactType, string id, out IArtifact artifact) { if (!base.TryCreateArtifactFromId(artifactType, id, out artifact)) { return(false); } artifact = new Toolkit.Linking.Artifact(LinkingConstants.VcRevisionFilePrefix + id, m_handledArtifactType); return(true); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("name"); writer.WriteStringValue(Name.ToString()); writer.WritePropertyName("uri"); writer.WriteStringValue(Uri.AbsoluteUri); writer.WritePropertyName("type"); writer.WriteStringValue(ArtifactType.ToSerialString()); writer.WriteEndObject(); }
int HandleArtifactOfType(ArtifactType artifactType, BoundedContextTopology boundedContextConfiguration, MutableAritfactsDictionary artifactsDictionary, List <string> nonMatchingArtifacts) { var targetProperty = artifactType.TargetPropertyExpression.GetPropertyInfo(); var newArtifacts = 0; var artifacts = _artifacts.Where(_ => artifactType.Type.IsAssignableFrom(_)); foreach (var artifact in artifacts) { var feature = boundedContextConfiguration.FindMatchingFeature(artifact.Namespace, nonMatchingArtifacts); if (feature.Value != null) { MutableArtifactsByTypeDictionary artifactsByType; if (!artifactsDictionary.TryGetValue(feature.Key, out artifactsByType)) { artifactsByType = artifactsDictionary[feature.Key] = new Dictionary <PropertyInfo, Dictionary <ArtifactId, ArtifactDefinition> >(); } Dictionary <ArtifactId, ArtifactDefinition> mutableArtifacts; if (!artifactsByType.TryGetValue(targetProperty, out mutableArtifacts)) { mutableArtifacts = artifactsByType[targetProperty] = new Dictionary <ArtifactId, ArtifactDefinition>(); } if (!mutableArtifacts.Any(_ => _.Value.Type.GetActualType() == artifact)) { var artifactObject = new Dolittle.Artifacts.Artifact(ArtifactId.New(), ArtifactGeneration.First); if (artifact.HasAttribute <ArtifactAttribute>()) { artifactObject = (artifact.GetTypeInfo().GetCustomAttributes(typeof(ArtifactAttribute), false).First() as ArtifactAttribute).Artifact; } AddNewArtifact(artifactObject, artifact, mutableArtifacts, artifactType.TypeName); newArtifacts++; } else { if (artifact.HasAttribute <ArtifactAttribute>()) { var artifactObject = (artifact.GetTypeInfo().GetCustomAttributes(typeof(ArtifactAttribute), false).First() as ArtifactAttribute).Artifact; var existingArtifact = mutableArtifacts.Single(_ => _.Value.Type.GetActualType() == artifact); if (!existingArtifact.Key.Value.Equals(artifactObject.Id.Value)) { mutableArtifacts.Remove(existingArtifact.Key); AddNewArtifact(artifactObject, artifact, mutableArtifacts, artifactType.TypeName); newArtifacts++; } } } } } return(newArtifacts); }
bool InventoryContains(ArtifactType type) { foreach (var artifact in inventory) { if (artifact.type == type) { return(true); } } return(false); }
public static bool EnsureValidPath(ArtifactType artifactType, string path, out string error) { if (string.IsNullOrWhiteSpace(path)) { error = $"Path must be defined for type='{artifactType}'"; return(false); } error = null; return(true); }
public override int GetHashCode() { unchecked { int hashCode = base.GetHashCode(); hashCode = (hashCode * 397) ^ (int)GenerateActionType; hashCode = (hashCode * 397) ^ ChildCount.GetHashCode(); hashCode = (hashCode * 397) ^ (ArtifactType != null ? ArtifactType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ ArtifactTypeId.GetHashCode(); return(hashCode); } }
public List<BCCMonitoringReportEntry> MonitoringDataReport(ArtifactType artifactType, string artifactName, DateTime startDate, DateTime endDate) { List<BCCMonitoringReportEntry> list = null; using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["authStore"].ConnectionString)) { SqlCommand command = new SqlCommand("[dbo].[bcc_MonitoringListData_Report]", connection); command.CommandType = CommandType.StoredProcedure; SqlParameter param = new SqlParameter("@artifactType", Enum.GetName(typeof(ArtifactType), artifactType)); command.Parameters.Add(param); param = new SqlParameter("@artifactName", artifactName); command.Parameters.Add(param); param = new SqlParameter("@startDate", startDate); command.Parameters.Add(param); param = new SqlParameter("@endDate", endDate); command.Parameters.Add(param); connection.Open(); SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); list = new List<BCCMonitoringReportEntry>(); BCCMonitoringReportEntry entry = null; while (reader.Read()) { // Create a new list at every instance. entry = new BCCMonitoringReportEntry(); entry.ArtifactType = (ArtifactType)Enum.Parse(typeof(ArtifactType), (string)reader[0]); entry.ArtifactName = (string)reader[1]; entry.ArtifactStatus = (string)reader[2]; entry.ReportedDate = (DateTime) reader[3]; list.Add(entry); } } return list; }
public void LogMonitoringData(ArtifactType artifactType, string artifactName, string status) { using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["authStore"].ConnectionString)) { SqlCommand command = new SqlCommand("[dbo].[bcc_MonitoringListData_Insert]", connection); command.CommandType = CommandType.StoredProcedure; SqlParameter param = new SqlParameter("@artifactType", Enum.GetName(typeof(ArtifactType), artifactType)); command.Parameters.Add(param); param = new SqlParameter("@artifactName", artifactName); command.Parameters.Add(param); param = new SqlParameter("@status", status); command.Parameters.Add(param); connection.Open(); command.ExecuteNonQuery(); } }
public IvyArtifact(string filename, ArtifactType type) { this.Name = Path.GetFileNameWithoutExtension(filename); this.Extension = Path.GetExtension(filename); this.Type = type; }
public BCCMonitoringEntry(string artifactName, ArtifactType artifactType, int pollingInterval, bool isEnabled, bool isMarkedForDelete) { this.artifactName = artifactName; this.artifactType = artifactType; this.pollingInterval = pollingInterval; this.isEnabled = isEnabled; this.isMarkedForDelete = isMarkedForDelete; }
/// <summary> /// Creates a artifact type query string parameter. /// </summary> /// <param name="type">The value to use in the artifact type query string parameter. See remarks.</param> /// <returns>A artifact type query string parameter.</returns> /// <remarks> /// This could be used, for example, to specify the type of an artifact. /// </remarks> public static QueryParameter ArtifactType(ArtifactType type) { return new QueryParameter(true, TYPE, XmlQNameEnumUtil.GetNameValue(type)); }
public void MonitoringEntryMarkedForDeletion(ArtifactType artifactType, string artifactName) { using (SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["authStore"].ConnectionString)) { SqlCommand command = new SqlCommand("[dbo].[bcc_MonitoringList_MarkedForDelete]", connection); command.CommandType = CommandType.StoredProcedure; SqlParameter param = new SqlParameter("@artifactType", Enum.GetName(typeof(ArtifactType), artifactType)); command.Parameters.Add(param); param = new SqlParameter("@artifactName", artifactName); command.Parameters.Add(param); connection.Open(); command.ExecuteNonQuery(); } }
/// <summary> /// Use to monitor various BizTalk Artifacts /// </summary> /// <param name="artifactType"></param> /// <param name="artifactName"></param> /// <param name="pollIntervalInSecs"></param> public BCCMonitoring(ArtifactType artifactType, string artifactName, int pollIntervalInSecs) { this.artifactType = artifactType; this.artifactName = artifactName; this.pollIntervalInSecs = pollIntervalInSecs; }