Esempio n. 1
0
 /// <summary>
 /// Checks if sub-directories exist below it. If they do, it'll add a dummy item to show the expander
 /// </summary>
 private void CheckIfFolderHasSubFolder()
 {
     try
     {
         // Check if the directory contains subItems - if it does, add a dummy
         if (Directory.GetDirectories(Path, "*", SearchOption.TopDirectoryOnly).Length > 0 ||
             Path == System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Links"))
         {
             SubItems.Add(dummyFolder);
         }
     }
     catch (UnauthorizedAccessException)
     { IsInaccessible = true; }
     catch (IOException)
     { IsInaccessible = true; }
 }
        public SpriteListItem(MapCell cell, int x, int y)
        {
            this.cell = cell;
            this.x    = x;
            this.y    = y;

            UseItemStyleForSubItems = false;

            xItem          = SubItems.Add(new ListViewSubItem());
            yItem          = SubItems.Add(new ListViewSubItem());
            typeItem       = SubItems.Add(new ListViewSubItem());
            assignmentItem = SubItems.Add(new ListViewSubItem());
            infoItem       = SubItems.Add(new ListViewSubItem());

            updateCaptions();
        }
            public ProcessListViewItem(Process process, WindowsDebugger debugger)
            {
                this.process = process;
                try {
                    managed = process.Modules
                              .OfType <ProcessModule>()
                              .Any(m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase));
                } catch { }

                string fileName = Path.GetFileName(process.MainModule.FileName);

                Text = fileName;
                SubItems.Add(process.Id.ToString());
                SubItems.Add(process.MainWindowTitle);
                SubItems.Add(GetManagedString(managed));
            }
Esempio n. 4
0
 public ItemViwer(item itm, int sn)
 {
     for (int i = 0; i < 8; i++)
     {
         SubItems.Add(new ListViewSubItem());
     }
     id                    = itm.id;
     name                  = itm.name;
     category_id           = itm.category_id;
     stock                 = itm.stock;
     rate                  = itm.rate;
     wholwsaleoprice       = itm.wholesaleprice;
     this.SubItems[0].Text = sn.ToString();
     byrate                = itm.buyrate == null?0:itm.buyrate;
     sn                   += 1;
 }
Esempio n. 5
0
        public TSLVItem(TetrisSave sv, bool hilight) : base()
        {
            Save = sv;
            Text = sv.UserName;
            SubItems.Add(sv.Score.ToString());
            SubItems.Add(TimeSpanToStr(sv.GameDuration));
            SubItems.Add(sv.GameEnded.ToShortDateString());

            if (hilight)
            {
                this.UseItemStyleForSubItems = true;
                this.BackColor = Color.FromArgb(255, 242, 242);
                this.ForeColor = Color.FromArgb(160, 0, 0);
                Font           = new Font(this.Font, FontStyle.Bold);
            }
        }
Esempio n. 6
0
        public CodeRow(XInstruction inst)
        {
            UseItemStyleForSubItems = false;

            Inst = inst;

            Text = Inst.Offset.ToString("X");
            SubItems.Add(Inst.OpCode);

            var lineItem = SubItems.Add(inst.Line);

            if (inst.RefId != 0)
            {
                lineItem.ForeColor = Color.Blue;
            }
        }
Esempio n. 7
0
 public NowMaxPaddingLVItem(string title, MemberData.Ship.Info.NowMax nowMax, int padding)
 {
     Text = title;
     if (padding > 0)
     {
         SubItems.Add(string.Format("{0} (+{1})", nowMax.ToString(), padding));
     }
     else if (padding < 0)
     {
         SubItems.Add(string.Format("{0} ({1})", nowMax.ToString(), padding));
     }
     else
     {
         SubItems.Add(nowMax.ToString());
     }
 }
            //****************************************

            public BoundItem(WinListView parent, object itemValue) : base()
            {
                _Parent    = parent;
                _ItemValue = itemValue;

                _Monitor               = new WinMonitor("");
                _Monitor.Target        = _ItemValue;
                _Monitor.ValueChanged += OnValueChanged;

                for (int Index = 1; Index < _Parent._Columns.Count; Index++)
                {
                    SubItems.Add(new ListViewSubItem());
                }

                RefreshContents();
            }
