private static void SetRadiatorBuildStatusColor(ImageIndex overallImageIndex) { try { string userName = ConfigurationManager.AppSettings["RadiatorUserName"]; string domain = ConfigurationManager.AppSettings["RadiatorDomain"]; string password = ConfigurationManager.AppSettings["RadiatorPassword"]; using (new Impersonator(userName, domain, password)) { string buildStatusColorCss = string.Format(".buildStatusColor {{ background-color: {0}; }}", overallImageIndex); string cssFilePath = ConfigurationManager.AppSettings["RadiatorCssFilePath"]; string cssFileContents = File.ReadAllText(cssFilePath); cssFileContents = cssFileContents.Replace(".buildStatusColor { background-color: Red; }", buildStatusColorCss); cssFileContents = cssFileContents.Replace(".buildStatusColor { background-color: Yellow; }", buildStatusColorCss); cssFileContents = cssFileContents.Replace(".buildStatusColor { background-color: Green; }", buildStatusColorCss); File.WriteAllText(cssFilePath, cssFileContents); } } catch { } }
public SCUMM1ChunkSpec(string id, string description, bool hasChildren, ImageIndex imageIndex) { this.Id = id; this.Description = description; this.HasChildren = hasChildren; this.ImageIndex = imageIndex; }
private static ImageUpload GetImageUpload(List <Files> img, ImageIndex index) { ImageUpload imageUpload = new ImageUpload(); imageUpload.IndexId = index.Id; imageUpload.DivisonCode = index.DivisonCode; imageUpload.DepartmentCode = index.DepartmentCode; imageUpload.GOCode = index.GOCode; imageUpload.SubjectCode = index.SubjectCode; imageUpload.FileCode = index.FileCode; imageUpload.DeskCode = index.DeskCode; imageUpload.LetterNo = index.LetterNo; imageUpload.FileOpenYear = index.FileOpenYear; imageUpload.MeetingMinute = index.MeetingMinute; imageUpload.MinuteYear = index.MinuteYear; imageUpload.IsInformattedLetterNo = index.InformattedLetterNo != null; imageUpload.InformattedLetterNo = index.InformattedLetterNo; imageUpload.Keyword = index.Keyword; imageUpload.Subject = index.Subject; imageUpload.FileType = (index.IsMeetingMinute ?? false) == false ? "Minute" : "Letter"; imageUpload.UploadedDate = index.UploadedDate; if (img != null) { imageUpload.Files = img; } return(imageUpload); }
private static ImageUpload GetImageUpload(List <Image> lstImage, ImageIndex index) { ImageUpload imageUpload = new ImageUpload(); var img = lstImage.Where(a => a.IndexId == index.Id).Select(s => new Files { Id = s.Id.ToString(), Name = s.FileName, File = s.Photo }).ToList(); imageUpload.IndexId = index.Id; imageUpload.DivisonCode = index.DivisonCode; imageUpload.DepartmentCode = index.DepartmentCode; imageUpload.SubjectCode = index.SubjectCode; imageUpload.GOCode = index.GOCode; imageUpload.FileCode = index.FileCode; imageUpload.DeskCode = index.DeskCode; imageUpload.LetterNo = index.LetterNo; imageUpload.FileOpenYear = index.FileOpenYear; imageUpload.MeetingMinute = index.MeetingMinute; imageUpload.FileType = (index.IsMeetingMinute ?? false) == false ? "Letter" : "Minute"; imageUpload.MinuteYear = index.MinuteYear; imageUpload.IsInformattedLetterNo = index.InformattedLetterNo != null; imageUpload.InformattedLetterNo = index.InformattedLetterNo; imageUpload.Keyword = index.Keyword; imageUpload.Subject = index.Subject; imageUpload.UploadedDate = index.UploadedDate; if (img != null) { //imageUpload.Files = img; } return(imageUpload); }
public int Compare(object x, object y) { TreeNode tx = (TreeNode)x; TreeNode ty = (TreeNode)y; ImageIndex ix = (ImageIndex)tx.ImageIndex; ImageIndex iy = (ImageIndex)ty.ImageIndex; // we want to display all namespaces before all types if (ix == ImageIndex.Namespace && iy != ImageIndex.Namespace) { return(-1); } if (iy == ImageIndex.Namespace && ix != ImageIndex.Namespace) { return(1); } // we want to display all nested types before all methods if (IsType(ix) && !IsType(iy)) { return(-1); } if (IsType(iy) && !IsType(ix)) { return(1); } return(String.Compare(tx.Text, ty.Text)); }
public override object Clone() { FuzzyData.FuzzyString n = ImageName == null ? null : ImageName.Clone() as FuzzyData.FuzzyString; FuzzyData.FuzzyFixnum i = ImageIndex == null ? null : ImageIndex.Clone() as FuzzyData.FuzzyFixnum; FuzzyData.FuzzyFixnum h = ImageHue == null ? null : ImageHue.Clone() as FuzzyData.FuzzyFixnum; return(new AdvanceImage(n, i, h)); }
private static TreeNode CreateTreeNode(string text, ImageIndex imageIndex) { TreeNode node = new TreeNode(text, (int)imageIndex, (int)imageIndex); node.Name = text; return(node); }
public ImageUpload GetImageIndexById(string id) { Guid indexId = Guid.Empty; try { indexId = new Guid(id); } catch (Exception ex) { Console.WriteLine(ex); throw new Exception("Index Id not found"); } ImageIndex imageIndex = context.ImageIndexes.Find(indexId); if (imageIndex == null) { throw new Exception("Document not found"); } var images = context.Images.Where(a => a.IndexId == indexId).Select(s => new Files { Id = s.Id.ToString(), Name = s.FileName }).ToList(); if (images == null || images.Count <= 0) { throw new Exception("Document image not found"); } ImageUpload imageUpload = GetImageUpload(images, imageIndex); return(imageUpload); }
public IActionResult Index(string message) { ImageIndex viewModel = new ImageIndex(); viewModel.Message = message; try { FindActiveTagsQuery query = new FindActiveTagsQuery(); this.service.FindActiveTags(query); if (query.Response == EventMessage.SUCCESS) { viewModel.TagFilterIds = new Guid[query.Tags.Count]; viewModel.TagFilters = new string[query.Tags.Count]; for (int i = 0; i < query.Tags.Count; i++) { viewModel.TagFilterIds[i] = query.Tags[i].TagId; viewModel.TagFilters[i] = query.Tags[i].Name; } } else { throw new ArgumentException(EventMessage.ERROR, "Business Logic Error"); } } catch (Exception ex) { throw ex; } return(View(viewModel)); }
// This registers an XPM image for the markes list private unsafe void RegisterMarkerImage(ImageIndex index, byte[] imagedata) { // Convert to string string bigstring = Encoding.UTF8.GetString(imagedata); // Register image scriptedit.MarkerDefinePixmap((int)index, bigstring); }
// This registers an XPM image for the autocomplete list private unsafe void RegisterAutoCompleteImage(ImageIndex index, byte[] imagedata) { // Convert to string string bigstring = Encoding.UTF8.GetString(imagedata); // Register image scriptedit.RegisterImage((int)index, bigstring); }
public SCUMM5ChunkSpec(string id, string description, bool hasChildren, SizeFormat sizeFormat, ImageIndex imageIndex) { this.Id = id; this.Description = description; this.HasChildren = hasChildren; this.SizeFormat = sizeFormat; this.ImageIndex = imageIndex; }
public SCUMM3ChunkSpec(string id, string description, bool hasChildren, uint childOffset, ImageIndex imageIndex) { this.Id = id; this.Description = description; this.HasChildren = hasChildren; this.ChildOffset = childOffset; this.ImageIndex = imageIndex; }
public static void SetUnmaskImage(Sprite s) { if (mask == null) { Init(); } unmask.sprite = s; CurrentUnmask = ImageIndex.OTHER; }
// 直接マテリアルを設定する。 public static void SetImage(Sprite s) { if (mask == null) { Init(); } image.sprite = s; CurrentImage = ImageIndex.OTHER; }
private void ShowBuilds() { while (true) { try { ClearItems(); ImageIndex overallImageIndex = ImageIndex.Green; string culprit = ""; foreach (ServerBuild serverBuild in _serverBuilds) { IBuildServer buildServer = GetBuildServer(serverBuild.ServerUri.ToString()); IBuildDefinition buildDefinition = buildServer.QueryBuildDefinitionsByUri(new[] { serverBuild.BuildUri })[0]; string[] buildInformation = new string[2]; buildInformation[0] = buildDefinition.Name; IBuildDetail lastBuildDetails = buildServer.QueryBuildsByUri(new[] { buildDefinition.LastBuildUri }, null, QueryOptions.None)[0]; if (lastBuildDetails != null) { buildInformation[1] = lastBuildDetails.Status.ToString(); } ImageIndex imageIndex = lastBuildDetails == null ? ImageIndex.Red : GetImageIndex(lastBuildDetails.Status); ListViewItem listViewItem = new ListViewItem(buildInformation, (int)imageIndex) { Tag = serverBuild }; AddItem(listViewItem); if (imageIndex == ImageIndex.Red) { overallImageIndex = ImageIndex.Red; culprit = lastBuildDetails == null ? "Unable to find build" : lastBuildDetails.RequestedFor; } else if (imageIndex == ImageIndex.Yellow && overallImageIndex == ImageIndex.Green) { overallImageIndex = ImageIndex.Yellow; } } SetSystemTrayIcon(overallImageIndex); // SetX10IntegrationStatus(overallImageIndex); if (overallImageIndex != _lastBuildStatus) { SetRadiatorBuildStatusColor(overallImageIndex); AnnounceCulprit(culprit); _lastBuildStatus = overallImageIndex; } } catch (Exception exception) { Console.WriteLine(exception); } Thread.Sleep(5000); } }
public Completion Execute(ExecutionEnvironment enviroment) { if (ImageIndex == null) { return(Completion.Void); } var c = ImageIndex.Execute(enviroment); if (c.Type != CompletionType.Value) { return(c); } int currentIndex = 0; Sprite sp = enviroment.GetValue("$$INSTANCE$$") as Sprite; if (TypeConverters.IsNumber(c.ReturnValue)) { try { currentIndex = TypeConverters.GetValue <int>(c.ReturnValue); } catch { return(Completion.Exception("Wrong number format", ImageIndex)); } } else { string name = c.ReturnValue + ""; int i = 0; foreach (Resource r in sp.Images) { if (r.DisplayName == name) { currentIndex = i; } i++; } } if (currentIndex < 0) { currentIndex = 0; } if (currentIndex >= sp.Images.Count) { currentIndex = 0; } sp.CurrentImage = currentIndex; App.Current.Dispatcher.InvokeAsync(new Action(() => { (enviroment.GetValue("$$Player") as ScriptPlayer).DrawScript(); })); return(Completion.Void); }
// インデックスから表示する画像を選択する(同時に表示できるのは1枚)。 public static void SetImage(ImageIndex index) { if (mask == null) { Init(); } if (ImageIndex.NONE <= index) { image.sprite = null; return; } image.sprite = imageList[(int)index]; CurrentImage = index; }
public Guid UpdateImageIndex(ImageUpload upload, string username) { ImageIndex image = context.ImageIndexes.FirstOrDefault(a => a.DivisonCode == upload.DivisonCode && a.DepartmentCode == upload.DepartmentCode && a.GOCode == upload.GOCode && a.DeskCode == upload.DeskCode && a.SubjectCode == upload.SubjectCode && a.FileCode == upload.FileCode && a.FileOpenYear == upload.FileOpenYear && a.LetterNo == upload.LetterNo); if (image == null) { throw new Exception("Document not found to update"); } ImageIndex imageIndex = null; if (!upload.IsMeetingMinute && !string.IsNullOrEmpty(upload.MeetingMinute) && !string.IsNullOrEmpty(upload.MinuteYear)) { imageIndex = context.ImageIndexes.FirstOrDefault(a => a.FileOpenYear == upload.MinuteYear && a.LetterNo == upload.MeetingMinute && a.IsMeetingMinute == true); if (imageIndex == null) { throw new Exception($"Meeting not found by {upload.ParentMinute}"); } } image.IsMeetingMinute = upload.IsMeetingMinute; image.InformattedLetterNo = upload.InformattedLetterNo; image.Subject = upload.Subject; image.UploadedDate = upload.UploadedDate; image.Keyword = upload.Keyword; image.MinuteYear = upload.MinuteYear; image.MeetingMinute = upload.MeetingMinute; if (imageIndex != null) { image.ParentId = imageIndex.Id; } image.Status = (int)StatusEnum.Active; image.UpdatedBy = username; image.UpdatedDate = DateConverter.GetLocalZoneDate(DateTime.UtcNow); //update when host in remote. context.Entry(image).State = System.Data.Entity.EntityState.Modified; context.SaveChanges(); //InsertImage(upload, image.Id); context.SaveChanges(); return(image.Id); }
public static void SetUnmaskImage(ImageIndex index) { if (mask == null) { Init(); } if (ImageIndex.NONE <= index) { unmask.sprite = null; unmask.gameObject.SetActive(false); return; } unmask.sprite = imageList[(int)index]; CurrentUnmask = index; }
public override int GetHashCode() { int i = 0; if (ImageName != null) { i += ImageName.GetHashCode(); } if (ImageIndex != null) { i += ImageIndex.GetHashCode(); } if (ImageHue != null) { i += ImageHue.GetHashCode(); } return(i); }
public Guid InsertImageIndex(ImageUpload upload, string username) { ImageIndex imageIndex = null; if (!upload.IsMeetingMinute && !string.IsNullOrEmpty(upload.MeetingMinute) && !string.IsNullOrEmpty(upload.MinuteYear)) { imageIndex = context.ImageIndexes.FirstOrDefault(a => a.FileOpenYear == upload.MinuteYear && a.LetterNo == upload.MeetingMinute && a.IsMeetingMinute == true); if (imageIndex == null) { throw new Exception($"Meeting minute not found"); } } ImageIndex image = new ImageIndex(); image.Id = Guid.NewGuid(); image.IsMeetingMinute = upload.IsMeetingMinute; image.InformattedLetterNo = upload.InformattedLetterNo; image.Subject = upload.Subject; image.UploadedDate = upload.UploadedDate; image.Keyword = upload.Keyword; image.LetterNo = upload.LetterNo; image.DivisonCode = upload.DivisonCode; image.DepartmentCode = upload.DepartmentCode; image.GOCode = upload.GOCode; image.DeskCode = upload.DeskCode; image.SubjectCode = upload.SubjectCode; image.FileCode = upload.FileCode; image.FileOpenYear = upload.FileOpenYear; image.MinuteYear = upload.MinuteYear; image.MeetingMinute = upload.MeetingMinute; if (imageIndex != null) { image.ParentId = imageIndex.Id; } image.Status = (int)StatusEnum.Active; image.CreatedBy = username; image.CreatedDate = DateConverter.GetLocalZoneDate(DateTime.UtcNow); //update when host in remote. context.ImageIndexes.Add(image); context.SaveChanges(); return(image.Id); }
/// <summary> /// Serves as a hash function for a particular type. /// </summary> /// <returns>A hash code for the current <see cref="T:System.Object"/>.</returns> public override int GetHashCode() { return(Architecture.GetHashCode() ^ Bootable.GetHashCode() ^ CustomizedInfo.GetHashCode() ^ DefaultLanguageIndex ^ (String.IsNullOrEmpty(EditionId) ? 0 : EditionId.GetHashCode()) ^ (String.IsNullOrEmpty(Hal) ? 0 : Hal.GetHashCode()) ^ (String.IsNullOrEmpty(ImageDescription) ? 0 : ImageDescription.GetHashCode()) ^ ImageIndex.GetHashCode() ^ ImageType.GetHashCode() ^ (String.IsNullOrEmpty(InstallationType) ? 0 : InstallationType.GetHashCode()) ^ Languages.GetHashCode() ^ (String.IsNullOrEmpty(ProductName) ? 0 : ProductName.GetHashCode()) ^ (String.IsNullOrEmpty(ProductSuite) ? 0 : ProductSuite.GetHashCode()) ^ (String.IsNullOrEmpty(ProductType) ? 0 : ProductType.GetHashCode()) ^ ProductVersion.GetHashCode() ^ SpLevel.GetHashCode() ^ (String.IsNullOrEmpty(SystemRoot) ? 0 : SystemRoot.GetHashCode())); }
private void SetSystemTrayIcon(ImageIndex imageIndex) { string imageResourceString; switch (imageIndex) { case ImageIndex.Green: imageResourceString = "CCTfsWrapper.Images.GreenBall.ico"; break; case ImageIndex.Yellow: imageResourceString = "CCTfsWrapper.Images.GreenBall.ico"; break; default: imageResourceString = "CCTfsWrapper.Images.RedBall.ico"; break; } Stream iconStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(imageResourceString); systemTrayNotifyIcon.Icon = new Icon(iconStream); }
private void populateComboBoxFromDirectory(MsDataFileUri directory) { lookInComboBox.SuspendLayout(); // remove old drive entries while (lookInComboBox.Items.Count > _specialFolderCount) { lookInComboBox.Items.RemoveAt(_specialFolderCount); } TreeNode myComputerNode = (TreeNode)lookInComboBox.Items[_myComputerIndex]; DirectoryInfo dirInfo = null; if (directory is MsDataFilePath) { MsDataFilePath msDataFilePath = (MsDataFilePath)directory; if (!string.IsNullOrEmpty(msDataFilePath.FilePath)) { dirInfo = new DirectoryInfo(msDataFilePath.FilePath); } } if (dirInfo == null) { if (directory is RemoteUrl) { lookInComboBox.SelectedIndex = _remoteIndex; } else { lookInComboBox.SelectedIndex = _myComputerIndex; } } int driveCount = 0; foreach (DriveInfo driveInfo in DriveInfo.GetDrives()) { string label = string.Empty; string sublabel = driveInfo.Name; ImageIndex imageIndex = ImageIndex.Folder; ++driveCount; _driveReadiness[sublabel] = false; try { switch (driveInfo.DriveType) { case DriveType.Fixed: imageIndex = ImageIndex.LocalDrive; label = Resources.OpenDataSourceDialog_populateComboBoxFromDirectory_Local_Drive; if (driveInfo.VolumeLabel.Length > 0) { label = driveInfo.VolumeLabel; } break; case DriveType.CDRom: imageIndex = ImageIndex.OpticalDrive; label = Resources.OpenDataSourceDialog_populateComboBoxFromDirectory_Optical_Drive; if (driveInfo.IsReady && driveInfo.VolumeLabel.Length > 0) { label = driveInfo.VolumeLabel; } break; case DriveType.Removable: imageIndex = ImageIndex.OpticalDrive; label = Resources.OpenDataSourceDialog_populateComboBoxFromDirectory_Removable_Drive; if (driveInfo.IsReady && driveInfo.VolumeLabel.Length > 0) { label = driveInfo.VolumeLabel; } break; case DriveType.Network: label = Resources.OpenDataSourceDialog_populateComboBoxFromDirectory_Network_Share; break; } _driveReadiness[sublabel] = IsDriveReady(driveInfo); } catch (Exception) { label += string.Format(@" ({0})", Resources.OpenDataSourceDialog_populateComboBoxFromDirectory_access_failure); } TreeNode driveNode = myComputerNode.Nodes.Add(sublabel, label.Length > 0 ? String.Format(@"{0} ({1})", label, sublabel) : sublabel, (int)imageIndex, (int)imageIndex); driveNode.Tag = new MsDataFilePath(sublabel); lookInComboBox.Items.Insert(_specialFolderCount + driveCount - 1, driveNode); if (dirInfo != null && sublabel == dirInfo.Root.Name) { List <string> branches = new List <string>(((MsDataFilePath)directory).FilePath.Split(new[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries)); TreeNode pathNode = driveNode; for (int i = 1; i < branches.Count; ++i) { ++driveCount; pathNode = pathNode.Nodes.Add(branches[i], branches[i], 8, 8); pathNode.Tag = new MsDataFilePath(String.Join(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture), branches.GetRange(0, i + 1).ToArray())); lookInComboBox.Items.Insert(_specialFolderCount + driveCount - 1, pathNode); } lookInComboBox.SelectedIndex = _specialFolderCount + driveCount - 1; } } //desktopNode.Nodes.Add( "My Network Places", "My Network Places", 4, 4 ).Tag = "My Network Places"; lookInComboBox.DropDownHeight = lookInComboBox.Items.Count * 18 + 2; lookInComboBox.ResumeLayout(); }
private void populateListViewFromDirectory(MsDataFileUri directory) { _abortPopulateList = false; listView.Cursor = Cursors.Default; _waitingForData = false; listView.Items.Clear(); var listSourceInfo = new List <SourceInfo>(); if (null == directory || directory is MsDataFilePath && string.IsNullOrEmpty(((MsDataFilePath)directory).FilePath)) { foreach (DriveInfo driveInfo in DriveInfo.GetDrives()) { string label = string.Empty; string sublabel = driveInfo.Name; ImageIndex imageIndex = ImageIndex.Folder; _driveReadiness[sublabel] = false; try { switch (driveInfo.DriveType) { case DriveType.Fixed: imageIndex = ImageIndex.LocalDrive; label = Resources.OpenDataSourceDialog_populateListViewFromDirectory_Local_Drive; if (driveInfo.VolumeLabel.Length > 0) { label = driveInfo.VolumeLabel; } break; case DriveType.CDRom: imageIndex = ImageIndex.OpticalDrive; label = Resources.OpenDataSourceDialog_populateListViewFromDirectory_Optical_Drive; if (driveInfo.IsReady && driveInfo.VolumeLabel.Length > 0) { label = driveInfo.VolumeLabel; } break; case DriveType.Removable: imageIndex = ImageIndex.OpticalDrive; label = Resources.OpenDataSourceDialog_populateListViewFromDirectory_Removable_Drive; if (driveInfo.IsReady && driveInfo.VolumeLabel.Length > 0) { label = driveInfo.VolumeLabel; } break; case DriveType.Network: label = Resources.OpenDataSourceDialog_populateListViewFromDirectory_Network_Share; break; } _driveReadiness[sublabel] = IsDriveReady(driveInfo); } catch (Exception) { label += string.Format(@" ({0})", Resources.OpenDataSourceDialog_populateListViewFromDirectory_access_failure); } string name = driveInfo.Name; if (label != string.Empty) { name = string.Format(@"{0} ({1})", label, name); } listSourceInfo.Add(new SourceInfo(new MsDataFilePath(driveInfo.RootDirectory.FullName)) { type = DataSourceUtil.FOLDER_TYPE, imageIndex = imageIndex, name = name, dateModified = GetDriveModifiedTime(driveInfo) }); } } else if (directory is RemoteUrl) { RemoteUrl remoteUrl = directory as RemoteUrl; if (string.IsNullOrEmpty(remoteUrl.ServerUrl)) { foreach (var remoteAccount in _remoteAccounts) { listSourceInfo.Add(new SourceInfo(remoteAccount.GetRootUrl()) { name = remoteAccount.GetKey(), type = DataSourceUtil.FOLDER_TYPE, imageIndex = ImageIndex.MyNetworkPlaces, }); } } else { RemoteAccount remoteAccount = GetRemoteAccount(remoteUrl); if (RemoteSession == null || !Equals(remoteAccount, RemoteSession.Account)) { RemoteSession = RemoteSession.CreateSession(remoteAccount); } RemoteServerException exception; bool isComplete = _remoteSession.AsyncFetchContents(remoteUrl, out exception); foreach (var item in _remoteSession.ListContents(remoteUrl)) { var imageIndex = DataSourceUtil.IsFolderType(item.Type) ? ImageIndex.Folder : ImageIndex.MassSpecFile; listSourceInfo.Add(new SourceInfo(item.MsDataFileUri) { name = item.Label, type = item.Type, imageIndex = imageIndex, dateModified = item.LastModified, size = item.FileSize }); } if (null != exception) { if (MultiButtonMsgDlg.Show(this, exception.Message, Resources.OpenDataSourceDialog_populateListViewFromDirectory_Retry) != DialogResult.Cancel) { RemoteSession.RetryFetchContents(remoteUrl); isComplete = false; } } if (!isComplete) { listView.Cursor = Cursors.WaitCursor; _waitingForData = true; } } } else if (directory is MsDataFilePath) { MsDataFilePath msDataFilePath = (MsDataFilePath)directory; DirectoryInfo dirInfo = new DirectoryInfo(msDataFilePath.FilePath); try { // subitems: Name, Type, Spectra, Size, Date Modified var arraySubDirInfo = dirInfo.GetDirectories(); Array.Sort(arraySubDirInfo, (d1, d2) => string.Compare(d1.Name, d2.Name, StringComparison.CurrentCultureIgnoreCase)); var arrayFileInfo = dirInfo.GetFiles(); Array.Sort(arrayFileInfo, (f1, f2) => string.Compare(f1.Name, f2.Name, StringComparison.CurrentCultureIgnoreCase)); // Calculate information about the files, allowing the user to cancel foreach (var info in arraySubDirInfo) { listSourceInfo.Add(getSourceInfo(info)); Application.DoEvents(); if (_abortPopulateList) { //MessageBox.Show( "abort" ); break; } } if (!_abortPopulateList) { foreach (var info in arrayFileInfo) { listSourceInfo.Add(getSourceInfo(info)); Application.DoEvents(); if (_abortPopulateList) { //MessageBox.Show( "abort" ); break; } } } } catch (Exception x) { var message = TextUtil.LineSeparate( Resources.OpenDataSourceDialog_populateListViewFromDirectory_An_error_occurred_attempting_to_retrieve_the_contents_of_this_directory, x.Message); // Might throw access violation. MessageDlg.ShowWithException(this, message, x); return; } } // Populate the list var items = new List <ListViewItem>(); foreach (var sourceInfo in listSourceInfo) { if (sourceInfo != null && (sourceTypeComboBox.SelectedIndex == 0 || sourceTypeComboBox.SelectedItem.ToString() == sourceInfo.type || // Always show folders sourceInfo.isFolder)) { ListViewItem item = new ListViewItem(sourceInfo.ToArray(), (int)sourceInfo.imageIndex) { Tag = sourceInfo, }; item.SubItems[2].Tag = sourceInfo.size; item.SubItems[3].Tag = sourceInfo.dateModified; items.Add(item); } } listView.Items.AddRange(items.ToArray()); }
public NodeDescriptor(ImageIndex imgIndex, VProjectItem pItem) { ImageIndex = imgIndex; ProjectItem = pItem; }
public static ImageIndex FromXml(XmlNode node) { ImageIndex idx = new ImageIndex() { Id = int.Parse(node.Attributes["id"].Value), CameraIndex = node.Attributes["id"].Value.CompareTo("right") == 0 ? CameraIndex.Right : CameraIndex.Left, ListIndex = -1 }; return idx; }
public void SaveInXml(XmlElement parent) { // ReSharper disable PossibleNullReferenceException var node = parent.AppendChild(parent.OwnerDocument.CreateElement("group")); node.Attributes.Append(parent.OwnerDocument.CreateAttribute("title")).Value = Title; node.Attributes.Append(parent.OwnerDocument.CreateAttribute("imageIndex")).Value = ImageIndex.ToString(); node.Attributes.Append(parent.OwnerDocument.CreateAttribute("buttonType")).Value = ButtonType.ToString(); // ReSharper restore PossibleNullReferenceException }
private static void Add(string id, string description, bool hasChildren, SizeFormat sizeFormat, ImageIndex imageIndex) { specs.Add(id, new SCUMM5ChunkSpec(id, description, hasChildren, sizeFormat, imageIndex)); }
private static void Add(string extension, string description, ImageIndex imageIndex) { specs.Add(extension, new FileChunkSpec(extension, description, imageIndex)); }
private void ShowBuilds() { while (true) { try { ClearItems(); ImageIndex overallImageIndex = ImageIndex.Green; string culprit = ""; foreach (ServerBuild serverBuild in _serverBuilds) { IBuildServer buildServer = GetBuildServer(serverBuild.ServerUri.ToString()); IBuildDefinition buildDefinition = buildServer.QueryBuildDefinitionsByUri(new[] {serverBuild.BuildUri})[0]; string[] buildInformation = new string[2]; buildInformation[0] = buildDefinition.Name; IBuildDetail lastBuildDetails = buildServer.QueryBuildsByUri(new[] {buildDefinition.LastBuildUri}, null, QueryOptions.None)[0]; if (lastBuildDetails != null) { buildInformation[1] = lastBuildDetails.Status.ToString(); } ImageIndex imageIndex = lastBuildDetails == null ? ImageIndex.Red : GetImageIndex(lastBuildDetails.Status); ListViewItem listViewItem = new ListViewItem(buildInformation, (int) imageIndex) {Tag = serverBuild}; AddItem(listViewItem); if (imageIndex == ImageIndex.Red) { overallImageIndex = ImageIndex.Red; culprit = lastBuildDetails == null ? "Unable to find build" : lastBuildDetails.RequestedFor; } else if (imageIndex == ImageIndex.Yellow && overallImageIndex == ImageIndex.Green) { overallImageIndex = ImageIndex.Yellow; } } SetSystemTrayIcon(overallImageIndex); // SetX10IntegrationStatus(overallImageIndex); if (overallImageIndex != _lastBuildStatus) { SetRadiatorBuildStatusColor(overallImageIndex); AnnounceCulprit(culprit); _lastBuildStatus = overallImageIndex; } } catch (Exception exception) { Console.WriteLine(exception); } Thread.Sleep(5000); } }