public void ReadFromDisk( string in_filename )
        {
            Type type = typeof( SerializableDictionary<string, EntityCollection> );
            // not sure if this behavior is good - we read file if it exists, otherwise we
            // don't worry about it.
            if( File.Exists( in_filename ) ) {
                FileStream fs = new FileStream( in_filename, FileMode.Open, FileAccess.Read );
                try {
                    Microsoft.Xrm.Sdk.KnownTypesResolver resolver = new Microsoft.Xrm.Sdk.KnownTypesResolver();
                    data = ( SerializableDictionary<string, EntityCollection> )ContractSerializer.Deserialize( type, fs, resolver );
                }
                finally { fs.Close(); }

            }
        }
Пример #2
0
        public void ReadFromDisk(string in_filename)
        {
            Type type = typeof(SerializableDictionary <string, EntityCollection>);

            // not sure if this behavior is good - we read file if it exists, otherwise we
            // don't worry about it.
            if (File.Exists(in_filename))
            {
                FileStream fs = new FileStream(in_filename, FileMode.Open, FileAccess.Read);
                try {
                    Microsoft.Xrm.Sdk.KnownTypesResolver resolver = new Microsoft.Xrm.Sdk.KnownTypesResolver();
                    data = (SerializableDictionary <string, EntityCollection>)ContractSerializer.Deserialize(type, fs, resolver);
                }
                finally { fs.Close(); }
            }
        }
 public KnownAssemblyAttribute()
 {
     this.resolver = new KnownTypesResolver();
 }