Esempio n. 9
0
 public TaskViewItem(string taskName, string tiptext)
 {
     SubItems.Clear();
     Text        = taskName;
     ToolTipText = tiptext;
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
     SubItems.Add(new ListViewItem.ListViewSubItem(this, "0"));
 }
Esempio n. 10
0
            public FcbListViewItem(SipperFileControlBlock _fcb) :
                base(_fcb.FileName)
            {
                fcb = _fcb;

                double fileSizeMeg = (double)(fcb.FileSizeInBytes) / 1000000.0;

                SubItems.Add(fcb.TimeStamp.ToString("yyyy/MMM/dd - HH:mm:ss"));
                SubItems.Add(fileSizeMeg.ToString("###,##0.00" + " Mb"));
                SubItems.Add(fcb.StartSector.ToString("###,###,##0"));
                SubItems.Add(fcb.EndSector.ToString("###,###,##0"));
                SubItems.Add(fcb.Desccription);
                if (fcb.DownLoaded)
                {
                    BackColor = Color.LightGray;
                }
            }
Esempio n. 11
0
 public Viewer(Models.billitem billitem, int day, int sn)
 {
     for (int i = 0; i < 8; i++)
     {
         SubItems.Add(new ListViewSubItem());
     }
     date     = day;
     name     = billitem.item.name;
     qty      = billitem.quantity.Value;
     rate     = billitem.rate;
     discount = billitem.item_discount;
     total    = (qty * rate) - discount;
     id       = billitem.item_id.Value;
     disunit  = discount.Value / qty.Value;
     this.SubItems[0].Text = sn.ToString();
     max = this.qty;
 }
Esempio n. 12
0
        private void InsertSecureItem(SecureItemViewModel item)
        {
            if (item == null)
            {
                throw new ArgumentException("Folder's sub-item can't be null");
            }

            if (item is SecureItemWithPasswordViewModel || item is SSHKeySecureItemViewModel)
            {
                var passwordCategory = SubItems.OfType <FolderCategoryViewModel>().FirstOrDefault(c => c.Type == FolderCategoryType.Password);
                if (passwordCategory == null)
                {
                    passwordCategory = new FolderCategoryViewModel(FolderCategoryType.Password);
                    SubItems.Add(passwordCategory);
                }
                passwordCategory.AddItemToCategory(item);
            }
            else if (item is BankAccountItemViewModel || item is CreditCardItemViewModel)
            {
                var dwCategory = SubItems.OfType <FolderCategoryViewModel>().FirstOrDefault(c => c.Type == FolderCategoryType.DigitalWallet);
                if (dwCategory == null)
                {
                    dwCategory = new FolderCategoryViewModel(FolderCategoryType.DigitalWallet);
                    SubItems.Add(dwCategory);
                }
                dwCategory.AddItemToCategory(item);
            }
            else if (item is SecureItemWithCountryViewModel || item is CompanySecureItemViewModel ||
                     item is EmailSecureItemViewModel || item is NameSecureItemViewModel)
            {
                var personalInfoCategory = SubItems.OfType <FolderCategoryViewModel>().FirstOrDefault(c => c.Type == FolderCategoryType.PersonalInfo);
                if (personalInfoCategory == null)
                {
                    personalInfoCategory = new FolderCategoryViewModel(FolderCategoryType.PersonalInfo);
                    SubItems.Add(personalInfoCategory);
                }
                personalInfoCategory.AddItemToCategory(item);
            }
            else
            {
                throw new ArgumentException("Unknown item type");
            }

            SubItems.Sort(Comparison);
            RaisePropertyChanged("SubItems");
        }
Esempio n. 13
0
        public override void Refresh()
        {
            if (SubItems.Count < 2)
            {
                SubItems.Add(_nodeName);
            }
            else
            {
                SubItems[1].Text = _nodeName;
            }

            base.Refresh();

            if (_visible)
            {
                LoadChild();
            }
        }
