public override string ToString() { if (!IsInverted && BaseSet.Count == 1) { return(BaseSet.First().Print(ExprMode)); } var sb = new StringBuilder(40); if (IsInverted) { sb.Append('~'); } sb.Append('('); bool first = true; var items = BaseSet.Select(node => node.Print(ExprMode)).ToList(); items.Sort(); foreach (var item in items) { if (!first) { sb.Append('|'); } sb.Append(item); first = false; } sb.Append(')'); return(sb.ToString()); }
public void Fill(BaseSet trees, BaseSet cards) { setTree = trees; setCard = cards; IncludeList = null; Fill(); }
static private void ShowConfigCenter(string serverName, IDBProvider dbHelper, ILoginUser loginUser) { BaseSet bs = new BaseSet(serverName, dbHelper, loginUser); //显示字典管理 bs.ShowConfigCenter(null); }
public void Reload() { BaseSet set = this.DataSource as BaseSet; if (set != null) { set.Load(); } }
public virtual void SelectValue(BaseDat Value) // Добавил Медведев. { int index = SelectedIndex; BaseSet s = DataSource as BaseSet; if (Value == null || DataSource == null) { return; } index = s.IndexOf(Value); if (index >= 0) { SelectedIndex = index; } }
public PropertyDescriptor[] GetColumnDescriptors() { BaseSet dset = Grid.DataSource as BaseSet; if (dset == null) { return new PropertyDescriptor[] { } } ; else { return(Array.ConvertAll <string, PropertyDescriptor>(GetColumnNames() , delegate(string name) { return dset.GetDescriptor(name); })); } }
/// <summary> /// Перевод из старой модели данных в новую (костыль) /// </summary> /// <param name="businesses">Набор занятости авто из БД или тестовый</param> public void ReMapBussinesses(IEnumerable <MonthBusiness> businesses) { var cars = GetCarModels(businesses); CarModels = cars; var comments = GetComments(CarModels); Comments = comments; Monthes = GetMonthes(businesses); //!!зависит от заполнения CarModels var leasings = GetLeasingModels(businesses); Leasings = leasings; DaysCount = Monthes.Sum(m => m.Month.DayCount); m_baseSet = new BaseSet(cars, comments, leasings); m_baseSetted = true; }
/// <summary> /// 读取并设定基本设置 /// </summary> private void SetBaseSet() { var clusterIniFilePath = _dediFilePath.ClusterFilePath; if (!File.Exists(clusterIniFilePath)) { Debug.WriteLine("cluster.ini不存在"); return; } _baseSet = new BaseSet(clusterIniFilePath); // 游戏风格 DediBaseSetIntentionButton.DataContext = _baseSet; // 名称 DediBaseSetClusterName.DataContext = _baseSet; // 密码 DediBaseSetSecret.DataContext = _baseSet; // 描述 DediBaseSetDescribe.DataContext = _baseSet; // 最大回档数 DediBaseSetMaxSnapshots.DataContext = _baseSet; // 游戏模式 BaseSetGameModeSelectBox.DataContext = _baseSet; // PVP BaseSetPvpSelectBox.DataContext = _baseSet; // 玩家 BaseSetMaxPlayerSelectBox.DataContext = _baseSet; // 服务器模式 BaseSetOfflineSelectBox.DataContext = _baseSet; // 无人时暂停 BaseSetIsPauseSelectBox.DataContext = _baseSet; // 洞穴 EditWorldIsCaveSelectBox.DataContext = _baseSet; if (_baseSet.IsCave == 0) { CaveSettingColumnDefinition.Width = new GridLength(0); } Debug.WriteLine("基本设置-完"); }
public override int GetHashCode() { int hc = BaseSet.GetHashCode(); return(IsInverted ? ~hc : hc); }
public DataGridViewComboBoxColumn AddGridComboBoxColumn(string name, string header, string displaymember, Type type, BaseSet datasource) { DataGridViewComboBoxColumn col = new DataGridViewComboBoxColumn(); col.HeaderText = header; col.DataPropertyName = col.Name = name; col.ValueType = type; col.DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing; col.DisplayMember = displaymember; col.DataSource = datasource; col.SortMode = DataGridViewColumnSortMode.NotSortable; AddGridColumn(col); return(col); }
public DataGridViewComboBoxColumn AddGridComboBoxColumn(string name, string header, string displaymember, BaseSet datasource) { return(AddGridComboBoxColumn(name, header, displaymember, typeof(string), datasource)); }
public async Task <T> LoadSet <T>(FileIdentifier fileIdentifier) where T : BaseSet { var file = await api.File.GetAsync(fileIdentifier); var fileStatus = await api.File.GetOnlineStatusAsync(fileIdentifier); var organization = await api.Organization.GetAsync(fileIdentifier as OrganizationIdentifier); BaseSet set = null; // this is awful, but no clear security check to perform bool isPrivileged = !EDiscoveryUtility.IsUserEDiscovery(this.api.UserAccessIdentifiers) && !LEOUploadUtility.IsUserLeo(this.api.UserAccessIdentifiers); if (typeof(T).Equals(typeof(TextSet))) { set = TextService.TextSetGet(file, true); } if (typeof(T).Equals(typeof(DocumentSet))) { set = DocumentSetService.DocumentSetGet(file); } if (typeof(T).Equals(typeof(MediaSet))) { set = MediaService.MediaSetGet(organization, file, isPrivileged); } if (typeof(T).Equals(typeof(TranscriptSet))) { var transcriptSet = TranscriptService.TranscriptSetGet(organization, file); transcriptSet.Segments = await TranscriptService.LoadSegments(api, transcriptSet.Subtitles?.FirstOrDefault()?.FileIdentifier); set = transcriptSet; } if (typeof(T).Equals(typeof(ClipSet))) { var clipSet = ClipService.ClipSetGet(organization, file); set = clipSet; } if (typeof(T).Equals(typeof(ImageSet))) { set = ImageService.ImageSetGet(file); } if (typeof(T).Equals(typeof(UnknownSet))) { set = UnknownService.UnknownSetGet(file); } if (set.AllowedOperations == null) { set.AllowedOperations = new[] { AllowedOperation.GetAllowedOperationDownload(fileIdentifier, false) } } ; set.RootFileIdentifier = file.Read(MetadataKeyConstants.CHILDOF, defaultValue: file.Identifier); if (set.RootFileIdentifier.Equals(fileIdentifier)) { set.Views = DetectFileViews(organization, file); } else { set.Views = DetectFileViews(organization, await api.File.GetAsync(set.RootFileIdentifier)); } // some wierd logic for eDiscovery // if eDiscovery, then no subtitles if (set is MediaSet && EDiscoveryUtility.IsUserEDiscovery(api.UserAccessIdentifiers)) { var media = set as MediaSet; media.Subtitles = null; } if (fileStatus != FileModel.OnlineStatus.Online) { set.Views = new ManagerFileView[] { new ManagerFileView { ViewerType = ManagerFileView.ViewerTypeEnum.Offline, Identifier = set.RootFileIdentifier } }; set.AllowedOperations = new AllowedOperation[] { AllowedOperation.GetAllowedOperationRequestOnlineFolder(set.RootFileIdentifier) }; set.RootFileIdentifier = null; } return(set as T); }