コード例 #1
0
        private Section LoadSection()
        {
            Stream         str        = null;
            OpenFileDialog LoadWindow = new OpenFileDialog()
            {
                InitialDirectory = "c:\\Pulpit",
                Filter           = "All files (*.*)|*.*|JPG (*.jpg)|*.jpg",
                FilterIndex      = 2,
                RestoreDirectory = true
            };

            try
            {
                LoadWindow.ShowDialog();
                str = LoadWindow.OpenFile();
                if (str != null)
                {
                    Bitmap img = new Bitmap(str);

                    StringPackage pac     = new StringPackage("");
                    NewName       newName = new NewName(pac);
                    newName.ShowDialog();
                    Section sec = new Section(pac.Content, img);
                    AddToList(sec);
                    return(sec);
                }
            }
            catch
            {
                return(null);
            }
            return(null);
        }
コード例 #2
0
        private void OnNewNameButtonClick(object sender, RoutedEventArgs e)
        {
            StringPackage pac     = new StringPackage("");
            NewName       newName = new NewName(pac);

            newName.ShowDialog();
            string na = pac.Content;

            if (!na.Contains(".kml"))
            {
                na += ".kml";
            }

            ((Kml)ChosenFile.Root).Feature.Name = na;
        }
コード例 #3
0
        private void OnMakeProfileButtonClick(object sender, RoutedEventArgs e)
        {
            Profile profile = new Profile();

            profile.ProfKmlFile = ChosenFile;
            ChooseSectionWindow chooseSectionWindow = new ChooseSectionWindow(profile);

            foreach (Section i in SectionCollection)
            {
                FileButton <Section> button = new FileButton <Section>(i);
                button.Margin  = new Thickness(10, 5, 5, 10);
                button.Content = i.Name;
                button.Click  += chooseSectionWindow.OnButtClick;
                chooseSectionWindow.Stack.Children.Add(button);
            }

            chooseSectionWindow.ShowDialog();
            StringPackage pac     = new StringPackage("");
            NewName       newName = new NewName(pac);

            newName.ShowDialog();
            profile.Name = pac.Content;
            AddToList(profile);
        }
コード例 #4
0
 public NewName(StringPackage p)
 {
     InitializeComponent();
     Namee = p;
 }
コード例 #5
0
        public bool SendCommand(U3Server server, string command)
        {
            StringPackage package = new StringPackage(NetPackageHeader.Command, command);

            return(SendPackage(server, package));
        }