protected Viewport(IMenuCallback menuCallback) { StaticFilter = ""; DynamicFilter = ""; ParentRow = null; ParentType = ParentTypeEnum.None; MenuCallback = menuCallback; }
/// <summary> /// Initializes a new instance of the <see cref="ElementSummary" /> class. /// </summary> /// <param name="Id">The element's id (required).</param> /// <param name="Description">The element's description (required).</param> /// <param name="Type">The element's type (required).</param> /// <param name="SchemaId">The element's schema id - if it has one. This is the key field into the PeopleStage schema tables such as ProcessDefinition. Published elements should have a schema id..</param> /// <param name="SchemaIdType">The type of the element's schema id - if it has a schema id. Published elements should have a schema id and type..</param> /// <param name="ParentId">The parent of this element's id (required).</param> /// <param name="ParentType">The parent of this element's type (required).</param> public ElementSummary(string Id = default(string), string Description = default(string), TypeEnum Type = default(TypeEnum), int?SchemaId = default(int?), SchemaIdTypeEnum?SchemaIdType = default(SchemaIdTypeEnum?), string ParentId = default(string), ParentTypeEnum ParentType = default(ParentTypeEnum)) { // to ensure "Id" is required (not null) if (Id == null) { throw new InvalidDataException("Id is a required property for ElementSummary and cannot be null"); } else { this.Id = Id; } // to ensure "Description" is required (not null) if (Description == null) { throw new InvalidDataException("Description is a required property for ElementSummary and cannot be null"); } else { this.Description = Description; } // to ensure "Type" is required (not null) if (Type == null) { throw new InvalidDataException("Type is a required property for ElementSummary and cannot be null"); } else { this.Type = Type; } // to ensure "ParentId" is required (not null) if (ParentId == null) { throw new InvalidDataException("ParentId is a required property for ElementSummary and cannot be null"); } else { this.ParentId = ParentId; } // to ensure "ParentType" is required (not null) if (ParentType == null) { throw new InvalidDataException("ParentType is a required property for ElementSummary and cannot be null"); } else { this.ParentType = ParentType; } this.SchemaId = SchemaId; this.SchemaIdType = SchemaIdType; }
private void btnImport_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtDocumentDirectory.Text)) { return; } if (string.IsNullOrEmpty(txtExcelFileName.Text)) { return; } //branch here for logic on window task type? string dirPath = txtDocumentDirectory.Text; mParentType = (ParentTypeEnum) Enum.Parse(typeof (ParentTypeEnum), comboBoxParentType.Text, true); mStopwatch.Start(); AddMessageToGrid("Import started...", Common.ImporterMessageType.Info, true); AttachmentLoader loader = new AttachmentLoader(dirPath, mExcelFileInfo, mParentType); loader.AddMessage += (message, type, force) => { AddMessageToGrid(message, type, force); }; loader.ProgressChanged += (count) => { lblCount.Text = count; }; loader.ProgressComplete += (message) => { string settingValue = CommonUtils.GetAppSettingValue(CommonUtils.AppSettingKey.UploadedDocumentsPathRoot); string path = Path.Combine(settingValue, "import_ui_messages.csv"); for (int i = 0; i < 10; i++) { if (File.Exists(path)) { path = Path.Combine(settingValue, string.Format("import_ui_messages{0}.csv", i)); } else { break; } } using (StreamWriter sw = new StreamWriter(path)) { WriteToCSV(txtComment.Text, listView, sw); AddMessageToGrid("Finished: ", Common.ImporterMessageType.Info, true); } AddMessageToGrid(message, Common.ImporterMessageType.Info, false); }; loader.Run(); }
protected virtual Viewport ShowAssocViewport(IMenuCallback menuCallback, ViewportType viewportType, string staticFilter, DataRow parentRow, ParentTypeEnum parentType) { if (menuCallback == null) { throw new ViewportException("Не заданна ссылка на интерфейс menuCallback"); } Viewport viewport = ViewportFactory.CreateViewport(menuCallback, viewportType); viewport.StaticFilter = staticFilter; viewport.ParentRow = parentRow; viewport.ParentType = parentType; if (((IMenuController)viewport).CanLoadData()) { ((IMenuController)viewport).LoadData(); } menuCallback.AddViewport(viewport); return(viewport); }