Esempio n. 14
0
 public ImagesListViewItem(ImageInfo ImageItem)
 {
     ImageData = ImageItem;
     Name      = ImageItem.N;
     Text      = ImageItem.N;
     SubItems.Add(ImageItem.C);
     SubItems.Add(ImageItem.D);
     SubItems.Add(ImageItem.Cn);
     SubItems.Add(ImageItem.I);
     SubItems.Add(ImageItem.E);
     SubItems.Add(ImageItem.A);
     SubItems.Add(ImageItem.F);
     SubItems.Add(ImageItem.La);
     SubItems.Add(ImageItem.Lo);
     SubItems.Add(ImageItem.Al);
     ToolTipText = ImageItem.N;
     ImageKey    = ImageItem.N;
 }
Esempio n. 15
0
        public ArchiveItem(string aFileName, Guid aFormat, bool aNested)
        {
            format = aFormat;
            nested = aNested;

            SubItems.Add(string.Empty);
            SubItems.Add("Ready...");
            file = new FileInfo(aFileName);
            parts.Add(aFileName, file);
            if (!Icons.Images.ContainsKey(file.Extension))
            {
                Icons.Images.Add(file.Extension, FileIcon.GetIcon(file.FullName, FileIconSize.Small));
            }
            ImageKey        = file.Extension;
            StateImageIndex = 0;

            Invalidate();
        }
Esempio n. 16
0
        public DocumentListViewItem(Document document)
        {
            bool firstItem = true;

            mDocument = document;
            foreach (FieldValue fv in document.FieldsValues)
            {
                if (firstItem)
                {
                    firstItem = false;
                    Text      = fv.Value;
                }
                else
                {
                    SubItems.Add(fv.Value);
                }
            }
        }
Esempio n. 17
0
        public void RefreshValues()
        {
            // What's a better method? lol
            SubItems.RemoveAt(SubItems.Count - 1);
            SubItems.RemoveAt(SubItems.Count - 1);
            SubItems.RemoveAt(SubItems.Count - 1);

            if (Video.Feeds.Count > 1)
            {
                string s = null;
                foreach (Feed f in Video.Feeds)
                {
                    if (s != null)
                    {
                        s = s + ", " + f.Name;
                    }
                    else
                    {
                        s = f.Name;
                    }
                }
                SubItems.Add(s);
            }
            else if (Video.Feeds.Count == 1)
            {
                SubItems.Add(Video.Feeds[0].ToString());
            }
            else
            {
                SubItems.Add("None Set");
            }

            if (Video.GameProfile != null)
            {
                SubItems.Add(Video.GameProfile.Name);
            }
            else
            {
                SubItems.Add("Not Set");
            }

            SubItems.Add(Video.IsSynced() ? "✔" : "");
        }
Esempio n. 18
0
        public CoreItem(OpCore core, int index)
        {
            Core = core;

            SubItems.Add("0");

            string text = index + ". ";

            if (Core.Network.IsLookup)
            {
                text += "Lookup";
            }
            else
            {
                text += Core.User.Settings.Operation + " - " + Core.User.Settings.UserName;
            }

            Text = text;
        }
Esempio n. 19
0
        // just some stuff that needs to be done at some point in construction/deserialisation
        public void LinkUp(Feed feed)
        {
            _feed = feed;

            Text = _title;

            SubItems.Add(new ListViewItem.ListViewSubItem());
            SubItems[1].Text = StatusString;

            SubItems.Add(new ListViewItem.ListViewSubItem());
            SubItems[2].Text = _publicationDate.ToShortDateString();

            SubItems.Add(new ListViewItem.ListViewSubItem());
            SubItems[3].Text = _downloadedDate.HasValue ? _downloadedDate.Value.ToShortDateString() : "";

            ToolTipText = ToolTip;

            //Checked = Status != ItemStatus.Skip;
        }
Esempio n. 20
0
            public FileListViewItem(FileSystemInfo fileSystemInfo, bool isParent = false)
            {
                _fileSystemInfo = fileSystemInfo;

                string fileSize = string.Empty;
                string fileType = string.Empty;


                if (_fileSystemInfo is FileInfo fileInfo)
                {
                    fileSize = FileSizeToString(fileInfo.Length);
                    fileType = GetMimeType(fileInfo);
                }

                Text = isParent ? ".." : _fileSystemInfo.Name;
                SubItems.Add(isParent ? string.Empty : _fileSystemInfo.LastWriteTime.ToString("dd.MM.yyyy hh:ss"));
                SubItems.Add(fileType);
                SubItems.Add(fileSize);
            }
