public bool RegisterObject(SaveableObject obj) { if (obj.Id != 0) { return(false); } if (!Attribute.IsDefined(obj.GetType(), typeof(SerializableAttribute))) { return(false); } obj.Id = m_currentId++; RegisteredObjects.Add(m_currentId, obj); if (RegisteredTypes.TryGetValue(obj.ClassId, out Type val)) { if (val != obj.GetType()) { throw new ArgumentException(); } } else { RegisteredTypes.Add(obj.ClassId, obj.GetType()); } return(true); }
GenericRegisterObject (Camera objectToRegister, bool objectIsAPrefab, InitialisationDelegate initialisationCallback, int Index) { Camera Instance; if (objectIsAPrefab) { GameObject Prefab = objectToRegister.gameObject; GameObject Obj = GameObject.Instantiate(Prefab); Instance = Obj.GetComponent <Camera>(); MyContract.RequireArgumentNotNull(Instance, "Camera Component"); } else { Instance = objectToRegister; Debug.Assert(Instance != null, "Provided object was null"); } if (initialisationCallback != null) { initialisationCallback(Instance, Index); } IGameObjectRegistryKeyComponent KeyComponent = Instance.GetComponent <IGameObjectRegistryKeyComponent>(); int element = KeyComponent.Key; //Debug.Log("Adding element " + element.ToString() + " to the dictionary."); if (RegisteredObjects.ContainsKey(element) && RetrieveObject(element) != null) { throw new InvalidOperationException( "Trying to register a second GameObject " + " with element identifier " + PrintKey(element) ); } else if (RegisteredObjects.ContainsKey(element) && RetrieveObject(element) == null) { // assume a deliberate replace intent RegisteredObjects[element] = Instance; } else { RegisteredObjects.Add(element, Instance); } if (PersistThroughScenes) { GameObject.DontDestroyOnLoad(Instance); GameObject.DontDestroyOnLoad(Instance.gameObject); } }
/// <summary> /// Indicates that series is using an axis. /// </summary> /// <param name="value">The series using the axis.</param> internal void Register(object value) { Debug.Assert(value != null, "object cannot be null."); Debug.Assert(!RegisteredObjects.Contains(value), "object has already been registered with the axis."); RegisteredObjects.Add(value); IsUsed = true; OnObjectRegistered(value); }
GenericRegisterObject (GameObject originalObject, bool objectIsAPrefab, InitialisationDelegate initialisationCallback, int Index) { GameObject Instance; if (objectIsAPrefab) { GameObject Prefab = originalObject; Instance = GameObject.Instantiate(Prefab); Debug.Assert(Instance != null, "Instantiate returned null"); } else { Instance = originalObject; Debug.Assert(Instance != null, "Provided object was null"); } if (initialisationCallback != null) { initialisationCallback(Instance, Index); } IGameObjectRegistryKeyComponent KeyComponent = Instance.GetComponent <IGameObjectRegistryKeyComponent>(); int element = KeyComponent.Key; //Debug.Log("Adding element " + element.ToString() + " to the dictionary."); if (RegisteredObjects.ContainsKey(element) && RetrieveObject(element) != null) { throw new InvalidOperationException( "Trying to register a second GameObject " + " with element identifier " + PrintKey(element) ); } else { RegisteredObjects.Add(element, Instance); } if (PersistThroughScenes) { GameObject.DontDestroyOnLoad(Instance); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Config.DesignerSettings.ShowInTaskbar = true; Config.SplashScreenEnabled = true; using (Report report = new Report()) { RegisteredObjects.Add(typeof(HtmlObject), "ReportPage", 246, 18); report.Design(); } }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); RegisteredObjects.Add(typeof(ParticleSystem), "ReportPage", ParticleSystemFRNet.Properties.Resources.ParticleSystemIcon, "Particle System"); Config.DesignerSettings.ShowInTaskbar = true; Config.SplashScreenEnabled = true; using (Report report = new Report()) { report.Design(); } }
public void Resume(Stream stream) { RegisteredTypes.Clear(); RegisteredObjects.Clear(); BinaryFormatter bf = new BinaryFormatter(); RegisteredTypes = (Dictionary <uint, Type>)bf.Deserialize(stream); byte[] aCount = new byte[sizeof(int)]; stream.Read(aCount, 0, sizeof(int)); int count = BitConverter.ToInt32(aCount, 0); int i = 0; while (i < count) { SaveableObject so = ResumeObject(stream) as SaveableObject; RegisteredObjects.Add(so.Id, so); ++i; } }
public static void RegisterForListening(ObservableObject objectToRegister) { objectToRegister.PropertyChanged += ObjectToRegister_PropertyChanged; RegisteredObjects.Add(objectToRegister); }
/// <summary> /// Registers all core objects, wizards, export filters. /// </summary> public AssemblyInitializer() { // report RegisteredObjects.AddReport(typeof(Report), 134); // pages RegisteredObjects.AddPage(typeof(ReportPage), "ReportPage", 135); // data items RegisteredObjects.Add(typeof(Column), "", 0); RegisteredObjects.Add(typeof(CommandParameter), "", 0); RegisteredObjects.Add(typeof(Relation), "", 0); RegisteredObjects.Add(typeof(Parameter), "", 0); RegisteredObjects.Add(typeof(Total), "", 0); RegisteredObjects.Add(typeof(TableDataSource), "", 0); RegisteredObjects.Add(typeof(ViewDataSource), "", 0); RegisteredObjects.Add(typeof(BusinessObjectDataSource), "", 0); RegisteredObjects.Add(typeof(SliceCubeSource), "", 0); RegisteredObjects.AddConnection(typeof(XmlDataConnection)); RegisteredObjects.AddConnection(typeof(CsvDataConnection)); // json RegisteredObjects.Add(typeof(Data.JsonConnection.JsonTableDataSource), "", 0); //RegisteredObjects.Add(typeof(Data.JsonConnection.JsonObjectDataSource), "", 0); //RegisteredObjects.Add(typeof(Data.JsonConnection.JsonArrayDataSource), "", 0); RegisteredObjects.AddConnection(typeof(Data.JsonConnection.JsonDataSourceConnection)); // formats RegisteredObjects.Add(typeof(BooleanFormat), "", 0); RegisteredObjects.Add(typeof(CurrencyFormat), "", 0); RegisteredObjects.Add(typeof(CustomFormat), "", 0); RegisteredObjects.Add(typeof(DateFormat), "", 0); RegisteredObjects.Add(typeof(GeneralFormat), "", 0); RegisteredObjects.Add(typeof(NumberFormat), "", 0); RegisteredObjects.Add(typeof(PercentFormat), "", 0); RegisteredObjects.Add(typeof(TimeFormat), "", 0); // bands RegisteredObjects.Add(typeof(ReportTitleBand), "", 154, "Objects,Bands,ReportTitle"); RegisteredObjects.Add(typeof(ReportSummaryBand), "", 155, "Objects,Bands,ReportSummary"); RegisteredObjects.Add(typeof(PageHeaderBand), "", 156, "Objects,Bands,PageHeader"); RegisteredObjects.Add(typeof(PageFooterBand), "", 157, "Objects,Bands,PageFooter"); RegisteredObjects.Add(typeof(ColumnHeaderBand), "", 158, "Objects,Bands,ColumnHeader"); RegisteredObjects.Add(typeof(ColumnFooterBand), "", 159, "Objects,Bands,ColumnFooter"); RegisteredObjects.Add(typeof(DataHeaderBand), "", 160, "Objects,Bands,DataHeader"); RegisteredObjects.Add(typeof(DataFooterBand), "", 161, "Objects,Bands,DataFooter"); RegisteredObjects.Add(typeof(DataBand), "", 162, "Objects,Bands,Data"); RegisteredObjects.Add(typeof(GroupHeaderBand), "", 163, "Objects,Bands,GroupHeader"); RegisteredObjects.Add(typeof(GroupFooterBand), "", 164, "Objects,Bands,GroupFooter"); RegisteredObjects.Add(typeof(ChildBand), "", 165, "Objects,Bands,Child"); RegisteredObjects.Add(typeof(OverlayBand), "", 166, "Objects,Bands,Overlay"); // report objects RegisteredObjects.Add(typeof(TextObject), "ReportPage", 102, 1); RegisteredObjects.Add(typeof(PictureObject), "ReportPage", 103, 2); RegisteredObjects.AddCategory("ReportPage,Shapes", 106, 4, "Objects,Shapes"); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 105, "Objects,Shapes,Line", 0, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 107, "Objects,Shapes,DiagonalLine", 1, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 150, "Objects,Shapes,DiagonalLine", 2, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 151, "Objects,Shapes,DiagonalLine", 3, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 152, "Objects,Shapes,DiagonalLine", 4, true); //RegisteredObjects.Add(typeof(BezierObject), "ReportPage,Shapes", 239, "Objects,Shapes,Bezier", 5, true); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 108, "Objects,Shapes,Rectangle", 0); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 109, "Objects,Shapes,RoundRectangle", 1); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 110, "Objects,Shapes,Ellipse", 2); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 111, "Objects,Shapes,Triangle", 3); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 131, "Objects,Shapes,Diamond", 4); RegisteredObjects.Add(typeof(PolyLineObject), "ReportPage,Shapes", 240, "Objects,Shapes,Polyline"); RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 241, "Objects,Shapes,Polygon"); RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 242, "Objects,Shapes,Pentagon", 0x50); RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 243, "Objects,Shapes,Hexagon", 0x60); RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 244, "Objects,Shapes,Heptagon", 0x70); RegisteredObjects.Add(typeof(PolygonObject), "ReportPage,Shapes", 245, "Objects,Shapes,Octagon", 0x80); RegisteredObjects.Add(typeof(SubreportObject), "ReportPage", 104, 5); RegisteredObjects.Add(typeof(ContainerObject), "ReportPage", 144, 5); RegisteredObjects.Add(typeof(TableObject), "ReportPage", 127, 6); RegisteredObjects.Add(typeof(TableColumn), "", 215); RegisteredObjects.Add(typeof(TableRow), "", 216); RegisteredObjects.Add(typeof(TableCell), "", 214); RegisteredObjects.Add(typeof(MatrixObject), "ReportPage", 142, 7); #if !COMMUNITY RegisteredObjects.Add(typeof(CrossViewObject), "ReportPage", 247, 8); #endif RegisteredObjects.AddCategory("ReportPage,Barcodes", 123, 9, "Objects,BarcodeObject"); for (int i = 0; i <= Barcodes.Items.Length - 1; i++) { RegisteredObjects.Add(typeof(BarcodeObject), "ReportPage,Barcodes", -1, "ComponentMenu,Barcode,Barcodes,Barcode" + i, i); } RegisteredObjects.Add(typeof(CheckBoxObject), "ReportPage", 124, 10); RegisteredObjects.Add(typeof(ZipCodeObject), "ReportPage", 129, 14); RegisteredObjects.Add(typeof(CellularTextObject), "ReportPage", 121, 15); RegisteredObjects.AddCategory("ReportPage,Gauge", 140, 17, "Objects,Gauge"); RegisteredObjects.Add(typeof(LinearGauge), "ReportPage,Gauge", -1, "Objects,Gauge,Linear", 0, false); RegisteredObjects.Add(typeof(SimpleGauge), "ReportPage,Gauge", -1, "Objects,Gauge,Simple", 0, false); RegisteredObjects.Add(typeof(RadialGauge), "ReportPage,Gauge", -1, "Objects,Gauge,Radial", 0, false); RegisteredObjects.Add(typeof(SimpleProgressGauge), "ReportPage,Gauge", -1, "Objects,Gauge,SimpleProgress", 0, false); // RegisteredObjects.Add(typeof(CrossBandObject), "ReportPage", 11, "Cross-band line", 0); // RegisteredObjects.Add(typeof(CrossBandObject), "ReportPage", 11, "Cross-band rectangle", 1); RegisteredObjects.Add(typeof(HtmlObject), "ReportPage", 246, 18); // exports RegisteredObjects.AddExport(typeof(ImageExport), "Image", "Export,Image,File"); // functions RegisteredObjects.AddCategory("Functions", -1, ""); StdFunctions.Register(); }
/// <summary> /// Registers all standard objects, wizards, export filters. /// </summary> public AssemblyInitializer() { // report RegisteredObjects.AddReport(typeof(Report), 134); // pages RegisteredObjects.AddPage(typeof(DialogPage), "DialogPage", 136); RegisteredObjects.AddPage(typeof(ReportPage), "ReportPage", 135); // data items RegisteredObjects.Add(typeof(Column), "", 0); RegisteredObjects.Add(typeof(CommandParameter), "", 0); RegisteredObjects.Add(typeof(Relation), "", 0); RegisteredObjects.Add(typeof(Parameter), "", 0); RegisteredObjects.Add(typeof(Total), "", 0); RegisteredObjects.Add(typeof(TableDataSource), "", 0); RegisteredObjects.Add(typeof(ViewDataSource), "", 0); RegisteredObjects.Add(typeof(BusinessObjectDataSource), "", 0); RegisteredObjects.AddConnection(typeof(MsAccessDataConnection)); RegisteredObjects.AddConnection(typeof(XmlDataConnection)); RegisteredObjects.AddConnection(typeof(OleDbDataConnection)); RegisteredObjects.AddConnection(typeof(MsSqlDataConnection)); RegisteredObjects.AddConnection(typeof(OdbcDataConnection)); // formats RegisteredObjects.Add(typeof(BooleanFormat), "", 0); RegisteredObjects.Add(typeof(CurrencyFormat), "", 0); RegisteredObjects.Add(typeof(CustomFormat), "", 0); RegisteredObjects.Add(typeof(DateFormat), "", 0); RegisteredObjects.Add(typeof(GeneralFormat), "", 0); RegisteredObjects.Add(typeof(NumberFormat), "", 0); RegisteredObjects.Add(typeof(PercentFormat), "", 0); RegisteredObjects.Add(typeof(TimeFormat), "", 0); // dialog controls RegisteredObjects.Add(typeof(ButtonControl), "DialogPage", 115); RegisteredObjects.Add(typeof(CheckBoxControl), "DialogPage", 116); RegisteredObjects.Add(typeof(CheckedListBoxControl), "DialogPage", 148); RegisteredObjects.Add(typeof(ComboBoxControl), "DialogPage", 119); RegisteredObjects.Add(typeof(GridControl), "DialogPage", 122); RegisteredObjects.Add(typeof(DataSelectorControl), "DialogPage", 128); RegisteredObjects.Add(typeof(DateTimePickerControl), "DialogPage", 120); RegisteredObjects.Add(typeof(GroupBoxControl), "DialogPage", 143); RegisteredObjects.Add(typeof(LabelControl), "DialogPage", 112); RegisteredObjects.Add(typeof(ListBoxControl), "DialogPage", 118); RegisteredObjects.Add(typeof(ListViewControl), "DialogPage", 203); RegisteredObjects.Add(typeof(MaskedTextBoxControl), "DialogPage", 147); RegisteredObjects.Add(typeof(MonthCalendarControl), "DialogPage", 145); RegisteredObjects.Add(typeof(NumericUpDownControl), "DialogPage", 146); RegisteredObjects.Add(typeof(PanelControl), "DialogPage", 144); RegisteredObjects.Add(typeof(PictureBoxControl), "DialogPage", 103); RegisteredObjects.Add(typeof(RadioButtonControl), "DialogPage", 117); RegisteredObjects.Add(typeof(RichTextBoxControl), "DialogPage", 205); RegisteredObjects.Add(typeof(TextBoxControl), "DialogPage", 113); RegisteredObjects.Add(typeof(TreeViewControl), "DialogPage", 204); // bands RegisteredObjects.Add(typeof(ReportTitleBand), "", 154, "Objects,Bands,ReportTitle"); RegisteredObjects.Add(typeof(ReportSummaryBand), "", 155, "Objects,Bands,ReportSummary"); RegisteredObjects.Add(typeof(PageHeaderBand), "", 156, "Objects,Bands,PageHeader"); RegisteredObjects.Add(typeof(PageFooterBand), "", 157, "Objects,Bands,PageFooter"); RegisteredObjects.Add(typeof(ColumnHeaderBand), "", 158, "Objects,Bands,ColumnHeader"); RegisteredObjects.Add(typeof(ColumnFooterBand), "", 159, "Objects,Bands,ColumnFooter"); RegisteredObjects.Add(typeof(DataHeaderBand), "", 160, "Objects,Bands,DataHeader"); RegisteredObjects.Add(typeof(DataFooterBand), "", 161, "Objects,Bands,DataFooter"); RegisteredObjects.Add(typeof(DataBand), "", 162, "Objects,Bands,Data"); RegisteredObjects.Add(typeof(GroupHeaderBand), "", 163, "Objects,Bands,GroupHeader"); RegisteredObjects.Add(typeof(GroupFooterBand), "", 164, "Objects,Bands,GroupFooter"); RegisteredObjects.Add(typeof(ChildBand), "", 165, "Objects,Bands,Child"); RegisteredObjects.Add(typeof(OverlayBand), "", 166, "Objects,Bands,Overlay"); // report objects RegisteredObjects.Add(typeof(TextObject), "ReportPage", 102); RegisteredObjects.Add(typeof(PictureObject), "ReportPage", 103); RegisteredObjects.AddCategory("ReportPage,Shapes", 106, "Objects,Shapes"); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 105, "Objects,Shapes,Line", 0, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 107, "Objects,Shapes,DiagonalLine", 1, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 150, "Objects,Shapes,DiagonalLine", 2, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 151, "Objects,Shapes,DiagonalLine", 3, true); RegisteredObjects.Add(typeof(LineObject), "ReportPage,Shapes", 152, "Objects,Shapes,DiagonalLine", 4, true); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 108, "Objects,Shapes,Rectangle", 0); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 109, "Objects,Shapes,RoundRectangle", 1); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 110, "Objects,Shapes,Ellipse", 2); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 111, "Objects,Shapes,Triangle", 3); RegisteredObjects.Add(typeof(ShapeObject), "ReportPage,Shapes", 131, "Objects,Shapes,Diamond", 4); RegisteredObjects.Add(typeof(SubreportObject), "ReportPage", 104); RegisteredObjects.Add(typeof(TableObject), "ReportPage", 127); RegisteredObjects.Add(typeof(TableColumn), "", 215); RegisteredObjects.Add(typeof(TableRow), "", 216); RegisteredObjects.Add(typeof(TableCell), "", 214); RegisteredObjects.Add(typeof(MatrixObject), "ReportPage", 142); RegisteredObjects.Add(typeof(BarcodeObject), "ReportPage", 123); RegisteredObjects.Add(typeof(RichObject), "ReportPage", 126); RegisteredObjects.Add(typeof(CheckBoxObject), "ReportPage", 124); RegisteredObjects.Add(typeof(MSChartObject), "ReportPage", 125); RegisteredObjects.Add(typeof(MSChartSeries), "", 130); RegisteredObjects.Add(typeof(ZipCodeObject), "ReportPage", 129); RegisteredObjects.Add(typeof(CellularTextObject), "ReportPage", 121); // RegisteredObjects.Add(typeof(CrossBandObject), "ReportPage", 11, "Cross-band line", 0); // RegisteredObjects.Add(typeof(CrossBandObject), "ReportPage", 11, "Cross-band rectangle", 1); // wizards RegisteredObjects.AddWizard(typeof(BlankReportWizard), 134, "Wizards,BlankReport", false); RegisteredObjects.AddWizard(typeof(InheritedReportWizard), 134, "Wizards,InheritedReport", false); RegisteredObjects.AddWizard(typeof(StandardReportWizard), 133, "Wizards,StandardReport", false); RegisteredObjects.AddWizard(typeof(LabelWizard), 133, "Wizards,Label", false); RegisteredObjects.AddWizard(typeof(NewPageWizard), 135, "Wizards,NewPage", true); RegisteredObjects.AddWizard(typeof(NewDialogWizard), 136, "Wizards,NewDialog", true); RegisteredObjects.AddWizard(typeof(NewDataSourceWizard), 137, "Wizards,NewDataSource", true); // exports RegisteredObjects.AddExport(typeof(PDFExport), "Export,Pdf,File", 201); RegisteredObjects.AddExport(typeof(RTFExport), "Export,RichText,File", 190); RegisteredObjects.AddExport(typeof(HTMLExport), "Export,Html,File"); RegisteredObjects.AddExport(typeof(MHTExport), "Export,Mht,File"); RegisteredObjects.AddExport(typeof(XMLExport), "Export,Xml,File", 191); RegisteredObjects.AddExport(typeof(Excel2007Export), "Export,Xlsx,File", 191); RegisteredObjects.AddExport(typeof(PowerPoint2007Export), "Export,Pptx,File"); RegisteredObjects.AddExport(typeof(ODSExport), "Export,Ods,File"); RegisteredObjects.AddExport(typeof(ODTExport), "Export,Odt,File"); RegisteredObjects.AddExport(typeof(XPSExport), "Export,Xps,File"); RegisteredObjects.AddExport(typeof(CSVExport), "Export,Csv,File"); RegisteredObjects.AddExport(typeof(DBFExport), "Export,Dbf,File"); RegisteredObjects.AddExport(typeof(TextExport), "Export,Text,File"); RegisteredObjects.AddExport(typeof(ImageExport), "Export,Image,File"); #if false RegisteredObjects.AddExport(typeof(Word2007Export), "Export,Docx,File"); #endif // functions RegisteredObjects.AddCategory("Functions", -1, ""); StdFunctions.Register(); }
static DesignerClipboard() { RegisteredObjects.Add(typeof(ClipboardParent), "", 0); }
public AssemblyInitializer() { RegisteredObjects.Add(typeof(ParticleSystem), "ReportPage", Properties.Resources.ParticleSystemIcon, "Particle System"); }