internal static HBase Load(string filename = null) { HBase hbase = BinarySerialization.ReadFromBinaryFile <HBase>(filename); hbase.dirty = false; return(hbase); }
static void Main() { hbase = HBase.CreateExample(); visibleNetworkDrives = new List <NetworkDrive>(); visibleLocalDrives = new List <LocalDrive>(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); }
internal static HBase CreateExample() { HBase hb = new HBase { name = "Example Base", }; /* * HDir r; * r = hb.root.GetPath(@"%:\cars", true); r.GetFile("ford", true); r.GetFile("mazda", true); * r = hb.root.GetPath(@"%:\fruit", true); r.GetFile("apple", true); r.GetFile("orange", true); * r = hb.root.GetPath(@"%:\fruit\green", true); r.GetFile("cucumber", true); r.GetFile("avocado", true); * r = hb.root.GetPath(@"%:\animals", true); r.GetFile("cat", true); r.GetFile("dog", true); * r = hb.root.GetPath(@"%:\animals\large", true); r.GetFile("elephant", true); r.GetFile("whale", true); */ if (hb.volumes == null) { hb.volumes = new Volumes(); } if (hb.volumes == null) { hb.volumes = new Volumes(); } hb.volumes.Add(new Volume("smarkofag")); hb.volumes["smarkofag"].AddKnownLocation(new KnownLocation(new RecognitionVolumeLabel("SD_MAKROFAG"))); hb.volumes.Add(new Volume("koszyk_c")); hb.volumes["koszyk_c"].AddKnownLocation(new KnownLocation(new RecognitionServerShare(@"\\KOSZYK\C"))); hb.volumes["koszyk_c"].AddKnownLocation(new KnownLocation(new RecognitionFile(@"Users\Ailinon"))); hb.volumes.Add(new Volume("kaszalot")); hb.volumes["kaszalot"].AddKnownLocation(new KnownLocation(new RecognitionFile(@"kaszalot.txt"))); hb.volumes.Add(new Volume("sigejt bekap")); hb.volumes["sigejt bekap"].AddKnownLocation(new KnownLocation(new RecognitionFile(@"sigejt bekap.txt"))); hb.volumes.Add(new Volume("paluch")); hb.volumes["paluch"].AddKnownLocation(new KnownLocation(new RecognitionVolumeLabel("PALUCH"))); hb.volumes.Add(new Volume("monolit_c")); hb.volumes["monolit_c"].AddKnownLocation(new KnownLocation(new RecognitionVolumeLabel("SSD Windows"))); hb.volumes.Add(new Volume("nautilus_c")); hb.volumes["nautilus_c"].AddKnownLocation(new KnownLocation(new RecognitionVolumeLabel("ACER"))); hb.volumes["koszyk_c"]?.AddMapping(@"\ZDJECIA\MISC", @"%:\FOTO\MISC"); hb.volumes["monolit_c"]?.AddMapping(@"\FOTO\MISC", @"%:\FOTO\MISC"); hb.volumes["monolit_c"]?.AddMapping(@"\FOTO\MISC2", @"%:\FOTO\MISC"); hb.volumes["monolit_c"]?.AddMapping(@"\FOTO\łyżwy", @"%:\FOTO\łyżwy"); return(hb); }
internal static void BaseLoad(string filename = null) { if (filename == null) { OpenFileDialog ofd = new OpenFileDialog(); DialogResult dr = ofd.ShowDialog(); if (dr == DialogResult.OK) { filename = ofd.FileName; } } if (filename != null) { hbase = HBase.Load(filename); BaseOnLoaded(true); } }