Esempio n. 21
0
        private void SetItems()
        {
            SubItems.Clear();

            Text = Key;

            string storeName = _certStoreName == null ? "MY" : _certStoreName;

            string certName = "";

            if ((_hash != null) && (_hash.Length > 0))
            {
                certName = CertUtil.GetCertNameFromStoreAndHash(storeName, _hash);
            }

            SubItems.Add(certName);

            SubItems.Add(storeName);
        }
        /// <summary>
        /// A simple constructor that initializes the object with the given values.
        /// </summary>
        /// <param name="p_btsTask">The task whose status is to be displayed by this list
        /// view item.</param>
        public ActivateModsListViewItem(IBackgroundTaskSet p_btsTask, ActivateModsMonitorControl p_amcControl)
        {
            m_amcControl = p_amcControl;
            Task         = p_btsTask;

            ListViewSubItem lsiSubItem = SubItems[0];

            lsiSubItem.Name = "ModName";

            if (p_btsTask.GetType() == typeof(ModUninstaller))
            {
                lsiSubItem.Text = ((ModUninstaller)p_btsTask).ModName;
            }
            else if (p_btsTask.GetType() == typeof(ModInstaller))
            {
                lsiSubItem.Text = ((ModInstaller)p_btsTask).ModName;
            }
            else if (p_btsTask.GetType() == typeof(ModUpgrader))
            {
                lsiSubItem.Text = ((ModUpgrader)p_btsTask).ModName;
            }

            lsiSubItem         = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name    = "Status";
            lsiSubItem.Text    = "Queued";
            p_btsTask.IsQueued = true;

            lsiSubItem      = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name = "Operation";
            lsiSubItem.Text = "";

            lsiSubItem      = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name = "Progress";

            lsiSubItem      = SubItems.Add(new ListViewSubItem());
            lsiSubItem.Name = "?";

            m_booRemovable         = true;
            p_btsTask.TaskStarted += new EventHandler <EventArgs <IBackgroundTask> >(TaskSet_TaskSetStarted);

            p_btsTask.TaskSetCompleted += new EventHandler <TaskSetCompletedEventArgs>(TaskSet_TaskSetCompleted);
        }
Esempio n. 23
0
        public EditListViewItem(string time,
                                string flags,
                                int size,
                                string author,
                                string summary,
                                long diff,
                                long oldId)
            : base("")
        {
            _time    = time;
            _flags   = flags;
            _size    = size;
            _author  = author;
            _summary = summary;
            _diffNum = diff;
            _oldId   = oldId;

            DateTime timeStamp = DateTime.Parse(_time, null,
                                                System.Globalization.DateTimeStyles.AssumeUniversal);
            string t       = timeStamp.ToShortTimeString();
            string strSize = size >= 0 ? "+" + size.ToString() : size.ToString();

            SubItems[0].Text = t;
            SubItems.Add(_flags);
            SubItems.Add(strSize);
            SubItems.Add(_author);
            SubItems.Add(_summary);

            UseItemStyleForSubItems = false;
            SubItems[0].ForeColor   = Color.Gray;
            SubItems[3].ForeColor   = Color.Blue;
            SubItems[4].ForeColor   = Color.Gray;

            if (strSize.Contains('+'))
            {
                SubItems[2].ForeColor = Color.Green;
            }
            else if (strSize.Contains('-'))
            {
                SubItems[2].ForeColor = Color.Red;
            }
        }
