コード例 #1
0
ファイル: Doh.cs プロジェクト: Retroroid/SekaiNi
 public void CreateChildNode()
 {
     if (Child != null)
     {
         throw new Exception("Doh already has a child Doh. (Sekai.Doh.CreateChildNode)");
     }
     Child = new Doh();
 }
コード例 #2
0
        // ---------------- Constructors ---------------- ---------------- //
        public DohEdit()
        {
            ViewItem = new Doh();
            InitializeComponent();
            DataContext = this;

            AddSomeData();
        }
コード例 #3
0
ファイル: Doh.cs プロジェクト: Retroroid/SekaiNi
 public void InsertNode(bool GoesBeforeThis, Doh ToInsert)
 {
     if (GoesBeforeThis)
     {
         ToInsert.Parent       = Parent;
         ToInsert.Child        = this;
         ToInsert.Parent.Child = ToInsert;
         Parent = ToInsert;
     }
     else
     {
         ToInsert.Child        = Child;
         ToInsert.Parent       = this;
         ToInsert.Child.Parent = ToInsert;
         Child = ToInsert;
     }
 }
コード例 #4
0
        private void MenuItemLoad_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog {
                InitialDirectory = $"{Database.DPath}\\{ViewItem.ClassType}"
            };

            if (ofd.ShowDialog() == true)
            {
                string[] FilePath = ofd.FileName.Split('\\');
                string   str      = FilePath[FilePath.Length - 1];
                if (str.Contains(".bin"))
                {
                    str = str.Replace(".bin", string.Empty);
                    str = str.Substring(3);
                }
                Doh newDoh = new Doh {
                    Name = str
                };
                new DohEdit(newDoh.DeserializeFile()).Show();
            }
        }
コード例 #5
0
 public DohEdit(Doh DoneHundo)
 {
     ViewItem = DoneHundo;
     InitializeComponent();
     DataContext = this;
 }