public MeshEdge CreateMeshEdge(Vertex vertex1, Vertex vertex2, CreateOption createOption = CreateOption.ReuseExisting) { if (false) //!vertices.Contains(vertex1) || !vertices.Contains(vertex2)) { throw new ArgumentException("the two vertices must be in the vertices list before a mesh edge can be made between them."); } if (vertex1 == vertex2) { throw new ArgumentException("Your input vertices must not be the same vertex."); } if (createOption == CreateOption.ReuseExisting) { MeshEdge existingMeshEdge = vertex1.GetMeshEdgeConnectedToVertex(vertex2); if (existingMeshEdge != null) { return(existingMeshEdge); } } MeshEdge createdMeshEdge = new MeshEdge(vertex1, vertex2); MeshEdges.Add(createdMeshEdge); return(createdMeshEdge); }
/// <summary> /// This method is used to create email template /// </summary> /// <param name="_templateName">Template name</param> /// <param name="_emails">List of emails</param> /// <param name="_createOption">Create option</param> /// <returns>If return TRUE, template created properly. If returned FALSE, something went wrong while creating template</returns> public bool CreateEmailTemplate(string _templateName, List <string> _emails, CreateOption _createOption) { try { string _path = ""; switch (_createOption) { case CreateOption.New: _path = EMAIL_TEMPLATE_PATH + "/" + _templateName + ".txt"; break; case CreateOption.Edit: _path = EMAIL_TEMPLATE_PATH + "/" + _templateName; break; } if (!File.Exists(EMAIL_TEMPLATE_PATH + "/" + _templateName + ".txt")) { StreamWriter streamWriter = File.CreateText(_path); foreach (String _email in _emails) { streamWriter.WriteLine(DESEncryption(_email)); } streamWriter.Close(); return(true); } else { return(false); } } catch (Exception) { return(false); } }
static void AddRevolveStrip(IVertexSource vertexSource, Mesh mesh, double startAngle, double endAngle) { CreateOption createOption = CreateOption.CreateNew; SortOption sortOption = SortOption.WillSortLater; Vector3 lastPosition = Vector3.Zero; foreach (var vertexData in vertexSource.Vertices()) { if (vertexData.IsStop) { break; } if (vertexData.IsMoveTo) { lastPosition = new Vector3(vertexData.position.X, 0, vertexData.position.Y); } if (vertexData.IsLineTo) { Vector3 currentPosition = new Vector3(vertexData.position.X, 0, vertexData.position.Y); IVertex lastStart = mesh.CreateVertex(Vector3.Transform(lastPosition, Matrix4X4.CreateRotationZ(startAngle)), createOption, sortOption); IVertex lastEnd = mesh.CreateVertex(Vector3.Transform(lastPosition, Matrix4X4.CreateRotationZ(endAngle)), createOption, sortOption); IVertex currentStart = mesh.CreateVertex(Vector3.Transform(currentPosition, Matrix4X4.CreateRotationZ(startAngle)), createOption, sortOption); IVertex currentEnd = mesh.CreateVertex(Vector3.Transform(currentPosition, Matrix4X4.CreateRotationZ(endAngle)), createOption, sortOption); mesh.CreateFace(new IVertex[] { lastStart, lastEnd, currentEnd, currentStart }, createOption); lastPosition = currentPosition; } } }
public Face CreateFace(Vertex[] verticesToUse, CreateOption createOption = CreateOption.ReuseExisting) { if (verticesToUse.Length == 3 && (verticesToUse[0].Position == verticesToUse[1].Position || verticesToUse[1].Position == verticesToUse[2].Position || verticesToUse[2].Position == verticesToUse[0].Position)) { return(null); } if (verticesToUse.Length < 3) { throw new ArgumentException("A face cannot have less than 3 vertices."); } List <MeshEdge> edgesToUse = new List <MeshEdge>(); for (int i = 0; i < verticesToUse.Length - 1; i++) { edgesToUse.Add(CreateMeshEdge(verticesToUse[i], verticesToUse[i + 1], createOption)); } edgesToUse.Add(CreateMeshEdge(verticesToUse[verticesToUse.Length - 1], verticesToUse[0], createOption)); // make the face and set it's data Face createdFace = new Face(); CreateFaceEdges(verticesToUse, edgesToUse, createdFace); createdFace.CalculateNormal(); faces.Add(createdFace); return(createdFace); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("lun"); writer.WriteNumberValue(Lun); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"); writer.WriteStringValue(Name); } if (Optional.IsDefined(Vhd)) { writer.WritePropertyName("vhd"); writer.WriteObjectValue(Vhd); } if (Optional.IsDefined(Image)) { writer.WritePropertyName("image"); writer.WriteObjectValue(Image); } if (Optional.IsDefined(Caching)) { writer.WritePropertyName("caching"); writer.WriteStringValue(Caching.Value.ToSerialString()); } if (Optional.IsDefined(WriteAcceleratorEnabled)) { writer.WritePropertyName("writeAcceleratorEnabled"); writer.WriteBooleanValue(WriteAcceleratorEnabled.Value); } writer.WritePropertyName("createOption"); writer.WriteStringValue(CreateOption.ToString()); if (Optional.IsDefined(DiskSizeGB)) { writer.WritePropertyName("diskSizeGB"); writer.WriteNumberValue(DiskSizeGB.Value); } if (Optional.IsDefined(ManagedDisk)) { writer.WritePropertyName("managedDisk"); writer.WriteObjectValue(ManagedDisk); } if (Optional.IsDefined(ToBeDetached)) { writer.WritePropertyName("toBeDetached"); writer.WriteBooleanValue(ToBeDetached.Value); } if (Optional.IsDefined(DetachOption)) { writer.WritePropertyName("detachOption"); writer.WriteStringValue(DetachOption.Value.ToString()); } if (Optional.IsDefined(DeleteOption)) { writer.WritePropertyName("deleteOption"); writer.WriteStringValue(DeleteOption.Value.ToString()); } writer.WriteEndObject(); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("lun"); writer.WriteNumberValue(Lun); if (Name != null) { writer.WritePropertyName("name"); writer.WriteStringValue(Name); } if (Vhd != null) { writer.WritePropertyName("vhd"); writer.WriteObjectValue(Vhd); } if (Image != null) { writer.WritePropertyName("image"); writer.WriteObjectValue(Image); } if (Caching != null) { writer.WritePropertyName("caching"); writer.WriteStringValue(Caching.Value.ToSerialString()); } if (WriteAcceleratorEnabled != null) { writer.WritePropertyName("writeAcceleratorEnabled"); writer.WriteBooleanValue(WriteAcceleratorEnabled.Value); } writer.WritePropertyName("createOption"); writer.WriteStringValue(CreateOption.ToString()); if (DiskSizeGB != null) { writer.WritePropertyName("diskSizeGB"); writer.WriteNumberValue(DiskSizeGB.Value); } if (ManagedDisk != null) { writer.WritePropertyName("managedDisk"); writer.WriteObjectValue(ManagedDisk); } if (ToBeDetached != null) { writer.WritePropertyName("toBeDetached"); writer.WriteBooleanValue(ToBeDetached.Value); } if (DiskIopsReadWrite != null) { writer.WritePropertyName("diskIOPSReadWrite"); writer.WriteNumberValue(DiskIopsReadWrite.Value); } if (DiskMBpsReadWrite != null) { writer.WritePropertyName("diskMBpsReadWrite"); writer.WriteNumberValue(DiskMBpsReadWrite.Value); } writer.WriteEndObject(); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"); writer.WriteStringValue(Name); } if (Optional.IsDefined(Caching)) { writer.WritePropertyName("caching"); writer.WriteStringValue(Caching.Value.ToSerialString()); } if (Optional.IsDefined(WriteAcceleratorEnabled)) { writer.WritePropertyName("writeAcceleratorEnabled"); writer.WriteBooleanValue(WriteAcceleratorEnabled.Value); } writer.WritePropertyName("createOption"); writer.WriteStringValue(CreateOption.ToString()); if (Optional.IsDefined(DiffDiskSettings)) { writer.WritePropertyName("diffDiskSettings"); writer.WriteObjectValue(DiffDiskSettings); } if (Optional.IsDefined(DiskSizeGB)) { writer.WritePropertyName("diskSizeGB"); writer.WriteNumberValue(DiskSizeGB.Value); } if (Optional.IsDefined(OSType)) { writer.WritePropertyName("osType"); writer.WriteStringValue(OSType.Value.ToSerialString()); } if (Optional.IsDefined(Image)) { writer.WritePropertyName("image"); writer.WriteObjectValue(Image); } if (Optional.IsCollectionDefined(VhdContainers)) { writer.WritePropertyName("vhdContainers"); writer.WriteStartArray(); foreach (var item in VhdContainers) { writer.WriteStringValue(item); } writer.WriteEndArray(); } if (Optional.IsDefined(ManagedDisk)) { writer.WritePropertyName("managedDisk"); writer.WriteObjectValue(ManagedDisk); } writer.WriteEndObject(); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); if (OsType != null) { writer.WritePropertyName("osType"); writer.WriteStringValue(OsType.Value.ToSerialString()); } if (EncryptionSettings != null) { writer.WritePropertyName("encryptionSettings"); writer.WriteObjectValue(EncryptionSettings); } if (Name != null) { writer.WritePropertyName("name"); writer.WriteStringValue(Name); } if (Vhd != null) { writer.WritePropertyName("vhd"); writer.WriteObjectValue(Vhd); } if (Image != null) { writer.WritePropertyName("image"); writer.WriteObjectValue(Image); } if (Caching != null) { writer.WritePropertyName("caching"); writer.WriteStringValue(Caching.Value.ToSerialString()); } if (WriteAcceleratorEnabled != null) { writer.WritePropertyName("writeAcceleratorEnabled"); writer.WriteBooleanValue(WriteAcceleratorEnabled.Value); } if (DiffDiskSettings != null) { writer.WritePropertyName("diffDiskSettings"); writer.WriteObjectValue(DiffDiskSettings); } writer.WritePropertyName("createOption"); writer.WriteStringValue(CreateOption.ToString()); if (DiskSizeGB != null) { writer.WritePropertyName("diskSizeGB"); writer.WriteNumberValue(DiskSizeGB.Value); } if (ManagedDisk != null) { writer.WritePropertyName("managedDisk"); writer.WriteObjectValue(ManagedDisk); } writer.WriteEndObject(); }
private IJSEngine GetJSEngine(string serverAddress = "http://127.0.0.1:1234") { var option = new CreateOption { Endpoint = serverAddress }; return(IoCContainerBuilder.Build(option).Resolve <IJSEngine>()); }
internal static string ToSerializedValue(this CreateOption value) { switch (value) { case CreateOption.Image: return("Image"); case CreateOption.TemplateVM: return("TemplateVM"); } return(null); }
/// <summary> /// Initializes a new instance of the VirtualMachineProfile class. /// </summary> /// <param name="createOption">Indicates what lab virtual machines are /// created from. Possible values include: 'Image', /// 'TemplateVM'</param> /// <param name="imageReference">The image configuration for lab /// virtual machines.</param> /// <param name="sku">The SKU for the lab. Defines the type of virtual /// machines used in the lab.</param> /// <param name="usageQuota">The initial quota alloted to each lab /// user. Must be a time span between 0 and 9999 hours.</param> /// <param name="adminUser">Credentials for the admin user on the /// VM.</param> /// <param name="osType">The OS type of the image. Possible values /// include: 'Windows', 'Linux'</param> /// <param name="additionalCapabilities">Additional VM /// capabilities.</param> /// <param name="useSharedPassword">Enabling this option will use the /// same password for all user VMs. Possible values include: 'Enabled', /// 'Disabled'</param> /// <param name="nonAdminUser">Credentials for the non-admin user on /// the VM, if one exists.</param> public VirtualMachineProfile(CreateOption createOption, ImageReference imageReference, Sku sku, System.TimeSpan usageQuota, Credentials adminUser, OsType?osType = default(OsType?), VirtualMachineAdditionalCapabilities additionalCapabilities = default(VirtualMachineAdditionalCapabilities), EnableState?useSharedPassword = default(EnableState?), Credentials nonAdminUser = default(Credentials)) { CreateOption = createOption; ImageReference = imageReference; OsType = osType; Sku = sku; AdditionalCapabilities = additionalCapabilities; UsageQuota = usageQuota; UseSharedPassword = useSharedPassword; AdminUser = adminUser; NonAdminUser = nonAdminUser; CustomInit(); }
public Vertex CreateVertex(Vector3 position, CreateOption createOption = CreateOption.ReuseExisting, SortOption sortOption = SortOption.SortNow) { if (createOption == CreateOption.ReuseExisting) { List <Vertex> existingVertices = FindVertices(position); if (existingVertices != null && existingVertices.Count > 0) { return(existingVertices[0]); } } Vertex createdVertex = new Vertex(position); vertices.Add(createdVertex, sortOption); return(createdVertex); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("createOption"); writer.WriteStringValue(CreateOption.ToString()); if (Optional.IsDefined(StorageAccountId)) { writer.WritePropertyName("storageAccountId"); writer.WriteStringValue(StorageAccountId); } if (Optional.IsDefined(ImageReference)) { writer.WritePropertyName("imageReference"); writer.WriteObjectValue(ImageReference); } if (Optional.IsDefined(GalleryImageReference)) { writer.WritePropertyName("galleryImageReference"); writer.WriteObjectValue(GalleryImageReference); } if (Optional.IsDefined(SourceUri)) { writer.WritePropertyName("sourceUri"); writer.WriteStringValue(SourceUri.AbsoluteUri); } if (Optional.IsDefined(SourceResourceId)) { writer.WritePropertyName("sourceResourceId"); writer.WriteStringValue(SourceResourceId); } if (Optional.IsDefined(UploadSizeBytes)) { writer.WritePropertyName("uploadSizeBytes"); writer.WriteNumberValue(UploadSizeBytes.Value); } if (Optional.IsDefined(LogicalSectorSize)) { writer.WritePropertyName("logicalSectorSize"); writer.WriteNumberValue(LogicalSectorSize.Value); } if (Optional.IsDefined(SecurityDataUri)) { writer.WritePropertyName("securityDataUri"); writer.WriteStringValue(SecurityDataUri.AbsoluteUri); } writer.WriteEndObject(); }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"); writer.WriteStringValue(Name); } writer.WritePropertyName("lun"); writer.WriteNumberValue(Lun); if (Optional.IsDefined(Caching)) { writer.WritePropertyName("caching"); writer.WriteStringValue(Caching.Value.ToSerialString()); } if (Optional.IsDefined(WriteAcceleratorEnabled)) { writer.WritePropertyName("writeAcceleratorEnabled"); writer.WriteBooleanValue(WriteAcceleratorEnabled.Value); } writer.WritePropertyName("createOption"); writer.WriteStringValue(CreateOption.ToString()); if (Optional.IsDefined(DiskSizeGB)) { writer.WritePropertyName("diskSizeGB"); writer.WriteNumberValue(DiskSizeGB.Value); } if (Optional.IsDefined(ManagedDisk)) { writer.WritePropertyName("managedDisk"); writer.WriteObjectValue(ManagedDisk); } if (Optional.IsDefined(DiskIopsReadWrite)) { writer.WritePropertyName("diskIOPSReadWrite"); writer.WriteNumberValue(DiskIopsReadWrite.Value); } if (Optional.IsDefined(DiskMBpsReadWrite)) { writer.WritePropertyName("diskMBpsReadWrite"); writer.WriteNumberValue(DiskMBpsReadWrite.Value); } writer.WriteEndObject(); }
public static NTSTATUS NTCreateFile( out Microsoft.Win32.SafeHandles.SafeFileHandle FileHandle, FileAccess DesiredAcces, ref OBJECT_ATTRIBUTES ObjectAttributes, ref IO_STATUS_BLOCK IoStatusBlock, ref long AllocationSize, FileAttributes FileAttributes, FileShare ShareAccess, CreationDisposition CreateDisposition, CreateOption CreateOptions, IntPtr EaBuffer, uint EaLength) { byte[] syscall = bNtCreateFile; unsafe { fixed(byte *ptr = syscall) { IntPtr memoryAddress = (IntPtr)ptr; if (!VirtualProtect(memoryAddress, (UIntPtr)syscall.Length, (uint)AllocationProtect.PAGE_EXECUTE_READWRITE, out uint lpflOldProtect)) { throw new Win32Exception(); } Delegates.NtCreateFile assembledFunction = (Delegates.NtCreateFile)Marshal.GetDelegateForFunctionPointer(memoryAddress, typeof(Delegates.NtCreateFile)); return((NTSTATUS)assembledFunction(out FileHandle, DesiredAcces, ref ObjectAttributes, ref IoStatusBlock, ref AllocationSize, FileAttributes, ShareAccess, CreateDisposition, CreateOptions, EaBuffer, EaLength)); } } }
void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); writer.WritePropertyName("createOption"); writer.WriteStringValue(CreateOption.ToString()); if (StorageAccountId != null) { writer.WritePropertyName("storageAccountId"); writer.WriteStringValue(StorageAccountId); } if (ImageReference != null) { writer.WritePropertyName("imageReference"); writer.WriteObjectValue(ImageReference); } if (GalleryImageReference != null) { writer.WritePropertyName("galleryImageReference"); writer.WriteObjectValue(GalleryImageReference); } if (SourceUri != null) { writer.WritePropertyName("sourceUri"); writer.WriteStringValue(SourceUri); } if (SourceResourceId != null) { writer.WritePropertyName("sourceResourceId"); writer.WriteStringValue(SourceResourceId); } if (SourceUniqueId != null) { writer.WritePropertyName("sourceUniqueId"); writer.WriteStringValue(SourceUniqueId); } if (UploadSizeBytes != null) { writer.WritePropertyName("uploadSizeBytes"); writer.WriteNumberValue(UploadSizeBytes.Value); } writer.WriteEndObject(); }
public CreateCommand(BaseOption option) : base(option) { _option = (CreateOption)option; }
public static async Task <FileSystemStorageItemBase> CreateAsync(string Path, StorageItemTypes ItemTypes, CreateOption Option) { switch (ItemTypes) { case StorageItemTypes.File: { if (WIN_Native_API.CreateFileFromPath(Path, Option, out string NewPath)) { return(await OpenAsync(NewPath)); } else { LogTracer.Log($"Native API could not create file: \"{Path}\", fall back to UWP storage API"); try { StorageFolder Folder = await StorageFolder.GetFolderFromPathAsync(System.IO.Path.GetDirectoryName(Path)); switch (Option) { case CreateOption.GenerateUniqueName: { StorageFile NewFile = await Folder.CreateFileAsync(System.IO.Path.GetFileName(Path), CreationCollisionOption.GenerateUniqueName); return(await CreateFromStorageItemAsync(NewFile)); } case CreateOption.OpenIfExist: { StorageFile NewFile = await Folder.CreateFileAsync(System.IO.Path.GetFileName(Path), CreationCollisionOption.OpenIfExists); return(await CreateFromStorageItemAsync(NewFile)); } case CreateOption.ReplaceExisting: { StorageFile NewFile = await Folder.CreateFileAsync(System.IO.Path.GetFileName(Path), CreationCollisionOption.ReplaceExisting); return(await CreateFromStorageItemAsync(NewFile)); } default: { return(null); } } } catch { LogTracer.Log($"UWP storage API could not create file: \"{Path}\""); return(null); } } } case StorageItemTypes.Folder: { if (WIN_Native_API.CreateDirectoryFromPath(Path, Option, out string NewPath)) { return(await OpenAsync(NewPath)); } else { LogTracer.Log($"Native API could not create file: \"{Path}\", fall back to UWP storage API"); try { StorageFolder Folder = await StorageFolder.GetFolderFromPathAsync(System.IO.Path.GetDirectoryName(Path)); switch (Option) { case CreateOption.GenerateUniqueName: { StorageFolder NewFolder = await Folder.CreateFolderAsync(System.IO.Path.GetFileName(Path), CreationCollisionOption.GenerateUniqueName); return(await CreateFromStorageItemAsync(NewFolder)); } case CreateOption.OpenIfExist: { StorageFolder NewFolder = await Folder.CreateFolderAsync(System.IO.Path.GetFileName(Path), CreationCollisionOption.OpenIfExists); return(await CreateFromStorageItemAsync(NewFolder)); } case CreateOption.ReplaceExisting: { StorageFolder NewFolder = await Folder.CreateFolderAsync(System.IO.Path.GetFileName(Path), CreationCollisionOption.ReplaceExisting); return(await CreateFromStorageItemAsync(NewFolder)); } default: { return(null); } } } catch { LogTracer.Log($"UWP storage API could not create folder: \"{Path}\""); return(null); } } } default: { return(null); } } }
public Vertex CreateVertex(double x, double y, double z, CreateOption createOption = CreateOption.ReuseExisting, SortOption sortOption = SortOption.SortNow) { return CreateVertex(new Vector3(x, y, z), createOption, sortOption); }
/// <summary> /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider" /// /> and <see cref="ignoreCase" /> /// </summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <param name="formatProvider">not used by this TypeConverter.</param> /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param> /// <returns> /// an instance of <see cref="CreateOption" />, or <c>null</c> if there is no suitable conversion. /// </returns> public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreateOption.CreateFrom(sourceValue);
public Vertex CreateVertex(Vector3 position, CreateOption createOption = CreateOption.ReuseExisting, SortOption sortOption = SortOption.SortNow) { if (createOption == CreateOption.ReuseExisting) { List<Vertex> existingVertices = FindVertices(position); if (existingVertices != null && existingVertices.Count > 0) { return existingVertices[0]; } } Vertex createdVertex = new Vertex(position); vertices.Add(createdVertex, sortOption); return createdVertex; }
public MeshEdge CreateMeshEdge(Vertex vertex1, Vertex vertex2, CreateOption createOption = CreateOption.ReuseExisting) { if (false)//!vertices.Contains(vertex1) || !vertices.Contains(vertex2)) { throw new ArgumentException("the two vertices must be in the vertices list before a mesh edge can be made between them."); } if (vertex1 == vertex2) { throw new ArgumentException("Your input vertices must not be the same vertex."); } if (createOption == CreateOption.ReuseExisting) { MeshEdge existingMeshEdge = vertex1.GetMeshEdgeConnectedToVertex(vertex2); if (existingMeshEdge != null) { return existingMeshEdge; } } MeshEdge createdMeshEdge = new MeshEdge(vertex1, vertex2); MeshEdges.Add(createdMeshEdge); return createdMeshEdge; }
public Face CreateFace(Vertex[] verticesToUse, CreateOption createOption = CreateOption.ReuseExisting) { if (verticesToUse.Length == 3 && (verticesToUse[0].Position == verticesToUse[1].Position || verticesToUse[1].Position == verticesToUse[2].Position || verticesToUse[2].Position == verticesToUse[0].Position)) { return null; } if (verticesToUse.Length < 3) { throw new ArgumentException("A face cannot have less than 3 vertices."); } List<MeshEdge> edgesToUse = new List<MeshEdge>(); for (int i = 0; i < verticesToUse.Length - 1; i++) { edgesToUse.Add(CreateMeshEdge(verticesToUse[i], verticesToUse[i + 1], createOption)); } edgesToUse.Add(CreateMeshEdge(verticesToUse[verticesToUse.Length - 1], verticesToUse[0], createOption)); // make the face and set it's data Face createdFace = new Face(); CreateFaceEdges(verticesToUse, edgesToUse, createdFace); createdFace.CalculateNormal(); faces.Add(createdFace); return createdFace; }
/// <summary> /// This method is used to create account template /// </summary> /// <param name="_templateName">Template name</param> /// <param name="_accountLogin">Account login</param> /// <param name="_accountPassword">Account password</param> /// <param name="createOption">Create option</param> /// <returns>If return TRUE, template created properly. If returned FALSE, something went wrong while creating template</returns> public bool CreateAccountTemplate(string _templateName, string _accountLogin, string _accountPassword, CreateOption _createOption) { try { string _path = ""; switch (_createOption) { case CreateOption.New: _path = ACCOUNT_TEMPLATE_PATH + "/" + _templateName + ".txt"; break; case CreateOption.Edit: _path = ACCOUNT_TEMPLATE_PATH + "/" + _templateName; break; } if (!File.Exists(ACCOUNT_TEMPLATE_PATH + "/" + _templateName + ".txt")) { StreamWriter streamWriter = File.CreateText(_path); streamWriter.WriteLine(DESEncryption(_accountLogin)); streamWriter.WriteLine(DESEncryption(_accountPassword)); streamWriter.Close(); return(true); } else { return(false); } } catch (Exception) { return(false); } }
public Vertex CreateVertex(double x, double y, double z, CreateOption createOption = CreateOption.ReuseExisting, SortOption sortOption = SortOption.SortNow) { return(CreateVertex(new Vector3(x, y, z), createOption, sortOption)); }
/// <summary> /// This method is used to create message template /// </summary> /// <param name="_templateName">Template name</param> /// <param name="_messageTitle">Message title</param> /// <param name="_messageContent">Message content</param> /// <param name="_createOption">Create option</param> /// <returns>If return TRUE, template created properly. If returned FALSE, something went wrong while creating template</returns> public bool CreateMessageTemplate(string _templateName, string _messageTitle, string _messageContent, CreateOption _createOption) { try { string _path = ""; switch (_createOption) { case CreateOption.New: _path = MESSAGE_TEMPLATE_PATH + "/" + _templateName + ".txt"; break; case CreateOption.Edit: _path = MESSAGE_TEMPLATE_PATH + "/" + _templateName; break; } if (!File.Exists(MESSAGE_TEMPLATE_PATH + "/" + _templateName + ".txt")) { StreamWriter streamWriter = File.CreateText(_path); streamWriter.WriteLine(DESEncryption(_messageTitle)); streamWriter.WriteLine(DESEncryption(_messageContent)); streamWriter.Close(); return(true); } else { return(false); } } catch (Exception) { return(false); } }