Esempio n. 24
0
        public void Update()
        {
            Text     = Info.PublicName;
            ImageKey = Info.Code;

            if (SubItems.Count == 1)
            {
                SubItems.Add("");
                SubItems.Add("");
                SubItems.Add("");
                SubItems.Add("");
            }

            String Servers = Info.Servers.ToString();

            SubItems[1].Text = Servers;

            String Users = Info.Users.ToString();

            SubItems[3].Text = Users;

            switch (Info.UserList)
            {
            case AreaInfo.UserListType.WhiteList:
            {
                ForeColor       = Color.DarkGreen;
                StateImageIndex = 0;
            } break;

            case AreaInfo.UserListType.BlackList:
            {
                ForeColor       = Color.DarkRed;
                StateImageIndex = 1;
            } break;

            default:
            {
                ForeColor       = SystemColors.WindowText;
                StateImageIndex = 2;
            } break;
            }
        }
Esempio n. 25
0
 public ResultListViewItem(Result result)
 {
     Text = result.Position.ToString();
     SubItems.Add(result.Time.ToString(@"hh\:mm\:ss"));
     SubItems.Add(result.RaceNumber.ToString());
     if (result.RaceNumber == 0)
     {
         // Only allow deletion if no race number associated with result.
         SubItems.Add("X");
     }
     // ToDo: Improve. The colour disappears on mouse over.
     if (result.DubiousResult != Result.DubiousResultEnum.None)
     {
         BackColor = Color.Salmon;
         foreach (var subItem in SubItems.Cast <ListViewSubItem>())
         {
             subItem.BackColor = Color.Salmon;
         }
     }
 }
        public CustomListViewItem(T definition)
        {
            Definition = definition;

            Checked = Definition.IsSelected;

            Text = definition.Name;

            foreach (var column in definition.GetColumns())
            {
                if (column.Property.Name == "Name")
                {
                    continue;
                }
                var item = new ListViewSubItem(this, column.Property.GetValue(definition) as string);
                _subItems.Add(column.Property.Name, item);
                SubItems.Add(item);
            }

            definition.PropertyChanged += definition_PropertyChanged;
        }
Esempio n. 27
0
        private void Init(MatchRule rule)
        {
            _matchRule = rule;

            SubItems.Clear();

            //first row is actual item, all others are "sub-items"
            Text = rule.StartTagRegexValue;
            SubItems.Add(rule.EndTagRegexValue);

            string tagType = rule.TagType == MatchRule.TagTypeOption.TagPair
                ? "Tag Pair"
                : "Placeholder";

            SubItems.Add(tagType);

            string isTranslatable = rule.IsContentTranslatable
                ? "Translatable"
                : "Not translatable";

            SubItems.Add(isTranslatable);
        }
Esempio n. 28
0
        public void Update()
        {
            SubItems.Clear();

            Text = Provider.Title;
            if (Provider.Enabled)
            {
                ImageKey = "on";
            }
            else
            {
                ImageKey = "off";
            }

            SubItems.Add(Provider.DefinitionTitle);
            SubItems.Add(Provider.DefinitionSubTitle);
            SubItems.Add(Provider.DefinitionHref);
            if (Provider is Core.Providers.OpenVPN)
            {
                SubItems.Add((Provider as Core.Providers.OpenVPN).Path);
            }
        }
Esempio n. 29
0
        private void Init(MatchRule rule)
        {
            _matchRule = rule;

            SubItems.Clear();

            //first row is actual item, all others are "sub-items"
            Text = rule.StartTagRegexValue;
            SubItems.Add(rule.EndTagRegexValue);

            string tagType = rule.TagType == MatchRule.TagTypeOption.TagPair
                ? PluginResources.Tag_Pair
                : PluginResources.Placeholder;

            SubItems.Add(tagType);

            string isTranslatable = rule.IsContentTranslatable
                ? PluginResources.Translatable
                : PluginResources.Not_Translatable;

            SubItems.Add(isTranslatable);
        }
Esempio n. 30
0
        public RealmlistItem(string name, string website, string address, string version, string gamePath) : base(name)
        {
            Website  = website;
            Address  = address;
            Version  = version;
            GamePath = gamePath;

            int addon;

            if (Int32.TryParse(Version[0].ToString(), out addon))
            {
                Addon = (Expansion)(--addon);
            }
            else
            {
                Addon = Expansion.Classic;
            }

            SubItems.Add(Address);
            SubItems.Add(Version);
            ImageIndex = (int)Addon;
        }