public XYZObject()
        {
            var dataSourceManager = DataManager.DataSourceManager;

            _structuredArchiveDataSource = XYZOjectDataSourceFactory.Get(dataSourceManager);
            //
            _droid = _structuredArchiveDataSource.GenerateDroid();
            _structuredArchiveDataSource.AddItem(_droid, this);
        }
        /// <summary>
        /// Gets the data source that uses StructuredArchive serialization.
        /// Data stored in StructuredArchiveDataSource is only saved if IsDirty is true.
        /// The flag is automatically set to true if a new object is added to the datasource, but plug-ins are responsible to set IsDirty on any change in the domain object data which must be serialized.
        /// </summary>
        public override IDataSource GetDataSource()
        {
            //Add custom domain object types into this array
            Type[] supportedTypes = { typeof(XYZObject) };
            StructuredArchiveDataSource dataSource = new StructuredArchiveDataSource(DataSourceId, supportedTypes);

            //Register archivable surrogates here
            //dataSource.AddArchivableSurrogate(new XYZOjectDataSourceFactoryFacadeSurrogate<Borehole>());
            return(dataSource);
        }
        public SaveableArguments()
        {
            sADS = CONNECTModifiedKhDataSourceFactory.Get(DataManager.DataSourceManager);

            if (sADS != null)
            {
                Droid = PermMatching.ArgsDroid;
                sADS.AddItem(Droid, this);

            }
        }
Esempio n. 4
0
        protected override Arguments CreateArgumentPackageCore(IDataSourceManager manager)
        {
            Arguments argPack = new Arguments();

            StructuredArchiveDataSource dataSource = manager.GetSource(ArgumentPackageDataSourceFactory.DataSourceId) as StructuredArchiveDataSource;

            if (dataSource != null)
            {
                argPack.Droid = dataSource.GenerateDroid();
                dataSource.AddItem(argPack.Droid, argPack);
            }

            return(argPack);
        }
 private void SetDataSourceToDirty()
 {
     if (sADS != null)
     {
         sADS.IsDirty = true;
     }
     else
     {
         sADS = CONNECTModifiedKhDataSourceFactory.Get(DataManager.DataSourceManager);
         sADS.IsDirty = true;
     }
 }
 public override Slb.Ocean.Core.IDataSource GetDataSource()
 {
     StructuredArchiveDataSource SADS = new StructuredArchiveDataSource(DataSourceId, new [] {typeof(SaveableArguments)});
     return SADS;
 }