public ExcelPropertyComparer() { Excel.Application excelApp = new Excel.Application(); string workbookPath = GlobalData.Singleton.IOHelper.GetXMLFilePath("Control Definitions.xlsx"); Excel.Workbook excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true, false, false); Excel.Sheets excelSheets = excelWorkbook.Worksheets; //control types Excel.Worksheet excelWorksheet = (Excel.Worksheet)excelSheets.get_Item("Control Types"); Excel.Range range = excelWorksheet.UsedRange; string controlName; for (int row = 2; row <= range.Rows.Count; row++) { controlName = (string)(range.Cells[row, 1] as Excel.Range).Value2; Type controlType = ControlTypeMapping.GetControlType(controlName); } excelWorkbook.Close(true, null, null); excelApp.Quit(); ReleaseObject(excelSheets); ReleaseObject(excelWorkbook); ReleaseObject(excelApp); }
public static GnosisTileTabItem CreateGnosisTabItem(int order) { GnosisTileTabItem tabItem = new GnosisTileTabItem(); tabItem.ID = GlobalData.Singleton.GetNewControlID(); tabItem.GnosisName = "TabItem" + tabItem.ID.ToString(); tabItem.Order = order; tabItem.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisTileTabItem)); return(tabItem); }
public static GnosisTileTab CreateGnosisTab() { GnosisTileTab tab = new GnosisTileTab(); tab.ID = GlobalData.Singleton.GetNewControlID(); tab.Order = 1; tab.GnosisName = "Tab" + tab.ID.ToString(); tab.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisTileTab)); return(tab); }
internal static GnosisTextField CreateGnosisTextField(int order) { GnosisTextField textField = new GnosisTextField(); textField.ID = GlobalData.Singleton.GetNewControlID(); textField.GnosisName = "Text Field" + textField.ID.ToString(); textField.Order = order; textField.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisTextField)); return(textField); }
public static GnosisGalleryItem CreateGnosisGalleryItem(int order, bool expanded) { GnosisGalleryItem galleryItem = new GnosisGalleryItem(); galleryItem.ID = GlobalData.Singleton.GetNewControlID(); galleryItem.GnosisName = "GalleryItem" + galleryItem.ID; galleryItem.Order = order; galleryItem.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisGalleryItem)); galleryItem.GnosisExpanded = expanded; return(galleryItem); }
public static GnosisTabHeaderButton CreateGnosisTabHeaderButton(int order, string caption) { GnosisTabHeaderButton btn = new GnosisTabHeaderButton(); btn.ID = GlobalData.Singleton.GetNewControlID(); btn.GnosisName = "HeaderButton" + btn.ID.ToString(); btn.Order = order; btn.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisTabHeaderButton)); btn.Caption = caption; return(btn); }
public static GnosisDocumentFrame CreateGnosisDocFrame(string systemName, int systemVersion, string url) { GnosisDocumentFrame docFrame = new GnosisDocumentFrame(); docFrame.ID = GlobalData.Singleton.GetNewControlID(); docFrame.GnosisName = "DocFrame" + docFrame.ID.ToString(); docFrame.Order = 1; docFrame._Created = true; docFrame.IsEmpty = true; docFrame.IsEditing = false; // docFrame.URL = url; docFrame.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisDocumentFrame)); return(docFrame); }
internal static GnosisGalleryDocumentItem CreateGnosisGalleryDocumentItem(GnosisGalleryDocumentItem docItem) { GnosisGalleryDocumentItem galleryItem = new GnosisGalleryDocumentItem(); galleryItem.ID = GlobalData.Singleton.GetNewControlID(); galleryItem.GnosisName = "GallerySearchItem" + galleryItem.ID.ToString(); galleryItem.Order = docItem.Order; galleryItem.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisGalleryDocumentItem)); galleryItem.Caption = docItem.Caption; galleryItem.GnosisExpanded = docItem.GnosisExpanded; galleryItem.DocumentEntityID = docItem.DocumentEntityID; galleryItem.DocumentSystemID = docItem.DocumentSystemID; galleryItem.DocumentAction = docItem.DocumentAction; return(galleryItem); }
private static void AssignGridFieldProperties(IGnosisGridFieldImplementation gridField, GnosisGridColumn column) { gridField.ID = GlobalData.Singleton.GetNewControlID(); gridField.Order = column.Order; gridField.ControlType = ControlTypeMapping.GetControlTypeName(gridField.GetType()); gridField.Tooltip = column.Tooltip; gridField.ContentHorizontalAlignment = column.ContentHorizontalAlignment; gridField.ContentVerticalAlignment = column.ContentVerticalAlignment; gridField.MinDisplayChars = column.MinDisplayChars; gridField.MaxDisplayChars = column.MaxDisplayChars; gridField.Hidden = column.Hidden; gridField.ReadOnly = column.ReadOnly; gridField.Dataset = column.Dataset; gridField.DatasetItem = column.DatasetItem; gridField.IsEvenRow = column.IsEvenRow; gridField.Value = column.Value; }
public static GnosisSearchParameter CreateGnosisSearchParameter( int order, string dataset, string datasetItem, string parameter) { GnosisSearchParameter searchParameter = new GnosisSearchParameter(); searchParameter.ID = GlobalData.Singleton.GetNewControlID(); searchParameter.GnosisName = "SearchParameter" + searchParameter.ID.ToString(); searchParameter.Order = order; searchParameter.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisSearchParameter)); searchParameter.Dataset = dataset; searchParameter.DatasetItem = datasetItem; searchParameter.Parameter = parameter; return(searchParameter); }
public static GnosisGallerySearchItem CreateGnosisGallerySearchItem(GnosisGallerySearchItem searchItem) { GnosisGallerySearchItem galleryItem = new GnosisGallerySearchItem(); galleryItem.ID = GlobalData.Singleton.GetNewControlID(); galleryItem.GnosisName = "GallerySearchItem" + galleryItem.ID.ToString(); galleryItem.Order = searchItem.Order; galleryItem.ControlType = ControlTypeMapping.GetControlTypeName(typeof(GnosisGallerySearchItem)); galleryItem.Caption = searchItem.Caption; galleryItem.GnosisExpanded = searchItem.GnosisExpanded; galleryItem.AutoSearchAction = searchItem.AutoSearchAction; galleryItem.SearchAction = searchItem.SearchAction; galleryItem.SearchSystemID = searchItem.SearchSystemID; galleryItem.SearchEntityID = searchItem.SearchEntityID; galleryItem.SearchParameters = searchItem.SearchParameters; return(galleryItem); }
////internal void SetForegroundColour(string contentColour) ////{ //// ((IGnosisContentControlImplementation)ControlImplementation).SetForegroundColour(contentColour); ////} protected virtual void SetDisplayDimensions() { string font = EntityController.GetNormalStyle().Font; int fontSize = EntityController.GetNormalStyle().FontSize; if (ControlImplementation is IGnosisDisplayCharsPossessor) { characterWidth = GlobalData.Singleton.StyleHelper.GetCharacterWidth((IGnosisContentControlImplementation)ControlImplementation, EntityController.GetNormalStyle().Font, EntityController.GetNormalStyle().FontSize); //display chars if (MinDisplayChars == 0) { if (this.Dataset == null || this.DatasetItem == null) { GlobalData.Singleton.ErrorHandler.HandleError("Dataset or DatasetItem not defined for " + this.ControlImplementation.GnosisName + " " + ControlTypeMapping.GetControlTypeName(this.GetType()), "GnosisContentController"); } else { MinDisplayChars = EntityController.GetMinDisplayChars(Dataset, DatasetItem); } } if (MaxDisplayChars == 0) { MaxDisplayChars = EntityController.GetMaxDisplayChars(Dataset, DatasetItem); } //field width if (MaxDisplayChars > 0) { //MaxFieldWidth = StyleManager.GetMaxFieldWidth(MaxDisplayChars); MaxFieldWidth = GlobalData.Singleton.StyleHelper.GetMaxFieldWidth((IGnosisContentControlImplementation)ControlImplementation, font, fontSize, MaxDisplayChars); } if (MinDisplayChars > 0) { //MinFieldWidth = StyleManager.GetMinFieldWidth(MinDisplayChars); MinFieldWidth = GlobalData.Singleton.StyleHelper.GetMinFieldWidth((IGnosisContentControlImplementation)ControlImplementation, font, fontSize, MinDisplayChars); } if (MinFieldWidth > MaxFieldWidth) { MinFieldWidth = MaxFieldWidth; } else if (MaxFieldWidth < MinFieldWidth) { MaxFieldWidth = MinFieldWidth; } //if (ControlImplementation is IGnosisCaptionLabelPossessor) //{ // GnosisCaptionLabel captionLabel = ((IGnosisCaptionLabelPossessor)ControlImplementation).CaptionLabel; // if (captionLabel.RelativePosition == CaptionPosition.LEFT || captionLabel.RelativePosition == CaptionPosition.RIGHT) // { // double captionWidth = captionLabel.GetWidth() + (2 * captionLabel.HorizontalMargin); // minFieldWidth += captionWidth; // maxFieldWidth += captionWidth; // } //} } //field height fieldHeight = GlobalData.Singleton.StyleHelper.GetFieldHeight((IGnosisContentControlImplementation)ControlImplementation, font, fontSize); ((IGnosisContentControlImplementation)ControlImplementation).SetHeight(fieldHeight); ((IGnosisContentControlImplementation)ControlImplementation).SetVerticalAlignment(VerticalAlignmentType.TOP); if (((IGnosisContentControlImplementation)ControlImplementation)._ContentHorizontalAlignment == HorizontalAlignmentType.NONE) { if (Dataset != null && DatasetItem != null) { HorizontalAlignmentType ha = EntityController.GetContentHorizontalAlignment(Dataset, DatasetItem); ((IGnosisContentControlImplementation)ControlImplementation)._ContentHorizontalAlignment = ha; } } }
protected void SetDisplayWidths() { fieldClone = GetFieldClone(); font = instanceController.EntityController.GetNormalStyle().Font; fontSize = instanceController.EntityController.GetNormalStyle().FontSize; characterWidth = GlobalData.Singleton.StyleHelper.GetCharacterWidth(fieldClone, font, fontSize); fieldHeight = GlobalData.Singleton.StyleHelper.GetFieldHeight(fieldClone, font, fontSize); //display chars if (MinDisplayChars == 0) { if (this.Dataset == null || this.DatasetItem == null) { GlobalData.Singleton.ErrorHandler.HandleError("Dataset or DatasetItem not defined for " + columnModel.GnosisName + " " + ControlTypeMapping.GetControlTypeName(this.GetType()), "GnosisGridColumnController"); } else { MinDisplayChars = instanceController.EntityController.GetMinDisplayChars(Dataset, DatasetItem); } } if (MaxDisplayChars == 0) { if (MaxChars > 0) { MaxDisplayChars = MaxChars; } else { MaxDisplayChars = instanceController.EntityController.GetMaxDisplayChars(Dataset, DatasetItem); } } //max field width //if (columnModel is GnosisTextColumn && ((GnosisTextColumn)columnModel).MaxTextDisplayWidthChars > 0) //{ // //MaxFieldWidth = styles.GetMaxFieldWidth(((GnosisTextColumn)columnModel).MaxDisplayWidthChars); // MaxFieldWidth = GlobalData.Singleton.StyleHelper.GetMaxFieldWidth(gridField, font, fontSize, ((GnosisTextColumn)columnModel).MaxDisplayChars); //} //else if (MaxDisplayChars > 0) //{ // //MaxFieldWidth = styles.GetMaxFieldWidth(MaxDisplayChars); // MaxFieldWidth = GlobalData.Singleton.StyleHelper.GetMaxFieldWidth(gridField, font, fontSize, MaxDisplayChars); //} //else if (MaxChars > 0) //{ // //MaxFieldWidth = styles.GetMaxFieldWidth(MaxChars); // MaxFieldWidth = GlobalData.Singleton.StyleHelper.GetMaxFieldWidth(gridField, font, fontSize, MaxChars); //} ////min field width //if (columnModel is GnosisTextColumn && ((GnosisTextColumn)columnModel).MinTextDisplayWidthChars > 0) //{ // MinFieldWidth = GlobalData.Singleton.StyleHelper.GetMinFieldWidth(gridField, font, fontSize, ((GnosisTextColumn)columnModel).MinTextDisplayWidthChars); //} //else if (columnModel is GnosisTextResults && ((GnosisTextResults)columnModel).MinTextDisplayWidthChars > 0) //{ // MinFieldWidth = GlobalData.Singleton.StyleHelper.GetMinFieldWidth(gridField, font, fontSize, ((GnosisTextResults)columnModel).MinTextDisplayWidthChars); //} //else if (MinDisplayChars > 0) //{ // //MinFieldWidth = styles.GetMinFieldWidth(MinDisplayChars); // MinFieldWidth = GlobalData.Singleton.StyleHelper.GetMinFieldWidth(gridField, font, fontSize, MinDisplayChars); //} //else if (MaxChars > 0) //{ // // MinFieldWidth = styles.GetMinFieldWidth(MaxChars); // MinFieldWidth = GlobalData.Singleton.StyleHelper.GetMinFieldWidth(gridField, font, fontSize, MaxChars); //} //if (MinFieldWidth > MaxFieldWidth) //{ // MinFieldWidth = MaxFieldWidth; //} //else if (MaxFieldWidth < MinFieldWidth) //{ // MaxFieldWidth = MinFieldWidth; //} if (columnModel._ContentHorizontalAlignment == GnosisController.HorizontalAlignmentType.NONE) { GnosisController.HorizontalAlignmentType ha = instanceController.EntityController.GetContentHorizontalAlignment(Dataset, DatasetItem); columnModel._ContentHorizontalAlignment = ha; header._ContentHorizontalAlignment = ha; } if (fieldClone is GnosisGridTextField || fieldClone is GnosisResultsTextField) { TextHeight = GlobalData.Singleton.StyleHelper.GetTextHeight( (GnosisGridTextField)fieldClone, instanceController.EntityController.GetNormalStyle().Font, instanceController.EntityController.GetNormalStyle().FontSize); //PaddingVertical = (int)(fieldHeight - TextHeight) / 2; } }